/* Generated by Cython 3.0.7 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "/io/cuda/include/cuda",
            "/io/cuda/include/cuda.h",
            "/io/cuda/include/cudaProfiler.h",
            "/io/cuda/include/cuda_runtime_api.h",
            "/io/cuda/include/device_types.h",
            "/io/cuda/include/driver_types.h",
            "/io/cuda/include/library_types.h",
            "/io/cuda/include/surface_types.h",
            "/io/cuda/include/texture_types.h",
            "/io/cuda/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_1705509865348/_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/include"
        ],
        "language": "c++",
        "library_dirs": [
            "/opt/conda/conda-bld/cuda-python_1705509865348/_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.9/site-packages",
            "/opt/conda/conda-bld/cuda-python_1705509865348/_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.utils",
        "sources": [
            "cuda/_lib/ccudart/utils.pyx"
        ]
    },
    "module_name": "cuda._lib.ccudart.utils"
}
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__utils
#define __PYX_HAVE_API__cuda___lib__ccudart__utils
/* Early includes */
#include <stdint.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>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <utility>

    #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)
    // move should be defined for these versions of MSVC, but __cplusplus isn't set usefully
    #include <type_traits>

    namespace cython_std {
    template <typename T> typename std::remove_reference<T>::type&& move(T& t) noexcept { return std::move(t); }
    template <typename T> typename std::remove_reference<T>::type&& move(T&& t) noexcept { return std::move(t); }
    }

    #endif
    
#include <map>
#include "cuda.h"
#include "cudaProfiler.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/utils.pyx",
  "<stringsource>",
};
/* #### 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/ccudart.pxd":1430
 *         cudaRoundMinInf = 3
 * 
 * ctypedef unsigned int GLenum             # <<<<<<<<<<<<<<
 * 
 * ctypedef unsigned int GLuint
 */
typedef unsigned int __pyx_t_4cuda_7ccudart_GLenum;

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

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

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

/* "cuda/ccudart.pxd":1453
 * 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":1455
 * ctypedef unsigned long long VdpGetProcAddress
 * 
 * ctypedef uint32_t VdpVideoSurface             # <<<<<<<<<<<<<<
 * 
 * ctypedef uint32_t VdpOutputSurface
 */
typedef uint32_t __pyx_t_4cuda_7ccudart_VdpVideoSurface;

/* "cuda/ccudart.pxd":1457
 * ctypedef uint32_t VdpVideoSurface
 * 
 * ctypedef uint32_t VdpOutputSurface             # <<<<<<<<<<<<<<
 * 
 * ctypedef cudaLaunchAttributeID cudaStreamAttrID
 */
typedef uint32_t __pyx_t_4cuda_7ccudart_VdpOutputSurface;

/* "cuda/ccuda.pxd":2338
 * 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":2340
 * ctypedef unsigned int GLenum
 * 
 * ctypedef unsigned int GLuint             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef unsigned int __pyx_t_4cuda_5ccuda_GLuint;

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

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

/* "cuda/ccuda.pxd":2361
 * 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":2363
 * ctypedef unsigned long long VdpGetProcAddress
 * 
 * ctypedef uint32_t VdpVideoSurface             # <<<<<<<<<<<<<<
 * 
 * ctypedef uint32_t VdpOutputSurface
 */
typedef uint32_t __pyx_t_4cuda_5ccuda_VdpVideoSurface;

/* "cuda/ccuda.pxd":2365
 * 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;
/* #### Code section: complex_type_declarations ### */
/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal;
struct __pyx_t_4cuda_7ccudart_cudaEglPlaneDesc_st;
union __pyx_t_4cuda_7ccudart_anon_union10;
struct __pyx_t_4cuda_7ccudart_cudaEglFrame_st;

/* "cuda/ccudart.pxd":1467
 * 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":1473
 * 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":1479
 * 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":1622
 * 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":1627
 *     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":2226
 * cdef cudaError_t getLocalRuntimeVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil
 * 
 * cdef enum: cudaHostAllocDefault = 0             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaHostAllocPortable = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaHostAllocDefault = 0
};

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* "cuda/ccudart.pxd":2328
 * 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":2330
 * 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":2332
 * 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":2334
 * cdef enum: cudaExternalMemoryDedicated = 1
 * 
 * cdef enum: cudaExternalSemaphoreSignalSkipNvSciBufMemSync = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaExternalSemaphoreWaitSkipNvSciBufMemSync = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaExternalSemaphoreSignalSkipNvSciBufMemSync = 1
};

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

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

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

/* "cuda/ccudart.pxd":2342
 * cdef enum: cudaNvSciSyncAttrWait = 2
 * 
 * cdef enum: cudaGraphKernelNodePortDefault = 0             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaGraphKernelNodePortProgrammatic = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaGraphKernelNodePortDefault = 0
};

/* "cuda/ccudart.pxd":2344
 * cdef enum: cudaGraphKernelNodePortDefault = 0
 * 
 * cdef enum: cudaGraphKernelNodePortProgrammatic = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaGraphKernelNodePortLaunchCompletion = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaGraphKernelNodePortProgrammatic = 1
};

/* "cuda/ccudart.pxd":2346
 * cdef enum: cudaGraphKernelNodePortProgrammatic = 1
 * 
 * cdef enum: cudaGraphKernelNodePortLaunchCompletion = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaStreamAttributeAccessPolicyWindow = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaGraphKernelNodePortLaunchCompletion = 2
};

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

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

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

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

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

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

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

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

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

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

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

/* "cuda/ccudart.pxd":2370
 * cdef enum: cudaKernelNodeAttributeMemSyncDomainMap = 9
 * 
 * cdef enum: cudaKernelNodeAttributeMemSyncDomain = 10             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaKernelNodeAttributeDeviceUpdatableKernelNode = 13
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaKernelNodeAttributeMemSyncDomain = 10
};

/* "cuda/ccudart.pxd":2372
 * cdef enum: cudaKernelNodeAttributeMemSyncDomain = 10
 * 
 * cdef enum: cudaKernelNodeAttributeDeviceUpdatableKernelNode = 13             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceType1D = 1
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaKernelNodeAttributeDeviceUpdatableKernelNode = 13
};

/* "cuda/ccudart.pxd":2374
 * cdef enum: cudaKernelNodeAttributeDeviceUpdatableKernelNode = 13
 * 
 * cdef enum: cudaSurfaceType1D = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: cudaSurfaceType2D = 2
 */
enum  {
  __pyx_e_4cuda_7ccudart_cudaSurfaceType1D = 1
};

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

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

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

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

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

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

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

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

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

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

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

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

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

/* "cuda/ccudart.pxd":2402
 * cdef enum: cudaTextureTypeCubemapLayered = 252
 * 
 * cdef enum: CUDART_VERSION = 12040             # <<<<<<<<<<<<<<
 * 
 * cdef enum: __CUDART_API_VERSION = 12040
 */
enum  {
  __pyx_e_4cuda_7ccudart_CUDART_VERSION = 0x2F08
};

/* "cuda/ccudart.pxd":2404
 * cdef enum: CUDART_VERSION = 12040
 * 
 * cdef enum: __CUDART_API_VERSION = 12040             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_EGL_MAX_PLANES = 3
 */
enum  {
  __pyx_e_4cuda_7ccudart___CUDART_API_VERSION = 0x2F08
};

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

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

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

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

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

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

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

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

/* "cuda/ccudart.pxd":1471
 *     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":1477
 *     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":1591
 *     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":1593
 * 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":1602
 *     unsigned int reserved[4]
 * 
 * ctypedef cudaEglPlaneDesc_st cudaEglPlaneDesc             # <<<<<<<<<<<<<<
 * 
 * cdef union anon_union10:
 */
typedef struct __pyx_t_4cuda_7ccudart_cudaEglPlaneDesc_st __pyx_t_4cuda_7ccudart_cudaEglPlaneDesc;

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

/* "cuda/ccudart.pxd":1608
 *     cudaPitchedPtr pPitch[3]
 * 
 * cdef struct cudaEglFrame_st:             # <<<<<<<<<<<<<<
 *     anon_union10 frame
 *     cudaEglPlaneDesc planeDesc[3]
 */
struct __pyx_t_4cuda_7ccudart_cudaEglFrame_st {
  union __pyx_t_4cuda_7ccudart_anon_union10 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":1615
 *     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":1620
 *     cdef struct CUeglStreamConnection_st:
 *         pass
 * ctypedef CUeglStreamConnection_st* cudaEglStreamConnection             # <<<<<<<<<<<<<<
 * 
 * cdef enum cudaGLDeviceList:
 */
typedef struct CUeglStreamConnection_st *__pyx_t_4cuda_7ccudart_cudaEglStreamConnection;
union __pyx_t_4cuda_5ccuda_anon_union14;
struct __pyx_t_4cuda_5ccuda_CUeglFrame_st;

/* "cuda/ccuda.pxd":2168
 *     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":2174
 * 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":2180
 * 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":2324
 * 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":2331
 * 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":3267
 * cdef CUresult cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
 * 
 * cdef enum: CUDA_VERSION = 12040             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_IPC_HANDLE_SIZE = 64
 */
enum  {
  __pyx_e_4cuda_5ccuda_CUDA_VERSION = 0x2F08
};

/* "cuda/ccuda.pxd":3269
 * cdef enum: CUDA_VERSION = 12040
 * 
 * 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":3271
 * 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":3273
 * 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":3275
 * cdef enum: CU_STREAM_PER_THREAD = 2
 * 
 * cdef enum: CU_COMPUTE_ACCELERATED_TARGET_BASE = 65536             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_GRAPH_COND_ASSIGN_DEFAULT = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_COMPUTE_ACCELERATED_TARGET_BASE = 0x10000
};

/* "cuda/ccuda.pxd":3277
 * cdef enum: CU_COMPUTE_ACCELERATED_TARGET_BASE = 65536
 * 
 * cdef enum: CU_GRAPH_COND_ASSIGN_DEFAULT = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_GRAPH_KERNEL_NODE_PORT_DEFAULT = 0
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_GRAPH_COND_ASSIGN_DEFAULT = 1
};

/* "cuda/ccuda.pxd":3279
 * cdef enum: CU_GRAPH_COND_ASSIGN_DEFAULT = 1
 * 
 * cdef enum: CU_GRAPH_KERNEL_NODE_PORT_DEFAULT = 0             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_GRAPH_KERNEL_NODE_PORT_DEFAULT = 0
};

/* "cuda/ccuda.pxd":3281
 * cdef enum: CU_GRAPH_KERNEL_NODE_PORT_DEFAULT = 0
 * 
 * cdef enum: CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER = 2
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC = 1
};

/* "cuda/ccuda.pxd":3283
 * cdef enum: CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC = 1
 * 
 * cdef enum: CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER = 2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER = 2
};

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

/* "cuda/ccuda.pxd":3287
 * 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":3289
 * 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":3291
 * 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":3293
 * 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":3295
 * 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":3297
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN = 10             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = 13
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN = 10
};

/* "cuda/ccuda.pxd":3299
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_MEM_SYNC_DOMAIN = 10
 * 
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = 13             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_KERNEL_NODE_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = 13
};

/* "cuda/ccuda.pxd":3301
 * cdef enum: CU_KERNEL_NODE_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = 13
 * 
 * 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":3303
 * 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":3305
 * 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":3307
 * 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":3309
 * 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":3311
 * 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":3313
 * 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":3315
 * 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":3317
 * 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":3319
 * 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":3321
 * 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":3323
 * 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":3325
 * 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":3327
 * 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":3329
 * 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":3331
 * 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":3333
 * 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":3335
 * 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":3337
 * 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":3339
 * 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":3341
 * 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":3343
 * 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":3345
 * 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":3347
 * 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":3349
 * 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":3351
 * 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":3353
 * 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":3355
 * 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":3357
 * 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":3359
 * 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":3361
 * 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":3363
 * 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":3365
 * 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":3367
 * 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":3369
 * 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":3371
 * 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":3373
 * 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":3375
 * 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":3377
 * 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":3379
 * 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":3381
 * 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":3383
 * 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":3385
 * 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":3387
 * 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":3389
 * 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":3391
 * cdef enum: CU_DEVICE_CPU = -1
 * 
 * cdef enum: CU_DEVICE_INVALID = -2             # <<<<<<<<<<<<<<
 * 
 * cdef enum: RESOURCE_ABI_VERSION = 1
 */
enum  {
  __pyx_e_4cuda_5ccuda_CU_DEVICE_INVALID = -2L
};

/* "cuda/ccuda.pxd":3393
 * cdef enum: CU_DEVICE_INVALID = -2
 * 
 * cdef enum: RESOURCE_ABI_VERSION = 1             # <<<<<<<<<<<<<<
 * 
 * cdef enum: RESOURCE_ABI_EXTERNAL_BYTES = 48
 */
enum  {
  __pyx_e_4cuda_5ccuda_RESOURCE_ABI_VERSION = 1
};

/* "cuda/ccuda.pxd":3395
 * cdef enum: RESOURCE_ABI_VERSION = 1
 * 
 * cdef enum: RESOURCE_ABI_EXTERNAL_BYTES = 48             # <<<<<<<<<<<<<<
 * 
 * cdef enum: MAX_PLANES = 3
 */
enum  {
  __pyx_e_4cuda_5ccuda_RESOURCE_ABI_EXTERNAL_BYTES = 48
};

/* "cuda/ccuda.pxd":3397
 * cdef enum: RESOURCE_ABI_EXTERNAL_BYTES = 48
 * 
 * cdef enum: MAX_PLANES = 3             # <<<<<<<<<<<<<<
 * 
 * cdef enum: CUDA_EGL_INFINITE_TIMEOUT = 4294967295
 */
enum  {
  __pyx_e_4cuda_5ccuda_MAX_PLANES = 3
};

/* "cuda/ccuda.pxd":3399
 * 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":2172
 *     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":2178
 *     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":2297
 *     CU_EGL_COLOR_FORMAT_MAX = 114
 * 
 * ctypedef CUeglColorFormat_enum CUeglColorFormat             # <<<<<<<<<<<<<<
 * 
 * cdef union anon_union14:
 */
typedef enum __pyx_t_4cuda_5ccuda_CUeglColorFormat_enum __pyx_t_4cuda_5ccuda_CUeglColorFormat;

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

/* "cuda/ccuda.pxd":2303
 *     void* pPitch[3]
 * 
 * cdef struct CUeglFrame_st:             # <<<<<<<<<<<<<<
 *     anon_union14 frame
 *     unsigned int width
 */
struct __pyx_t_4cuda_5ccuda_CUeglFrame_st {
  union __pyx_t_4cuda_5ccuda_anon_union14 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":2315
 *     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":2317
 * 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":2322
 *     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":2329
 *     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":2336
 *     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":2345
 *     cdef struct void:
 *         pass
 * ctypedef void* EGLImageKHR             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "":
 */
typedef void *__pyx_t_4cuda_5ccuda_EGLImageKHR;

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

/* "cuda/ccuda.pxd":2357
 *     cdef struct void:
 *         pass
 * ctypedef void* EGLSyncKHR             # <<<<<<<<<<<<<<
 * 
 * ctypedef uint32_t VdpDevice
 */
typedef void *__pyx_t_4cuda_5ccuda_EGLSyncKHR;
struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaAsyncCallbackData_st;
typedef struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaAsyncCallbackData_st __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaAsyncCallbackData_st;
struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice;
struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaArrayLocalState;
struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamCallbackData_st;
typedef struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamCallbackData_st __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamCallbackData_st;
struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamHostCallbackData_st;
typedef struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamHostCallbackData_st __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamHostCallbackData_st;

/* "cuda/_lib/ccudart/utils.pxd":15
 * cimport cuda._cuda.ccuda as ccuda
 * 
 * ctypedef struct cudaAsyncCallbackData_st:             # <<<<<<<<<<<<<<
 *     cudaAsyncCallback callback
 *     void *userData
 */
struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaAsyncCallbackData_st {
  cudaAsyncCallback callback;
  void *userData;
};

/* "cuda/_lib/ccudart/utils.pxd":19
 *     void *userData
 * 
 * ctypedef cudaAsyncCallbackData_st cudaAsyncCallbackData             # <<<<<<<<<<<<<<
 * 
 * cdef struct cudaPythonDevice:
 */
typedef __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaAsyncCallbackData_st __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaAsyncCallbackData;

/* "cuda/_lib/ccudart/utils.pxd":21
 * ctypedef cudaAsyncCallbackData_st cudaAsyncCallbackData
 * 
 * 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.pyx":15
 * cimport cuda._cuda.ccuda as ccuda
 * 
 * cdef struct cudaArrayLocalState:             # <<<<<<<<<<<<<<
 *     ccuda.CUarray array
 *     cudaChannelFormatDesc desc
 */
struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaArrayLocalState {
  CUarray array;
  struct cudaChannelFormatDesc desc;
  size_t depth;
  size_t height;
  size_t width;
  size_t elementSize;
  size_t widthInBytes;
};

/* "cuda/_lib/ccudart/utils.pyx":24
 *     size_t widthInBytes
 * 
 * ctypedef struct cudaStreamCallbackData_st:             # <<<<<<<<<<<<<<
 *     cudaStreamCallback_t callback
 *     void *userData
 */
struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamCallbackData_st {
  cudaStreamCallback_t callback;
  void *userData;
};

/* "cuda/_lib/ccudart/utils.pyx":28
 *     void *userData
 * 
 * ctypedef cudaStreamCallbackData_st cudaStreamCallbackData             # <<<<<<<<<<<<<<
 * 
 * ctypedef struct cudaStreamHostCallbackData_st:
 */
typedef __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamCallbackData_st __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamCallbackData;

/* "cuda/_lib/ccudart/utils.pyx":30
 * ctypedef cudaStreamCallbackData_st cudaStreamCallbackData
 * 
 * ctypedef struct cudaStreamHostCallbackData_st:             # <<<<<<<<<<<<<<
 *     cudaHostFn_t callback
 *     void *userData
 */
struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamHostCallbackData_st {
  cudaHostFn_t callback;
  void *userData;
};

/* "cuda/_lib/ccudart/utils.pyx":34
 *     void *userData
 * 
 * ctypedef cudaStreamHostCallbackData_st cudaStreamHostCallbackData             # <<<<<<<<<<<<<<
 * 
 * cdef class cudaPythonGlobal:
 */
typedef __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamHostCallbackData_st __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamHostCallbackData;

/* "cuda/_lib/ccudart/utils.pxd":28
 *     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;
  std::map<cudaAsyncCallbackHandle_t,__pyx_t_4cuda_4_lib_7ccudart_5utils_cudaAsyncCallbackData *>  _asyncCallbackDataMap;
};



/* "cuda/_lib/ccudart/utils.pyx":36
 * ctypedef cudaStreamHostCallbackData_st cudaStreamHostCallbackData
 * 
 * cdef class cudaPythonGlobal:             # <<<<<<<<<<<<<<
 *     def __cinit__(self):
 *         self._lazyInitDriver = False
 */

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);

/* TupleAndListFromArray.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif

/* IncludeStringH.proto */
#include <string.h>

/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
#else
    #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
#endif
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
    #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
#else
    #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op
    #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed
#endif
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
    #define __Pyx_Arg_FASTCALL(args, i) args[i]
    #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
    #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
    static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
    #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs
    #define __Pyx_Arg_XDECREF_FASTCALL(arg)  // no-op - arg was returned from array
#else
    #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
    #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
    #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
    #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
#else
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* KeywordStringCheck.proto */
static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);

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

/* MoveIfSupported.proto */
#if CYTHON_USE_CPP_STD_MOVE
  #include <utility>
  #define __PYX_STD_MOVE_IF_SUPPORTED(x) std::move(x)
#else
  #define __PYX_STD_MOVE_IF_SUPPORTED(x) x
#endif

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

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

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
    PyObject **argnames[],
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
    const char* function_name);

/* IncludeStructmemberH.proto */
#include <structmember.h>

/* FixUpExtensionType.proto */
#if CYTHON_USE_TYPE_SPECS
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
#endif

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#if !CYTHON_VECTORCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
#if !CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03080000
  #include "frameobject.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
  #define __Pxy_PyFrame_Initialize_Offsets()
  #define __Pyx_PyFrame_GetLocalsplus(frame)  ((frame)->f_localsplus)
#else
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif
#endif
#endif

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectFastCall.proto */
#define __Pyx_PyObject_FastCall(func, args, nargs)  __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);

/* PyObjectCallNoArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* ValidateBasesTuple.proto */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
#endif

/* PyType_Ready.proto */
CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);

/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif

/* PyObject_GenericGetAttr.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
#endif

/* SetVTable.proto */
static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);

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

/* MergeVTables.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_MergeVtables(PyTypeObject *type);
#endif

/* SetupReduce.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_setup_reduce(PyObject* type_obj);
#endif

/* FetchSharedCythonModule.proto */
static PyObject *__Pyx_FetchSharedCythonABIModule(void);

/* FetchCommonType.proto */
#if !CYTHON_USE_TYPE_SPECS
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
#else
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
#endif

/* PyMethodNew.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    typesModule = PyImport_ImportModule("types");
    if (!typesModule) return NULL;
    methodType = PyObject_GetAttrString(typesModule, "MethodType");
    Py_DECREF(typesModule);
    if (!methodType) return NULL;
    result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
    Py_DECREF(methodType);
    return result;
}
#elif PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    return PyMethod_New(func, self);
}
#else
    #define __Pyx_PyMethod_New PyMethod_New
#endif

/* PyVectorcallFastCallDict.proto */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
#endif

/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CYFUNCTION_COROUTINE     0x08
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_CyFunction_GetClassObj(f)\
      (((__pyx_CyFunctionObject *) (f))->func_classobj)
#else
  #define __Pyx_CyFunction_GetClassObj(f)\
      ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
#endif
#define __Pyx_CyFunction_SetClassObj(f, classobj)\
    __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject_HEAD
    PyObject *func;
#elif PY_VERSION_HEX < 0x030900B1
    PyCFunctionObject func;
#else
    PyCMethodObject func;
#endif
#if CYTHON_BACKPORT_VECTORCALL
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_classobj;
#endif
    void *defaults;
    int defaults_pyobjects;
    size_t defaults_size;  // used by FusedFunction for copying defaults
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
    PyObject *func_is_coroutine;
} __pyx_CyFunctionObject;
#undef __Pyx_CyOrPyCFunction_Check
#define __Pyx_CyFunction_Check(obj)  __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
#define __Pyx_CyOrPyCFunction_Check(obj)  __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj)  __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
#undef __Pyx_IsSameCFunction
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCyOrCFunction(func, cfunc)
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(PyObject *module);
#if CYTHON_METH_FASTCALL
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#if CYTHON_BACKPORT_VECTORCALL
#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
#else
#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
#endif
#endif

/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);

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

/* None.proto */
#include <new>

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

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

/* 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 ### */
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_lazyInitDriver(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self); /* proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_lazyInitContextState(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self); /* proto*/
static struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_f_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_getDevice(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self, int __pyx_v_deviceOrdinal); /* proto*/
static struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_f_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_getDeviceFromDriver(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self, CUdevice __pyx_v_driverDevice); /* proto*/
static struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_f_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_getDeviceFromPrimaryCtx(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self, CUcontext __pyx_v_context); /* proto*/

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

/* Module declarations from "cuda.ccudart" */
static cudaError_t (*__pyx_f_4cuda_7ccudart_cudaMalloc)(void **, size_t); /*proto*/
static cudaError_t (*__pyx_f_4cuda_7ccudart_cudaFree)(void *); /*proto*/
static cudaError_t (*__pyx_f_4cuda_7ccudart_cudaMemcpyToArray)(cudaArray_t, size_t, size_t, void const *, size_t, enum cudaMemcpyKind); /*proto*/
static cudaError_t (*__pyx_f_4cuda_7ccudart_cudaMemcpyFromArray)(void *, cudaArray_const_t, size_t, size_t, size_t, enum cudaMemcpyKind); /*proto*/
static struct cudaPitchedPtr (*__pyx_f_4cuda_7ccudart_make_cudaPitchedPtr)(void *, size_t, size_t, size_t); /*proto*/

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

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

/* Module declarations from "libcpp" */

/* Module declarations from "libcpp.utility" */

/* Module declarations from "libcpp.map" */

/* Module declarations from "cuda.ccuda" */
static CUresult (*__pyx_f_4cuda_5ccuda_cuDevicePrimaryCtxRelease)(CUdevice); /*proto*/

/* Module declarations from "cuda._cuda.ccuda" */
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuInit)(unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGet)(CUdevice *, int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetCount)(int *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetName)(char *, int, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetUuid)(CUuuid *, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceTotalMem_v2)(size_t *, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute)(int *, CUdevice_attribute, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxRetain)(CUcontext *, CUdevice); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxReset_v2)(CUdevice); /*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__cuCtxGetApiVersion)(CUcontext, unsigned int *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemAllocPitch_v2)(CUdeviceptr *, size_t *, size_t, size_t, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemHostAlloc)(void **, size_t, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceRegisterAsyncNotification)(CUdevice, CUasyncCallback, void *, CUasyncCallbackHandle *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceUnregisterAsyncNotification)(CUdevice, CUasyncCallbackHandle); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy)(CUdeviceptr, CUdeviceptr, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyHtoD_v2)(CUdeviceptr, void const *, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyDtoH_v2)(void *, CUdeviceptr, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyDtoD_v2)(CUdeviceptr, CUdeviceptr, size_t); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy2DUnaligned_v2)(CUDA_MEMCPY2D const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy3D_v2)(CUDA_MEMCPY3D const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy3DPeer)(CUDA_MEMCPY3D_PEER const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyAsync)(CUdeviceptr, CUdeviceptr, size_t, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyHtoDAsync_v2)(CUdeviceptr, void const *, size_t, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyDtoHAsync_v2)(void *, CUdeviceptr, size_t, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyDtoDAsync_v2)(CUdeviceptr, CUdeviceptr, size_t, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy2DAsync_v2)(CUDA_MEMCPY2D const *, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy3DAsync_v2)(CUDA_MEMCPY3D const *, CUstream); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy3DPeerAsync)(CUDA_MEMCPY3D_PEER const *, 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__cuArray3DCreate_v2)(CUarray *, CUDA_ARRAY3D_DESCRIPTOR const *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuArray3DGetDescriptor_v2)(CUDA_ARRAY3D_DESCRIPTOR *, CUarray); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayCreate)(CUmipmappedArray *, CUDA_ARRAY3D_DESCRIPTOR const *, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetLevel)(CUarray *, CUmipmappedArray, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamAddCallback)(CUstream, CUstreamCallback, void *, unsigned int); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetCaptureInfo_v2)(CUstream, CUstreamCaptureStatus *, cuuint64_t *, CUgraph *, CUgraphNode const **, size_t *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetCaptureInfo_v3)(CUstream, CUstreamCaptureStatus *, cuuint64_t *, CUgraph *, CUgraphNode const **, CUgraphEdgeData const **, size_t *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuLaunchHostFunc)(CUstream, CUhostFn, void *); /*proto*/

/* Module declarations from "cython" */

/* Module declarations from "cuda._lib.ccudart.utils" */
static struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_4cuda_4_lib_7ccudart_5utils_m_global = 0;
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils__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_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_copyFromHost2D(cudaArray_const_t, size_t, size_t, char const *, size_t, size_t, size_t, CUstream, bool); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromDevice2D(CUmemorytype, cudaArray_const_t, size_t, size_t, char const *, size_t, size_t, size_t, size_t, CUstream, bool); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToHost2D(cudaArray_const_t, size_t, size_t, char *, size_t, size_t, size_t, CUstream, bool); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToDevice2D(CUmemorytype, cudaArray_const_t, size_t, size_t, char const *, size_t, size_t, size_t, size_t, CUstream, bool); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToArray2D(cudaArray_const_t, size_t, size_t, cudaArray_t, size_t, size_t, size_t, size_t); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_memsetPtr(char *, int, size_t, cudaStream_t, bool); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_memset2DPtr(char *, size_t, int, size_t, size_t, cudaStream_t, bool); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromHost(cudaArray_const_t, size_t, size_t, char const *, size_t, CUstream, bool); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromDevice(CUmemorytype, cudaArray_const_t, size_t, size_t, char const *, size_t, size_t, CUstream, bool); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToHost(cudaArray_const_t, size_t, size_t, char *, size_t, CUstream, bool); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToDevice(CUmemorytype, cudaArray_const_t, size_t, size_t, char const *, size_t, size_t, CUstream, bool); /*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_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_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*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_initDevice(struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *, int); /*proto*/
static int __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(struct cudaChannelFormatDesc const *, int, int, int, int, int); /*proto*/
static void __pyx_f_4cuda_4_lib_7ccudart_5utils_cudaStreamRtCallbackWrapper(CUstream, CUresult, void *); /*proto*/
static void __pyx_f_4cuda_4_lib_7ccudart_5utils_cudaStreamRtHostCallbackWrapper(void *); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_toRuntimeStreamCaptureStatus(CUstreamCaptureStatus, enum cudaStreamCaptureStatus *); /*proto*/
static CUDA_MEMCPY3D_v2 __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy3DInit(enum CUmemorytype_enum, enum CUmemorytype_enum); /*proto*/
static CUDA_MEMCPY2D_v2 __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy2DInit(enum CUmemorytype_enum, enum CUmemorytype_enum); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_bytesPerElement(size_t *, int, CUarray_format); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_getArrayBlockExtent(struct cudaExtent *, CUarray_format); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_getLocalState(struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaArrayLocalState *, cudaArray_const_t); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToArray(cudaArray_const_t, size_t, size_t, cudaArray_t, size_t, size_t, size_t); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_getFormat(cudaArray_const_t, int &, CUarray_format *); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3DPeer(CUDA_MEMCPY3D_PEER *, CUstream, bool); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D(CUDA_MEMCPY3D_v2 *, CUstream, bool); /*proto*/
static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_getElementSize(size_t *, cudaArray_t); /*proto*/
static void __pyx_f_4cuda_4_lib_7ccudart_5utils_cudaAsyncNotificationCallbackWrapper(cudaAsyncNotificationInfo_t *, void *, cudaAsyncCallbackHandle_t); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "cuda._lib.ccudart.utils"
extern int __pyx_module_is_main_cuda___lib__ccudart__utils;
int __pyx_module_is_main_cuda___lib__ccudart__utils = 0;

/* Implementation of "cuda._lib.ccudart.utils" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_TypeError;
/* #### Code section: string_decls ### */
static const char __pyx_k__5[] = "?";
static const char __pyx_k_gc[] = "gc";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_enable[] = "enable";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_disable[] = "disable";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_isenabled[] = "isenabled";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_is_coroutine[] = "_is_coroutine";
static const char __pyx_k_stringsource[] = "<stringsource>";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_cudaPythonGlobal[] = "cudaPythonGlobal";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_cuda__lib_ccudart_utils[] = "cuda._lib.ccudart.utils";
static const char __pyx_k_cudaPythonGlobal___reduce_cython[] = "cudaPythonGlobal.__reduce_cython__";
static const char __pyx_k_cudaPythonGlobal___setstate_cyth[] = "cudaPythonGlobal.__setstate_cython__";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
/* #### Code section: decls ### */
static int __pyx_pf_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal___cinit__(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self); /* proto */
static void __pyx_pf_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_2__dealloc__(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
/* #### 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
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  PyObject *__pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal;
  #endif
  PyTypeObject *__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal;
  PyObject *__pyx_n_s_TypeError;
  PyObject *__pyx_n_s__5;
  PyObject *__pyx_n_s_asyncio_coroutines;
  PyObject *__pyx_n_s_cline_in_traceback;
  PyObject *__pyx_n_s_cudaPythonGlobal;
  PyObject *__pyx_n_s_cudaPythonGlobal___reduce_cython;
  PyObject *__pyx_n_s_cudaPythonGlobal___setstate_cyth;
  PyObject *__pyx_n_s_cuda__lib_ccudart_utils;
  PyObject *__pyx_kp_u_disable;
  PyObject *__pyx_kp_u_enable;
  PyObject *__pyx_kp_u_gc;
  PyObject *__pyx_n_s_getstate;
  PyObject *__pyx_n_s_is_coroutine;
  PyObject *__pyx_kp_u_isenabled;
  PyObject *__pyx_n_s_main;
  PyObject *__pyx_n_s_name;
  PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
  PyObject *__pyx_n_s_pyx_state;
  PyObject *__pyx_n_s_pyx_vtable;
  PyObject *__pyx_n_s_range;
  PyObject *__pyx_n_s_reduce;
  PyObject *__pyx_n_s_reduce_cython;
  PyObject *__pyx_n_s_reduce_ex;
  PyObject *__pyx_n_s_self;
  PyObject *__pyx_n_s_setstate;
  PyObject *__pyx_n_s_setstate_cython;
  PyObject *__pyx_kp_s_stringsource;
  PyObject *__pyx_n_s_test;
  PyObject *__pyx_codeobj_;
  PyObject *__pyx_tuple__3;
  PyObject *__pyx_tuple__4;
  PyObject *__pyx_codeobj__2;
} __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_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal);
  Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
  Py_CLEAR(clear_module_state->__pyx_n_s__5);
  Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
  Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
  Py_CLEAR(clear_module_state->__pyx_n_s_cudaPythonGlobal);
  Py_CLEAR(clear_module_state->__pyx_n_s_cudaPythonGlobal___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_cudaPythonGlobal___setstate_cyth);
  Py_CLEAR(clear_module_state->__pyx_n_s_cuda__lib_ccudart_utils);
  Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
  Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
  Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
  Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
  Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
  Py_CLEAR(clear_module_state->__pyx_n_s_main);
  Py_CLEAR(clear_module_state->__pyx_n_s_name);
  Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
  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_reduce);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
  Py_CLEAR(clear_module_state->__pyx_n_s_self);
  Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
  Py_CLEAR(clear_module_state->__pyx_n_s_test);
  Py_CLEAR(clear_module_state->__pyx_codeobj_);
  Py_CLEAR(clear_module_state->__pyx_tuple__3);
  Py_CLEAR(clear_module_state->__pyx_tuple__4);
  Py_CLEAR(clear_module_state->__pyx_codeobj__2);
  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_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal);
  Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
  Py_VISIT(traverse_module_state->__pyx_n_s__5);
  Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
  Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
  Py_VISIT(traverse_module_state->__pyx_n_s_cudaPythonGlobal);
  Py_VISIT(traverse_module_state->__pyx_n_s_cudaPythonGlobal___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_cudaPythonGlobal___setstate_cyth);
  Py_VISIT(traverse_module_state->__pyx_n_s_cuda__lib_ccudart_utils);
  Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
  Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
  Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
  Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
  Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
  Py_VISIT(traverse_module_state->__pyx_n_s_main);
  Py_VISIT(traverse_module_state->__pyx_n_s_name);
  Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
  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_reduce);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
  Py_VISIT(traverse_module_state->__pyx_n_s_self);
  Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
  Py_VISIT(traverse_module_state->__pyx_n_s_test);
  Py_VISIT(traverse_module_state->__pyx_codeobj_);
  Py_VISIT(traverse_module_state->__pyx_tuple__3);
  Py_VISIT(traverse_module_state->__pyx_tuple__4);
  Py_VISIT(traverse_module_state->__pyx_codeobj__2);
  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
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#define __pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal __pyx_mstate_global->__pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal
#endif
#define __pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal __pyx_mstate_global->__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal
#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
#define __pyx_n_s__5 __pyx_mstate_global->__pyx_n_s__5
#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
#define __pyx_n_s_cudaPythonGlobal __pyx_mstate_global->__pyx_n_s_cudaPythonGlobal
#define __pyx_n_s_cudaPythonGlobal___reduce_cython __pyx_mstate_global->__pyx_n_s_cudaPythonGlobal___reduce_cython
#define __pyx_n_s_cudaPythonGlobal___setstate_cyth __pyx_mstate_global->__pyx_n_s_cudaPythonGlobal___setstate_cyth
#define __pyx_n_s_cuda__lib_ccudart_utils __pyx_mstate_global->__pyx_n_s_cuda__lib_ccudart_utils
#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
#define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
#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_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non
#define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
#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_reduce __pyx_mstate_global->__pyx_n_s_reduce
#define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
#define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self
#define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
#define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
#define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
#define __pyx_codeobj_ __pyx_mstate_global->__pyx_codeobj_
#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3
#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
#define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2
/* #### Code section: module_code ### */

/* "cuda/_lib/ccudart/utils.pyx":37
 * 
 * cdef class cudaPythonGlobal:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._lazyInitDriver = False
 *         self._numDevices = 0
 */

/* Python wrapper */
static int __pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal___cinit__(((struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal___cinit__(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("__cinit__", __pyx_f[0], 37, 0, __PYX_ERR(0, 37, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":38
 * cdef class cudaPythonGlobal:
 *     def __cinit__(self):
 *         self._lazyInitDriver = False             # <<<<<<<<<<<<<<
 *         self._numDevices = 0
 *         self._deviceList = NULL
 */
  __pyx_v_self->_lazyInitDriver = 0;

  /* "cuda/_lib/ccudart/utils.pyx":39
 *     def __cinit__(self):
 *         self._lazyInitDriver = False
 *         self._numDevices = 0             # <<<<<<<<<<<<<<
 *         self._deviceList = NULL
 *         self._CUDART_VERSION = CUDART_VERSION
 */
  __pyx_v_self->_numDevices = 0;

  /* "cuda/_lib/ccudart/utils.pyx":40
 *         self._lazyInitDriver = False
 *         self._numDevices = 0
 *         self._deviceList = NULL             # <<<<<<<<<<<<<<
 *         self._CUDART_VERSION = CUDART_VERSION
 * 
 */
  __pyx_v_self->_deviceList = NULL;

  /* "cuda/_lib/ccudart/utils.pyx":41
 *         self._numDevices = 0
 *         self._deviceList = NULL
 *         self._CUDART_VERSION = CUDART_VERSION             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->_CUDART_VERSION = __pyx_e_4cuda_7ccudart_CUDART_VERSION;

  /* "cuda/_lib/ccudart/utils.pyx":37
 * 
 * cdef class cudaPythonGlobal:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._lazyInitDriver = False
 *         self._numDevices = 0
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cuda._lib.ccudart.utils.cudaPythonGlobal.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":43
 *         self._CUDART_VERSION = CUDART_VERSION
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._deviceList is not NULL:
 *             free(self._deviceList)
 */

/* Python wrapper */
static void __pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_3__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_2__dealloc__(((struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_2__dealloc__(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self) {
  std::pair<cudaAsyncCallbackHandle_t,__pyx_t_4cuda_4_lib_7ccudart_5utils_cudaAsyncCallbackData *>  __pyx_v_item;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  std::map<cudaAsyncCallbackHandle_t,__pyx_t_4cuda_4_lib_7ccudart_5utils_cudaAsyncCallbackData *> ::iterator __pyx_t_2;
  std::pair<cudaAsyncCallbackHandle_t,__pyx_t_4cuda_4_lib_7ccudart_5utils_cudaAsyncCallbackData *>  __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("__dealloc__", __pyx_f[0], 43, 0, __PYX_ERR(0, 43, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":44
 * 
 *     def __dealloc__(self):
 *         if self._deviceList is not NULL:             # <<<<<<<<<<<<<<
 *             free(self._deviceList)
 *         for item in self._asyncCallbackDataMap:
 */
  __pyx_t_1 = (__pyx_v_self->_deviceList != NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":45
 *     def __dealloc__(self):
 *         if self._deviceList is not NULL:
 *             free(self._deviceList)             # <<<<<<<<<<<<<<
 *         for item in self._asyncCallbackDataMap:
 *             free(item.second)
 */
    free(__pyx_v_self->_deviceList);

    /* "cuda/_lib/ccudart/utils.pyx":44
 * 
 *     def __dealloc__(self):
 *         if self._deviceList is not NULL:             # <<<<<<<<<<<<<<
 *             free(self._deviceList)
 *         for item in self._asyncCallbackDataMap:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":46
 *         if self._deviceList is not NULL:
 *             free(self._deviceList)
 *         for item in self._asyncCallbackDataMap:             # <<<<<<<<<<<<<<
 *             free(item.second)
 *         self._asyncCallbackDataMap.clear()
 */
  __pyx_t_2 = __pyx_v_self->_asyncCallbackDataMap.begin();
  for (;;) {
    if (!(__pyx_t_2 != __pyx_v_self->_asyncCallbackDataMap.end())) break;
    __pyx_t_3 = *__pyx_t_2;
    ++__pyx_t_2;
    __pyx_v_item = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":47
 *             free(self._deviceList)
 *         for item in self._asyncCallbackDataMap:
 *             free(item.second)             # <<<<<<<<<<<<<<
 *         self._asyncCallbackDataMap.clear()
 * 
 */
    free(__pyx_v_item.second);

    /* "cuda/_lib/ccudart/utils.pyx":46
 *         if self._deviceList is not NULL:
 *             free(self._deviceList)
 *         for item in self._asyncCallbackDataMap:             # <<<<<<<<<<<<<<
 *             free(item.second)
 *         self._asyncCallbackDataMap.clear()
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":48
 *         for item in self._asyncCallbackDataMap:
 *             free(item.second)
 *         self._asyncCallbackDataMap.clear()             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t lazyInitDriver(self) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_v_self->_asyncCallbackDataMap.clear();

  /* "cuda/_lib/ccudart/utils.pyx":43
 *         self._CUDART_VERSION = CUDART_VERSION
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._deviceList is not NULL:
 *             free(self._deviceList)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cuda._lib.ccudart.utils.cudaPythonGlobal.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
}

/* "cuda/_lib/ccudart/utils.pyx":50
 *         self._asyncCallbackDataMap.clear()
 * 
 *     cdef cudaError_t lazyInitDriver(self) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *         if self._lazyInitDriver:
 *             return cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_lazyInitDriver(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self) {
  cudaError_t __pyx_v_err;
  int __pyx_v_deviceOrdinal;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  cudaError_t __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("lazyInitDriver", __pyx_f[0], 50, 1, __PYX_ERR(0, 50, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":51
 * 
 *     cdef cudaError_t lazyInitDriver(self) except ?cudaErrorCallRequiresNewerDriver nogil:
 *         if self._lazyInitDriver:             # <<<<<<<<<<<<<<
 *             return cudaSuccess
 * 
 */
  if (__pyx_v_self->_lazyInitDriver) {

    /* "cuda/_lib/ccudart/utils.pyx":52
 *     cdef cudaError_t lazyInitDriver(self) except ?cudaErrorCallRequiresNewerDriver nogil:
 *         if self._lazyInitDriver:
 *             return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *         cdef cudaError_t err = cudaSuccess
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":51
 * 
 *     cdef cudaError_t lazyInitDriver(self) except ?cudaErrorCallRequiresNewerDriver nogil:
 *         if self._lazyInitDriver:             # <<<<<<<<<<<<<<
 *             return cudaSuccess
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":54
 *             return cudaSuccess
 * 
 *         cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuInit(0)
 *         if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":55
 * 
 *         cdef cudaError_t err = cudaSuccess
 *         err = <cudaError_t>ccuda._cuInit(0)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuInit(0); 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/utils.pyx":56
 *         cdef cudaError_t err = cudaSuccess
 *         err = <cudaError_t>ccuda._cuInit(0)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = <cudaError_t>ccuda._cuDeviceGetCount(&self._numDevices)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":57
 *         err = <cudaError_t>ccuda._cuInit(0)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuDeviceGetCount(&self._numDevices)
 *         if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":56
 *         cdef cudaError_t err = cudaSuccess
 *         err = <cudaError_t>ccuda._cuInit(0)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = <cudaError_t>ccuda._cuDeviceGetCount(&self._numDevices)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":58
 *         if err != cudaSuccess:
 *             return err
 *         err = <cudaError_t>ccuda._cuDeviceGetCount(&self._numDevices)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetCount((&__pyx_v_self->_numDevices)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 58, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/utils.pyx":59
 *             return err
 *         err = <cudaError_t>ccuda._cuDeviceGetCount(&self._numDevices)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":60
 *         err = <cudaError_t>ccuda._cuDeviceGetCount(&self._numDevices)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *         self._deviceList = <cudaPythonDevice *>calloc(self._numDevices, sizeof(cudaPythonDevice))
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":59
 *             return err
 *         err = <cudaError_t>ccuda._cuDeviceGetCount(&self._numDevices)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":62
 *             return err
 * 
 *         self._deviceList = <cudaPythonDevice *>calloc(self._numDevices, sizeof(cudaPythonDevice))             # <<<<<<<<<<<<<<
 *         if self._deviceList == NULL:
 *             return cudaErrorMemoryAllocation
 */
  __pyx_v_self->_deviceList = ((struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *)calloc(__pyx_v_self->_numDevices, (sizeof(struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice))));

  /* "cuda/_lib/ccudart/utils.pyx":63
 * 
 *         self._deviceList = <cudaPythonDevice *>calloc(self._numDevices, sizeof(cudaPythonDevice))
 *         if self._deviceList == NULL:             # <<<<<<<<<<<<<<
 *             return cudaErrorMemoryAllocation
 * 
 */
  __pyx_t_2 = (__pyx_v_self->_deviceList == NULL);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":64
 *         self._deviceList = <cudaPythonDevice *>calloc(self._numDevices, sizeof(cudaPythonDevice))
 *         if self._deviceList == NULL:
 *             return cudaErrorMemoryAllocation             # <<<<<<<<<<<<<<
 * 
 *         for deviceOrdinal in range(self._numDevices):
 */
    __pyx_r = cudaErrorMemoryAllocation;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":63
 * 
 *         self._deviceList = <cudaPythonDevice *>calloc(self._numDevices, sizeof(cudaPythonDevice))
 *         if self._deviceList == NULL:             # <<<<<<<<<<<<<<
 *             return cudaErrorMemoryAllocation
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":66
 *             return cudaErrorMemoryAllocation
 * 
 *         for deviceOrdinal in range(self._numDevices):             # <<<<<<<<<<<<<<
 *             err = initDevice(&self._deviceList[deviceOrdinal], deviceOrdinal)
 *             if err != cudaSuccess:
 */
  __pyx_t_3 = __pyx_v_self->_numDevices;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_deviceOrdinal = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":67
 * 
 *         for deviceOrdinal in range(self._numDevices):
 *             err = initDevice(&self._deviceList[deviceOrdinal], deviceOrdinal)             # <<<<<<<<<<<<<<
 *             if err != cudaSuccess:
 *                 free(self._deviceList)
 */
    __pyx_t_6 = __pyx_f_4cuda_4_lib_7ccudart_5utils_initDevice((&(__pyx_v_self->_deviceList[__pyx_v_deviceOrdinal])), __pyx_v_deviceOrdinal); if (unlikely(__pyx_t_6 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 67, __pyx_L1_error)
    __pyx_v_err = __pyx_t_6;

    /* "cuda/_lib/ccudart/utils.pyx":68
 *         for deviceOrdinal in range(self._numDevices):
 *             err = initDevice(&self._deviceList[deviceOrdinal], deviceOrdinal)
 *             if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *                 free(self._deviceList)
 *                 return err
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":69
 *             err = initDevice(&self._deviceList[deviceOrdinal], deviceOrdinal)
 *             if err != cudaSuccess:
 *                 free(self._deviceList)             # <<<<<<<<<<<<<<
 *                 return err
 * 
 */
      free(__pyx_v_self->_deviceList);

      /* "cuda/_lib/ccudart/utils.pyx":70
 *             if err != cudaSuccess:
 *                 free(self._deviceList)
 *                 return err             # <<<<<<<<<<<<<<
 * 
 *         self._lazyInitDriver = True
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":68
 *         for deviceOrdinal in range(self._numDevices):
 *             err = initDevice(&self._deviceList[deviceOrdinal], deviceOrdinal)
 *             if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *                 free(self._deviceList)
 *                 return err
 */
    }
  }

  /* "cuda/_lib/ccudart/utils.pyx":72
 *                 return err
 * 
 *         self._lazyInitDriver = True             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t lazyInitContextState(self) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_v_self->_lazyInitDriver = 1;

  /* "cuda/_lib/ccudart/utils.pyx":50
 *         self._asyncCallbackDataMap.clear()
 * 
 *     cdef cudaError_t lazyInitDriver(self) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *         if self._lazyInitDriver:
 *             return cudaSuccess
 */

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

/* "cuda/_lib/ccudart/utils.pyx":74
 *         self._lazyInitDriver = True
 * 
 *     cdef cudaError_t lazyInitContextState(self) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *         cdef cudaError_t err = cudaSuccess
 *         cdef ccuda.CUcontext driverContext
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_lazyInitContextState(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self) {
  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_version;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("lazyInitContextState", __pyx_f[0], 74, 1, __PYX_ERR(0, 74, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":75
 * 
 *     cdef cudaError_t lazyInitContextState(self) except ?cudaErrorCallRequiresNewerDriver nogil:
 *         cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *         cdef ccuda.CUcontext driverContext
 *         cdef cudaPythonDevice *device
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":79
 *         cdef cudaPythonDevice *device
 * 
 *         err = self.lazyInitDriver()             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_self->__pyx_vtab)->lazyInitDriver(__pyx_v_self); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 79, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":80
 * 
 *         err = self.lazyInitDriver()
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":81
 *         err = self.lazyInitDriver()
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&driverContext)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":80
 * 
 *         err = self.lazyInitDriver()
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":83
 *             return err
 * 
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&driverContext)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return 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, 83, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/utils.pyx":84
 * 
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&driverContext)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         device = self.getDeviceFromPrimaryCtx(driverContext)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":85
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&driverContext)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         device = self.getDeviceFromPrimaryCtx(driverContext)
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":84
 * 
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&driverContext)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         device = self.getDeviceFromPrimaryCtx(driverContext)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":86
 *         if err != cudaSuccess:
 *             return err
 *         device = self.getDeviceFromPrimaryCtx(driverContext)             # <<<<<<<<<<<<<<
 * 
 *         # 1. Context + device
 */
  __pyx_v_device = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_self->__pyx_vtab)->getDeviceFromPrimaryCtx(__pyx_v_self, __pyx_v_driverContext);

  /* "cuda/_lib/ccudart/utils.pyx":89
 * 
 *         # 1. Context + device
 *         if driverContext != NULL and device != NULL:             # <<<<<<<<<<<<<<
 *             err = initPrimaryContext(device)
 *             if err != cudaSuccess:
 */
  __pyx_t_4 = (__pyx_v_driverContext != NULL);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_4 = (__pyx_v_device != NULL);
  __pyx_t_2 = __pyx_t_4;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":90
 *         # 1. Context + device
 *         if driverContext != NULL and device != NULL:
 *             err = initPrimaryContext(device)             # <<<<<<<<<<<<<<
 *             if err != cudaSuccess:
 *                 return 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, 90, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":91
 *         if driverContext != NULL and device != NULL:
 *             err = initPrimaryContext(device)
 *             if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *                 return err
 * 
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":92
 *             err = initPrimaryContext(device)
 *             if err != cudaSuccess:
 *                 return err             # <<<<<<<<<<<<<<
 * 
 *         # 2. Context + no device
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":91
 *         if driverContext != NULL and device != NULL:
 *             err = initPrimaryContext(device)
 *             if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *                 return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":89
 * 
 *         # 1. Context + device
 *         if driverContext != NULL and device != NULL:             # <<<<<<<<<<<<<<
 *             err = initPrimaryContext(device)
 *             if err != cudaSuccess:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":96
 *         # 2. Context + no device
 *         cdef unsigned int version
 *         if driverContext != NULL:             # <<<<<<<<<<<<<<
 *             # If the context exists, but is non-primary, make sure it can be used with the CUDA 3.2 API,
 *             # then return immediately
 */
  __pyx_t_2 = (__pyx_v_driverContext != NULL);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":99
 *             # If the context exists, but is non-primary, make sure it can be used with the CUDA 3.2 API,
 *             # then return immediately
 *             err = <cudaError_t>ccuda._cuCtxGetApiVersion(driverContext, &version)             # <<<<<<<<<<<<<<
 *             if err == cudaErrorContextIsDestroyed:
 *                 return cudaErrorIncompatibleDriverContext
 */
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetApiVersion(__pyx_v_driverContext, (&__pyx_v_version)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 99, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":100
 *             # then return immediately
 *             err = <cudaError_t>ccuda._cuCtxGetApiVersion(driverContext, &version)
 *             if err == cudaErrorContextIsDestroyed:             # <<<<<<<<<<<<<<
 *                 return cudaErrorIncompatibleDriverContext
 *             elif err != cudaSuccess:
 */
    __pyx_t_2 = (__pyx_v_err == cudaErrorContextIsDestroyed);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":101
 *             err = <cudaError_t>ccuda._cuCtxGetApiVersion(driverContext, &version)
 *             if err == cudaErrorContextIsDestroyed:
 *                 return cudaErrorIncompatibleDriverContext             # <<<<<<<<<<<<<<
 *             elif err != cudaSuccess:
 *                 return err
 */
      __pyx_r = cudaErrorIncompatibleDriverContext;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":100
 *             # then return immediately
 *             err = <cudaError_t>ccuda._cuCtxGetApiVersion(driverContext, &version)
 *             if err == cudaErrorContextIsDestroyed:             # <<<<<<<<<<<<<<
 *                 return cudaErrorIncompatibleDriverContext
 *             elif err != cudaSuccess:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":102
 *             if err == cudaErrorContextIsDestroyed:
 *                 return cudaErrorIncompatibleDriverContext
 *             elif err != cudaSuccess:             # <<<<<<<<<<<<<<
 *                 return err
 *             elif version < 3020:
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":103
 *                 return cudaErrorIncompatibleDriverContext
 *             elif err != cudaSuccess:
 *                 return err             # <<<<<<<<<<<<<<
 *             elif version < 3020:
 *                 return cudaErrorIncompatibleDriverContext
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":102
 *             if err == cudaErrorContextIsDestroyed:
 *                 return cudaErrorIncompatibleDriverContext
 *             elif err != cudaSuccess:             # <<<<<<<<<<<<<<
 *                 return err
 *             elif version < 3020:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":104
 *             elif err != cudaSuccess:
 *                 return err
 *             elif version < 3020:             # <<<<<<<<<<<<<<
 *                 return cudaErrorIncompatibleDriverContext
 *             return cudaSuccess
 */
    __pyx_t_2 = (__pyx_v_version < 0xBCC);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":105
 *                 return err
 *             elif version < 3020:
 *                 return cudaErrorIncompatibleDriverContext             # <<<<<<<<<<<<<<
 *             return cudaSuccess
 * 
 */
      __pyx_r = cudaErrorIncompatibleDriverContext;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":104
 *             elif err != cudaSuccess:
 *                 return err
 *             elif version < 3020:             # <<<<<<<<<<<<<<
 *                 return cudaErrorIncompatibleDriverContext
 *             return cudaSuccess
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":106
 *             elif version < 3020:
 *                 return cudaErrorIncompatibleDriverContext
 *             return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *         # 3. No context + device
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":96
 *         # 2. Context + no device
 *         cdef unsigned int version
 *         if driverContext != NULL:             # <<<<<<<<<<<<<<
 *             # If the context exists, but is non-primary, make sure it can be used with the CUDA 3.2 API,
 *             # then return immediately
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":113
 *         # 4. No context + no device
 *         # Default to first device
 *         device = self.getDevice(0)             # <<<<<<<<<<<<<<
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:
 */
  __pyx_v_device = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_self->__pyx_vtab)->getDevice(__pyx_v_self, 0);

  /* "cuda/_lib/ccudart/utils.pyx":114
 *         # Default to first device
 *         device = self.getDevice(0)
 *         err = initPrimaryContext(device)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return 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, 114, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":115
 *         device = self.getDevice(0)
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = <cudaError_t> ccuda._cuCtxSetCurrent(device.primaryContext)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":116
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         err = <cudaError_t> ccuda._cuCtxSetCurrent(device.primaryContext)
 *         return err
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":115
 *         device = self.getDevice(0)
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = <cudaError_t> ccuda._cuCtxSetCurrent(device.primaryContext)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":117
 *         if err != cudaSuccess:
 *             return err
 *         err = <cudaError_t> ccuda._cuCtxSetCurrent(device.primaryContext)             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetCurrent(__pyx_v_device->primaryContext); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 117, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

  /* "cuda/_lib/ccudart/utils.pyx":118
 *             return err
 *         err = <cudaError_t> ccuda._cuCtxSetCurrent(device.primaryContext)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaPythonDevice* getDevice(self, int deviceOrdinal) noexcept nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":74
 *         self._lazyInitDriver = True
 * 
 *     cdef cudaError_t lazyInitContextState(self) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *         cdef cudaError_t err = cudaSuccess
 *         cdef ccuda.CUcontext driverContext
 */

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

/* "cuda/_lib/ccudart/utils.pyx":120
 *         return err
 * 
 *     cdef cudaPythonDevice* getDevice(self, int deviceOrdinal) noexcept nogil:             # <<<<<<<<<<<<<<
 *         if deviceOrdinal < 0 or deviceOrdinal >= m_global._numDevices:
 *             return NULL
 */

static struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_f_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_getDevice(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self, int __pyx_v_deviceOrdinal) {
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_r;
  __Pyx_TraceDeclarations
  int __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("getDevice", __pyx_f[0], 120, 1, __PYX_ERR(0, 120, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":121
 * 
 *     cdef cudaPythonDevice* getDevice(self, int deviceOrdinal) noexcept nogil:
 *         if deviceOrdinal < 0 or deviceOrdinal >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *             return NULL
 *         return &self._deviceList[deviceOrdinal]
 */
  __pyx_t_2 = (__pyx_v_deviceOrdinal < 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_deviceOrdinal >= __pyx_v_4cuda_4_lib_7ccudart_5utils_m_global->_numDevices);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":122
 *     cdef cudaPythonDevice* getDevice(self, int deviceOrdinal) noexcept nogil:
 *         if deviceOrdinal < 0 or deviceOrdinal >= m_global._numDevices:
 *             return NULL             # <<<<<<<<<<<<<<
 *         return &self._deviceList[deviceOrdinal]
 * 
 */
    __pyx_r = NULL;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":121
 * 
 *     cdef cudaPythonDevice* getDevice(self, int deviceOrdinal) noexcept nogil:
 *         if deviceOrdinal < 0 or deviceOrdinal >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *             return NULL
 *         return &self._deviceList[deviceOrdinal]
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":123
 *         if deviceOrdinal < 0 or deviceOrdinal >= m_global._numDevices:
 *             return NULL
 *         return &self._deviceList[deviceOrdinal]             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaPythonDevice* getDeviceFromDriver(self, ccuda.CUdevice driverDevice) noexcept nogil:
 */
  __pyx_r = (&(__pyx_v_self->_deviceList[__pyx_v_deviceOrdinal]));
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":120
 *         return err
 * 
 *     cdef cudaPythonDevice* getDevice(self, int deviceOrdinal) noexcept nogil:             # <<<<<<<<<<<<<<
 *         if deviceOrdinal < 0 or deviceOrdinal >= m_global._numDevices:
 *             return NULL
 */

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

/* "cuda/_lib/ccudart/utils.pyx":125
 *         return &self._deviceList[deviceOrdinal]
 * 
 *     cdef cudaPythonDevice* getDeviceFromDriver(self, ccuda.CUdevice driverDevice) noexcept nogil:             # <<<<<<<<<<<<<<
 *         for i in range(self._numDevices):
 *             if self._deviceList[i].driverDevice == driverDevice:
 */

static struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_f_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_getDeviceFromDriver(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self, CUdevice __pyx_v_driverDevice) {
  int __pyx_v_i;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __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("getDeviceFromDriver", __pyx_f[0], 125, 1, __PYX_ERR(0, 125, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":126
 * 
 *     cdef cudaPythonDevice* getDeviceFromDriver(self, ccuda.CUdevice driverDevice) noexcept nogil:
 *         for i in range(self._numDevices):             # <<<<<<<<<<<<<<
 *             if self._deviceList[i].driverDevice == driverDevice:
 *                 return &self._deviceList[i]
 */
  __pyx_t_1 = __pyx_v_self->_numDevices;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":127
 *     cdef cudaPythonDevice* getDeviceFromDriver(self, ccuda.CUdevice driverDevice) noexcept nogil:
 *         for i in range(self._numDevices):
 *             if self._deviceList[i].driverDevice == driverDevice:             # <<<<<<<<<<<<<<
 *                 return &self._deviceList[i]
 *         return NULL
 */
    __pyx_t_4 = ((__pyx_v_self->_deviceList[__pyx_v_i]).driverDevice == __pyx_v_driverDevice);
    if (__pyx_t_4) {

      /* "cuda/_lib/ccudart/utils.pyx":128
 *         for i in range(self._numDevices):
 *             if self._deviceList[i].driverDevice == driverDevice:
 *                 return &self._deviceList[i]             # <<<<<<<<<<<<<<
 *         return NULL
 * 
 */
      __pyx_r = (&(__pyx_v_self->_deviceList[__pyx_v_i]));
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":127
 *     cdef cudaPythonDevice* getDeviceFromDriver(self, ccuda.CUdevice driverDevice) noexcept nogil:
 *         for i in range(self._numDevices):
 *             if self._deviceList[i].driverDevice == driverDevice:             # <<<<<<<<<<<<<<
 *                 return &self._deviceList[i]
 *         return NULL
 */
    }
  }

  /* "cuda/_lib/ccudart/utils.pyx":129
 *             if self._deviceList[i].driverDevice == driverDevice:
 *                 return &self._deviceList[i]
 *         return NULL             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaPythonDevice* getDeviceFromPrimaryCtx(self, ccuda.CUcontext context) noexcept nogil:
 */
  __pyx_r = NULL;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":125
 *         return &self._deviceList[deviceOrdinal]
 * 
 *     cdef cudaPythonDevice* getDeviceFromDriver(self, ccuda.CUdevice driverDevice) noexcept nogil:             # <<<<<<<<<<<<<<
 *         for i in range(self._numDevices):
 *             if self._deviceList[i].driverDevice == driverDevice:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":131
 *         return NULL
 * 
 *     cdef cudaPythonDevice* getDeviceFromPrimaryCtx(self, ccuda.CUcontext context) noexcept nogil:             # <<<<<<<<<<<<<<
 *         if context == NULL:
 *             return NULL
 */

static struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_f_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_getDeviceFromPrimaryCtx(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self, CUcontext __pyx_v_context) {
  int __pyx_v_i;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __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("getDeviceFromPrimaryCtx", __pyx_f[0], 131, 1, __PYX_ERR(0, 131, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":132
 * 
 *     cdef cudaPythonDevice* getDeviceFromPrimaryCtx(self, ccuda.CUcontext context) noexcept nogil:
 *         if context == NULL:             # <<<<<<<<<<<<<<
 *             return NULL
 *         for i in range(self._numDevices):
 */
  __pyx_t_1 = (__pyx_v_context == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":133
 *     cdef cudaPythonDevice* getDeviceFromPrimaryCtx(self, ccuda.CUcontext context) noexcept nogil:
 *         if context == NULL:
 *             return NULL             # <<<<<<<<<<<<<<
 *         for i in range(self._numDevices):
 *             if self._deviceList[i].primaryContext == context:
 */
    __pyx_r = NULL;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":132
 * 
 *     cdef cudaPythonDevice* getDeviceFromPrimaryCtx(self, ccuda.CUcontext context) noexcept nogil:
 *         if context == NULL:             # <<<<<<<<<<<<<<
 *             return NULL
 *         for i in range(self._numDevices):
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":134
 *         if context == NULL:
 *             return NULL
 *         for i in range(self._numDevices):             # <<<<<<<<<<<<<<
 *             if self._deviceList[i].primaryContext == context:
 *                 return &self._deviceList[i]
 */
  __pyx_t_2 = __pyx_v_self->_numDevices;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":135
 *             return NULL
 *         for i in range(self._numDevices):
 *             if self._deviceList[i].primaryContext == context:             # <<<<<<<<<<<<<<
 *                 return &self._deviceList[i]
 *         return NULL
 */
    __pyx_t_1 = ((__pyx_v_self->_deviceList[__pyx_v_i]).primaryContext == __pyx_v_context);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":136
 *         for i in range(self._numDevices):
 *             if self._deviceList[i].primaryContext == context:
 *                 return &self._deviceList[i]             # <<<<<<<<<<<<<<
 *         return NULL
 * 
 */
      __pyx_r = (&(__pyx_v_self->_deviceList[__pyx_v_i]));
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":135
 *             return NULL
 *         for i in range(self._numDevices):
 *             if self._deviceList[i].primaryContext == context:             # <<<<<<<<<<<<<<
 *                 return &self._deviceList[i]
 *         return NULL
 */
    }
  }

  /* "cuda/_lib/ccudart/utils.pyx":137
 *             if self._deviceList[i].primaryContext == context:
 *                 return &self._deviceList[i]
 *         return NULL             # <<<<<<<<<<<<<<
 * 
 * cdef cudaPythonGlobal m_global = cudaPythonGlobal()
 */
  __pyx_r = NULL;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":131
 *         return NULL
 * 
 *     cdef cudaPythonDevice* getDeviceFromPrimaryCtx(self, ccuda.CUcontext context) noexcept nogil:             # <<<<<<<<<<<<<<
 *         if context == NULL:
 *             return NULL
 */

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_4__reduce_cython__, "cudaPythonGlobal.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_4__reduce_cython__};
static PyObject *__pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_4__reduce_cython__(((struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj_)
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);
  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cuda._lib.ccudart.utils.cudaPythonGlobal.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_6__setstate_cython__, "cudaPythonGlobal.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_6__setstate_cython__};
static PyObject *__pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cuda._lib.ccudart.utils.cudaPythonGlobal.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_6__setstate_cython__(((struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__2)
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);
  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cuda._lib.ccudart.utils.cudaPythonGlobal.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":142
 * 
 * 
 * cdef cudaError_t initDevice(cudaPythonDevice *device, int deviceOrdinal) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     # ccuda.CUcontext primaryContext
 *     device[0].primaryContext = NULL
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_initDevice(struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device, int __pyx_v_deviceOrdinal) {
  CUresult __pyx_v_err;
  int __pyx_v_surfaceAlignment;
  int __pyx_v_texturePitchAlignment;
  int __pyx_v_sharedMemPerBlock;
  int __pyx_v_sharedMemPerBlockOptin;
  int __pyx_v_sharedMemPerMultiprocessor;
  int __pyx_v_memPitch;
  int __pyx_v_totalConstMem;
  int __pyx_v_textureAlignment;
  int __pyx_v_reservedSharedMemPerBlock;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __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("initDevice", __pyx_f[0], 142, 1, __PYX_ERR(0, 142, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":144
 * cdef cudaError_t initDevice(cudaPythonDevice *device, int deviceOrdinal) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     # ccuda.CUcontext primaryContext
 *     device[0].primaryContext = NULL             # <<<<<<<<<<<<<<
 *     # bool primaryContextRetained
 *     device[0].primaryContextRetained = False
 */
  (__pyx_v_device[0]).primaryContext = NULL;

  /* "cuda/_lib/ccudart/utils.pyx":146
 *     device[0].primaryContext = NULL
 *     # bool primaryContextRetained
 *     device[0].primaryContextRetained = False             # <<<<<<<<<<<<<<
 *     # int deviceOrdinal
 *     device[0].deviceOrdinal = deviceOrdinal
 */
  (__pyx_v_device[0]).primaryContextRetained = 0;

  /* "cuda/_lib/ccudart/utils.pyx":148
 *     device[0].primaryContextRetained = False
 *     # int deviceOrdinal
 *     device[0].deviceOrdinal = deviceOrdinal             # <<<<<<<<<<<<<<
 * 
 *     # ccuda.CUdevice driverDevice
 */
  (__pyx_v_device[0]).deviceOrdinal = __pyx_v_deviceOrdinal;

  /* "cuda/_lib/ccudart/utils.pyx":151
 * 
 *     # ccuda.CUdevice driverDevice
 *     err = ccuda._cuDeviceGet(&device[0].driverDevice, deviceOrdinal)             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGet((&(__pyx_v_device[0]).driverDevice), __pyx_v_deviceOrdinal); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 151, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":152
 *     # ccuda.CUdevice driverDevice
 *     err = ccuda._cuDeviceGet(&device[0].driverDevice, deviceOrdinal)
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":153
 *     err = ccuda._cuDeviceGet(&device[0].driverDevice, deviceOrdinal)
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     # cudaDeviceProp deviceProperties
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":152
 *     # ccuda.CUdevice driverDevice
 *     err = ccuda._cuDeviceGet(&device[0].driverDevice, deviceOrdinal)
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":156
 * 
 *     # cudaDeviceProp deviceProperties
 *     err = ccuda._cuDeviceGetName(device[0].deviceProperties.name, sizeof(device[0].deviceProperties.name), <ccuda.CUdevice>deviceOrdinal)             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetName((__pyx_v_device[0]).deviceProperties.name, (sizeof((__pyx_v_device[0]).deviceProperties.name)), ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 156, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":157
 *     # cudaDeviceProp deviceProperties
 *     err = ccuda._cuDeviceGetName(device[0].deviceProperties.name, sizeof(device[0].deviceProperties.name), <ccuda.CUdevice>deviceOrdinal)
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":158
 *     err = ccuda._cuDeviceGetName(device[0].deviceProperties.name, sizeof(device[0].deviceProperties.name), <ccuda.CUdevice>deviceOrdinal)
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceTotalMem_v2(&(device[0].deviceProperties.totalGlobalMem), <ccuda.CUdevice>deviceOrdinal)
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":157
 *     # cudaDeviceProp deviceProperties
 *     err = ccuda._cuDeviceGetName(device[0].deviceProperties.name, sizeof(device[0].deviceProperties.name), <ccuda.CUdevice>deviceOrdinal)
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":160
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceTotalMem_v2(&(device[0].deviceProperties.totalGlobalMem), <ccuda.CUdevice>deviceOrdinal)             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceTotalMem_v2((&(__pyx_v_device[0]).deviceProperties.totalGlobalMem), ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 160, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":161
 * 
 *     err = ccuda._cuDeviceTotalMem_v2(&(device[0].deviceProperties.totalGlobalMem), <ccuda.CUdevice>deviceOrdinal)
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":162
 *     err = ccuda._cuDeviceTotalMem_v2(&(device[0].deviceProperties.totalGlobalMem), <ccuda.CUdevice>deviceOrdinal)
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceTotalMem_v2(&(device[0].deviceProperties.totalGlobalMem), <ccuda.CUdevice>deviceOrdinal)
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":161
 * 
 *     err = ccuda._cuDeviceTotalMem_v2(&(device[0].deviceProperties.totalGlobalMem), <ccuda.CUdevice>deviceOrdinal)
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":164
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceTotalMem_v2(&(device[0].deviceProperties.totalGlobalMem), <ccuda.CUdevice>deviceOrdinal)             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceTotalMem_v2((&(__pyx_v_device[0]).deviceProperties.totalGlobalMem), ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 164, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":165
 * 
 *     err = ccuda._cuDeviceTotalMem_v2(&(device[0].deviceProperties.totalGlobalMem), <ccuda.CUdevice>deviceOrdinal)
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":166
 *     err = ccuda._cuDeviceTotalMem_v2(&(device[0].deviceProperties.totalGlobalMem), <ccuda.CUdevice>deviceOrdinal)
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.major), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":165
 * 
 *     err = ccuda._cuDeviceTotalMem_v2(&(device[0].deviceProperties.totalGlobalMem), <ccuda.CUdevice>deviceOrdinal)
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":168
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.major), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.major), CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 168, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":169
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.major), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":170
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.major), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.minor), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":169
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.major), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":172
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.minor), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.minor), CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 172, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":173
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.minor), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":174
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.minor), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.deviceOverlap), ccuda.CU_DEVICE_ATTRIBUTE_GPU_OVERLAP, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":173
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.minor), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":176
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.deviceOverlap), ccuda.CU_DEVICE_ATTRIBUTE_GPU_OVERLAP, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.deviceOverlap), CU_DEVICE_ATTRIBUTE_GPU_OVERLAP, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 176, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":177
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.deviceOverlap), ccuda.CU_DEVICE_ATTRIBUTE_GPU_OVERLAP, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":178
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.deviceOverlap), ccuda.CU_DEVICE_ATTRIBUTE_GPU_OVERLAP, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.asyncEngineCount), ccuda.CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":177
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.deviceOverlap), ccuda.CU_DEVICE_ATTRIBUTE_GPU_OVERLAP, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":180
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.asyncEngineCount), ccuda.CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.asyncEngineCount), CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 180, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":181
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.asyncEngineCount), ccuda.CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":182
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.asyncEngineCount), ccuda.CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.multiProcessorCount), ccuda.CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":181
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.asyncEngineCount), ccuda.CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":184
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.multiProcessorCount), ccuda.CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.multiProcessorCount), CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 184, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":185
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.multiProcessorCount), ccuda.CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":186
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.multiProcessorCount), ccuda.CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.kernelExecTimeoutEnabled), ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":185
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.multiProcessorCount), ccuda.CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":188
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.kernelExecTimeoutEnabled), ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.kernelExecTimeoutEnabled), CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 188, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":189
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.kernelExecTimeoutEnabled), ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":190
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.kernelExecTimeoutEnabled), ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.integrated), ccuda.CU_DEVICE_ATTRIBUTE_INTEGRATED, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":189
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.kernelExecTimeoutEnabled), ccuda.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":192
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.integrated), ccuda.CU_DEVICE_ATTRIBUTE_INTEGRATED, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.integrated), CU_DEVICE_ATTRIBUTE_INTEGRATED, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 192, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":193
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.integrated), ccuda.CU_DEVICE_ATTRIBUTE_INTEGRATED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":194
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.integrated), ccuda.CU_DEVICE_ATTRIBUTE_INTEGRATED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.canMapHostMemory), ccuda.CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":193
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.integrated), ccuda.CU_DEVICE_ATTRIBUTE_INTEGRATED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":196
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.canMapHostMemory), ccuda.CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.canMapHostMemory), CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 196, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":197
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.canMapHostMemory), ccuda.CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":198
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.canMapHostMemory), ccuda.CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1D), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":197
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.canMapHostMemory), ccuda.CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":200
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1D), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.maxTexture1D), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 200, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":201
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1D), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":202
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1D), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DMipmap), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":201
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1D), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":204
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DMipmap), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.maxTexture1DMipmap), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 204, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":205
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DMipmap), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":206
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DMipmap), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DLinear), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":205
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DMipmap), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":208
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DLinear), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.maxTexture1DLinear), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 208, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":209
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DLinear), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":210
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DLinear), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":209
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DLinear), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":212
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture2D[0])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 212, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":213
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":214
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":213
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":216
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture2D[1])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 216, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":217
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":218
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DMipmap[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":217
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":220
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DMipmap[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture2DMipmap[0])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 220, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":221
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DMipmap[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":222
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DMipmap[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DMipmap[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":221
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DMipmap[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":224
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DMipmap[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture2DMipmap[1])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 224, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":225
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DMipmap[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":226
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DMipmap[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLinear[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":225
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DMipmap[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":228
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLinear[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture2DLinear[0])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 228, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":229
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLinear[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":230
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLinear[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLinear[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":229
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLinear[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":232
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLinear[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture2DLinear[1])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 232, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":233
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLinear[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":234
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLinear[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLinear[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":233
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLinear[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":236
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLinear[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture2DLinear[2])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 236, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":237
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLinear[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":238
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLinear[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DGather[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":237
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLinear[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":240
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DGather[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture2DGather[0])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 240, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":241
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DGather[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":242
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DGather[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DGather[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":241
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DGather[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":244
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DGather[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture2DGather[1])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 244, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":245
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DGather[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":246
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DGather[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":245
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DGather[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":248
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture3D[0])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 248, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":249
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":250
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":249
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":252
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture3D[1])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 252, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":253
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":254
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3D[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":253
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":256
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3D[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture3D[2])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 256, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":257
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3D[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":258
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3D[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3DAlt[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":257
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3D[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":260
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3DAlt[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture3DAlt[0])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 260, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":261
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3DAlt[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":262
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3DAlt[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3DAlt[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":261
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3DAlt[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":264
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3DAlt[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture3DAlt[1])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 264, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":265
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3DAlt[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":266
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3DAlt[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3DAlt[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":265
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3DAlt[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":268
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3DAlt[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture3DAlt[2])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 268, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":269
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3DAlt[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":270
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3DAlt[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTextureCubemap), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":269
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture3DAlt[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":272
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTextureCubemap), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.maxTextureCubemap), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 272, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":273
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTextureCubemap), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":274
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTextureCubemap), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":273
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTextureCubemap), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":276
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture1DLayered[0])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 276, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":277
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":278
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":277
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":280
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture1DLayered[1])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 280, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":281
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":282
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":281
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture1DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":284
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture2DLayered[0])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 284, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":285
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":286
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":285
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":288
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture2DLayered[1])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 288, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":289
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":290
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLayered[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":289
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":292
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLayered[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTexture2DLayered[2])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 292, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":293
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLayered[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":294
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLayered[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTextureCubemapLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":293
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTexture2DLayered[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":296
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTextureCubemapLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTextureCubemapLayered[0])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 296, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":297
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTextureCubemapLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":298
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTextureCubemapLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTextureCubemapLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":297
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTextureCubemapLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":300
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTextureCubemapLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxTextureCubemapLayered[1])), CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 300, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":301
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTextureCubemapLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":302
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTextureCubemapLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface1D), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":301
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxTextureCubemapLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":304
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface1D), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.maxSurface1D), CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 304, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":305
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface1D), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":306
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface1D), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":305
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface1D), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":308
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxSurface2D[0])), CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 308, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":309
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":310
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":309
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":312
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxSurface2D[1])), CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 312, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":313
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":314
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface3D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":313
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":316
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface3D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxSurface3D[0])), CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 316, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":317
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface3D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":318
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface3D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface3D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":317
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface3D[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":320
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface3D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxSurface3D[1])), CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 320, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":321
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface3D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":322
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface3D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface3D[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":321
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface3D[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":324
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface3D[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxSurface3D[2])), CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 324, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":325
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface3D[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":326
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface3D[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface1DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":325
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface3D[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":328
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface1DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxSurface1DLayered[0])), CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 328, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":329
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface1DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":330
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface1DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface1DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":329
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface1DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":332
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface1DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxSurface1DLayered[1])), CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 332, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":333
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface1DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":334
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface1DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":333
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface1DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":336
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxSurface2DLayered[0])), CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 336, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":337
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":338
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":337
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2DLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":340
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxSurface2DLayered[1])), CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 340, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":341
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":342
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2DLayered[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":341
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2DLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":344
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2DLayered[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxSurface2DLayered[2])), CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 344, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":345
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2DLayered[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":346
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2DLayered[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurfaceCubemap), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":345
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurface2DLayered[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":348
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurfaceCubemap), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.maxSurfaceCubemap), CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 348, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":349
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurfaceCubemap), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":350
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurfaceCubemap), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurfaceCubemapLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":349
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurfaceCubemap), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":352
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurfaceCubemapLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxSurfaceCubemapLayered[0])), CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 352, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":353
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurfaceCubemapLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":354
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurfaceCubemapLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurfaceCubemapLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":353
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurfaceCubemapLayered[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":356
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurfaceCubemapLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxSurfaceCubemapLayered[1])), CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 356, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":357
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurfaceCubemapLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":358
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurfaceCubemapLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.concurrentKernels), ccuda.CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":357
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxSurfaceCubemapLayered[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":360
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.concurrentKernels), ccuda.CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.concurrentKernels), CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 360, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":361
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.concurrentKernels), ccuda.CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":362
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.concurrentKernels), ccuda.CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.ECCEnabled), ccuda.CU_DEVICE_ATTRIBUTE_ECC_ENABLED, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":361
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.concurrentKernels), ccuda.CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":364
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.ECCEnabled), ccuda.CU_DEVICE_ATTRIBUTE_ECC_ENABLED, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.ECCEnabled), CU_DEVICE_ATTRIBUTE_ECC_ENABLED, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 364, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":365
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.ECCEnabled), ccuda.CU_DEVICE_ATTRIBUTE_ECC_ENABLED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":366
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.ECCEnabled), ccuda.CU_DEVICE_ATTRIBUTE_ECC_ENABLED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pciBusID), ccuda.CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":365
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.ECCEnabled), ccuda.CU_DEVICE_ATTRIBUTE_ECC_ENABLED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":368
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pciBusID), ccuda.CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.pciBusID), CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 368, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":369
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pciBusID), ccuda.CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":370
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pciBusID), ccuda.CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pciDeviceID), ccuda.CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":369
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pciBusID), ccuda.CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":372
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pciDeviceID), ccuda.CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.pciDeviceID), CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 372, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":373
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pciDeviceID), ccuda.CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":374
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pciDeviceID), ccuda.CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pciDomainID), ccuda.CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":373
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pciDeviceID), ccuda.CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":376
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pciDomainID), ccuda.CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.pciDomainID), CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 376, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":377
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pciDomainID), ccuda.CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":378
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pciDomainID), ccuda.CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.tccDriver), ccuda.CU_DEVICE_ATTRIBUTE_TCC_DRIVER, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":377
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pciDomainID), ccuda.CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":380
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.tccDriver), ccuda.CU_DEVICE_ATTRIBUTE_TCC_DRIVER, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.tccDriver), CU_DEVICE_ATTRIBUTE_TCC_DRIVER, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 380, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":381
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.tccDriver), ccuda.CU_DEVICE_ATTRIBUTE_TCC_DRIVER, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":382
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.tccDriver), ccuda.CU_DEVICE_ATTRIBUTE_TCC_DRIVER, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.unifiedAddressing), ccuda.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":381
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.tccDriver), ccuda.CU_DEVICE_ATTRIBUTE_TCC_DRIVER, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":384
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.unifiedAddressing), ccuda.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.unifiedAddressing), CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 384, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":385
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.unifiedAddressing), ccuda.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":386
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.unifiedAddressing), ccuda.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":385
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.unifiedAddressing), ccuda.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":388
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.memoryClockRate), CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 388, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":389
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":390
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryBusWidth), ccuda.CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":389
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryClockRate), ccuda.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":392
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryBusWidth), ccuda.CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.memoryBusWidth), CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 392, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":393
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryBusWidth), ccuda.CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":394
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryBusWidth), ccuda.CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.l2CacheSize), ccuda.CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":393
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.memoryBusWidth), ccuda.CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":396
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.l2CacheSize), ccuda.CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.l2CacheSize), CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 396, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":397
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.l2CacheSize), ccuda.CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":398
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.l2CacheSize), ccuda.CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.persistingL2CacheMaxSize), ccuda.CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":397
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.l2CacheSize), ccuda.CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":400
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.persistingL2CacheMaxSize), ccuda.CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.persistingL2CacheMaxSize), CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 400, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":401
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.persistingL2CacheMaxSize), ccuda.CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":402
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.persistingL2CacheMaxSize), ccuda.CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsPerMultiProcessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":401
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.persistingL2CacheMaxSize), ccuda.CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":404
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsPerMultiProcessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.maxThreadsPerMultiProcessor), CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 404, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":405
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsPerMultiProcessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":406
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsPerMultiProcessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     cdef int surfaceAlignment
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":405
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsPerMultiProcessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":409
 * 
 *     cdef int surfaceAlignment
 *     err = ccuda._cuDeviceGetAttribute(&(surfaceAlignment), ccuda.CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&__pyx_v_surfaceAlignment), CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 409, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":410
 *     cdef int surfaceAlignment
 *     err = ccuda._cuDeviceGetAttribute(&(surfaceAlignment), ccuda.CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.surfaceAlignment = surfaceAlignment
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":411
 *     err = ccuda._cuDeviceGetAttribute(&(surfaceAlignment), ccuda.CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     device[0].deviceProperties.surfaceAlignment = surfaceAlignment
 * 
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":410
 *     cdef int surfaceAlignment
 *     err = ccuda._cuDeviceGetAttribute(&(surfaceAlignment), ccuda.CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.surfaceAlignment = surfaceAlignment
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":412
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.surfaceAlignment = surfaceAlignment             # <<<<<<<<<<<<<<
 * 
 *     cdef int texturePitchAlignment
 */
  (__pyx_v_device[0]).deviceProperties.surfaceAlignment = __pyx_v_surfaceAlignment;

  /* "cuda/_lib/ccudart/utils.pyx":415
 * 
 *     cdef int texturePitchAlignment
 *     err = ccuda._cuDeviceGetAttribute(&texturePitchAlignment, ccuda.CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&__pyx_v_texturePitchAlignment), CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 415, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":416
 *     cdef int texturePitchAlignment
 *     err = ccuda._cuDeviceGetAttribute(&texturePitchAlignment, ccuda.CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.texturePitchAlignment = texturePitchAlignment
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":417
 *     err = ccuda._cuDeviceGetAttribute(&texturePitchAlignment, ccuda.CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     device[0].deviceProperties.texturePitchAlignment = texturePitchAlignment
 * 
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":416
 *     cdef int texturePitchAlignment
 *     err = ccuda._cuDeviceGetAttribute(&texturePitchAlignment, ccuda.CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.texturePitchAlignment = texturePitchAlignment
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":418
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.texturePitchAlignment = texturePitchAlignment             # <<<<<<<<<<<<<<
 * 
 *     cdef int sharedMemPerBlock
 */
  (__pyx_v_device[0]).deviceProperties.texturePitchAlignment = __pyx_v_texturePitchAlignment;

  /* "cuda/_lib/ccudart/utils.pyx":421
 * 
 *     cdef int sharedMemPerBlock
 *     err = ccuda._cuDeviceGetAttribute(&sharedMemPerBlock, ccuda.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&__pyx_v_sharedMemPerBlock), CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 421, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":422
 *     cdef int sharedMemPerBlock
 *     err = ccuda._cuDeviceGetAttribute(&sharedMemPerBlock, ccuda.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.sharedMemPerBlock = sharedMemPerBlock
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":423
 *     err = ccuda._cuDeviceGetAttribute(&sharedMemPerBlock, ccuda.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     device[0].deviceProperties.sharedMemPerBlock = sharedMemPerBlock
 * 
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":422
 *     cdef int sharedMemPerBlock
 *     err = ccuda._cuDeviceGetAttribute(&sharedMemPerBlock, ccuda.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.sharedMemPerBlock = sharedMemPerBlock
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":424
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.sharedMemPerBlock = sharedMemPerBlock             # <<<<<<<<<<<<<<
 * 
 *     cdef int sharedMemPerBlockOptin
 */
  (__pyx_v_device[0]).deviceProperties.sharedMemPerBlock = __pyx_v_sharedMemPerBlock;

  /* "cuda/_lib/ccudart/utils.pyx":427
 * 
 *     cdef int sharedMemPerBlockOptin
 *     err = ccuda._cuDeviceGetAttribute(&sharedMemPerBlockOptin, ccuda.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&__pyx_v_sharedMemPerBlockOptin), CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 427, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":428
 *     cdef int sharedMemPerBlockOptin
 *     err = ccuda._cuDeviceGetAttribute(&sharedMemPerBlockOptin, ccuda.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.sharedMemPerBlockOptin = sharedMemPerBlockOptin
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":429
 *     err = ccuda._cuDeviceGetAttribute(&sharedMemPerBlockOptin, ccuda.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     device[0].deviceProperties.sharedMemPerBlockOptin = sharedMemPerBlockOptin
 * 
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":428
 *     cdef int sharedMemPerBlockOptin
 *     err = ccuda._cuDeviceGetAttribute(&sharedMemPerBlockOptin, ccuda.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.sharedMemPerBlockOptin = sharedMemPerBlockOptin
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":430
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.sharedMemPerBlockOptin = sharedMemPerBlockOptin             # <<<<<<<<<<<<<<
 * 
 *     cdef int sharedMemPerMultiprocessor
 */
  (__pyx_v_device[0]).deviceProperties.sharedMemPerBlockOptin = __pyx_v_sharedMemPerBlockOptin;

  /* "cuda/_lib/ccudart/utils.pyx":433
 * 
 *     cdef int sharedMemPerMultiprocessor
 *     err = ccuda._cuDeviceGetAttribute(&sharedMemPerMultiprocessor, ccuda.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&__pyx_v_sharedMemPerMultiprocessor), CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 433, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":434
 *     cdef int sharedMemPerMultiprocessor
 *     err = ccuda._cuDeviceGetAttribute(&sharedMemPerMultiprocessor, ccuda.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.sharedMemPerMultiprocessor = sharedMemPerMultiprocessor
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":435
 *     err = ccuda._cuDeviceGetAttribute(&sharedMemPerMultiprocessor, ccuda.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     device[0].deviceProperties.sharedMemPerMultiprocessor = sharedMemPerMultiprocessor
 * 
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":434
 *     cdef int sharedMemPerMultiprocessor
 *     err = ccuda._cuDeviceGetAttribute(&sharedMemPerMultiprocessor, ccuda.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.sharedMemPerMultiprocessor = sharedMemPerMultiprocessor
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":436
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.sharedMemPerMultiprocessor = sharedMemPerMultiprocessor             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.regsPerBlock), ccuda.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))
 */
  (__pyx_v_device[0]).deviceProperties.sharedMemPerMultiprocessor = __pyx_v_sharedMemPerMultiprocessor;

  /* "cuda/_lib/ccudart/utils.pyx":438
 *     device[0].deviceProperties.sharedMemPerMultiprocessor = sharedMemPerMultiprocessor
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.regsPerBlock), ccuda.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.regsPerBlock), CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 438, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":439
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.regsPerBlock), ccuda.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":440
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.regsPerBlock), ccuda.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.regsPerMultiprocessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":439
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.regsPerBlock), ccuda.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":442
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.regsPerMultiprocessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.regsPerMultiprocessor), CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 442, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":443
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.regsPerMultiprocessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":444
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.regsPerMultiprocessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.warpSize), ccuda.CU_DEVICE_ATTRIBUTE_WARP_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":443
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.regsPerMultiprocessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":446
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.warpSize), ccuda.CU_DEVICE_ATTRIBUTE_WARP_SIZE, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.warpSize), CU_DEVICE_ATTRIBUTE_WARP_SIZE, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 446, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":447
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.warpSize), ccuda.CU_DEVICE_ATTRIBUTE_WARP_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":448
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.warpSize), ccuda.CU_DEVICE_ATTRIBUTE_WARP_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     cdef int memPitch
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":447
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.warpSize), ccuda.CU_DEVICE_ATTRIBUTE_WARP_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":451
 * 
 *     cdef int memPitch
 *     err = ccuda._cuDeviceGetAttribute(&memPitch, ccuda.CU_DEVICE_ATTRIBUTE_MAX_PITCH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&__pyx_v_memPitch), CU_DEVICE_ATTRIBUTE_MAX_PITCH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 451, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":452
 *     cdef int memPitch
 *     err = ccuda._cuDeviceGetAttribute(&memPitch, ccuda.CU_DEVICE_ATTRIBUTE_MAX_PITCH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.memPitch = memPitch
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":453
 *     err = ccuda._cuDeviceGetAttribute(&memPitch, ccuda.CU_DEVICE_ATTRIBUTE_MAX_PITCH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     device[0].deviceProperties.memPitch = memPitch
 * 
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":452
 *     cdef int memPitch
 *     err = ccuda._cuDeviceGetAttribute(&memPitch, ccuda.CU_DEVICE_ATTRIBUTE_MAX_PITCH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.memPitch = memPitch
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":454
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.memPitch = memPitch             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsPerBlock), ccuda.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))
 */
  (__pyx_v_device[0]).deviceProperties.memPitch = __pyx_v_memPitch;

  /* "cuda/_lib/ccudart/utils.pyx":456
 *     device[0].deviceProperties.memPitch = memPitch
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsPerBlock), ccuda.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.maxThreadsPerBlock), CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 456, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":457
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsPerBlock), ccuda.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":458
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsPerBlock), ccuda.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsDim[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":457
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsPerBlock), ccuda.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":460
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsDim[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxThreadsDim[0])), CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 460, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":461
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsDim[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":462
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsDim[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsDim[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":461
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsDim[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":464
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsDim[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxThreadsDim[1])), CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 464, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":465
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsDim[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":466
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsDim[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsDim[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":465
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsDim[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":468
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsDim[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxThreadsDim[2])), CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 468, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":469
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsDim[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":470
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsDim[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxGridSize[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":469
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxThreadsDim[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":472
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxGridSize[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxGridSize[0])), CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 472, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":473
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxGridSize[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":474
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxGridSize[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxGridSize[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":473
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxGridSize[0]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":476
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxGridSize[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxGridSize[1])), CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 476, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":477
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxGridSize[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":478
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxGridSize[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxGridSize[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":477
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxGridSize[1]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":480
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxGridSize[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&((__pyx_v_device[0]).deviceProperties.maxGridSize[2])), CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 480, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":481
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxGridSize[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":482
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxGridSize[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     cdef int totalConstMem
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":481
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxGridSize[2]), ccuda.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":485
 * 
 *     cdef int totalConstMem
 *     err = ccuda._cuDeviceGetAttribute(&totalConstMem, ccuda.CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&__pyx_v_totalConstMem), CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 485, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":486
 *     cdef int totalConstMem
 *     err = ccuda._cuDeviceGetAttribute(&totalConstMem, ccuda.CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.totalConstMem = totalConstMem
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":487
 *     err = ccuda._cuDeviceGetAttribute(&totalConstMem, ccuda.CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     device[0].deviceProperties.totalConstMem = totalConstMem
 * 
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":486
 *     cdef int totalConstMem
 *     err = ccuda._cuDeviceGetAttribute(&totalConstMem, ccuda.CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.totalConstMem = totalConstMem
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":488
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.totalConstMem = totalConstMem             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, <ccuda.CUdevice>(deviceOrdinal))
 */
  (__pyx_v_device[0]).deviceProperties.totalConstMem = __pyx_v_totalConstMem;

  /* "cuda/_lib/ccudart/utils.pyx":490
 *     device[0].deviceProperties.totalConstMem = totalConstMem
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.clockRate), CU_DEVICE_ATTRIBUTE_CLOCK_RATE, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 490, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":491
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":492
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     cdef int textureAlignment
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":491
 * 
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.clockRate), ccuda.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":495
 * 
 *     cdef int textureAlignment
 *     err = ccuda._cuDeviceGetAttribute(&textureAlignment, ccuda.CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&__pyx_v_textureAlignment), CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 495, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":496
 *     cdef int textureAlignment
 *     err = ccuda._cuDeviceGetAttribute(&textureAlignment, ccuda.CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.textureAlignment = textureAlignment
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":497
 *     err = ccuda._cuDeviceGetAttribute(&textureAlignment, ccuda.CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     device[0].deviceProperties.textureAlignment = textureAlignment
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.streamPrioritiesSupported), ccuda.CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":496
 *     cdef int textureAlignment
 *     err = ccuda._cuDeviceGetAttribute(&textureAlignment, ccuda.CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.textureAlignment = textureAlignment
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":498
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.textureAlignment = textureAlignment             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.streamPrioritiesSupported), ccuda.CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
  (__pyx_v_device[0]).deviceProperties.textureAlignment = __pyx_v_textureAlignment;

  /* "cuda/_lib/ccudart/utils.pyx":499
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.textureAlignment = textureAlignment
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.streamPrioritiesSupported), ccuda.CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.streamPrioritiesSupported), CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 499, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":500
 *     device[0].deviceProperties.textureAlignment = textureAlignment
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.streamPrioritiesSupported), ccuda.CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.globalL1CacheSupported), ccuda.CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":501
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.streamPrioritiesSupported), ccuda.CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.globalL1CacheSupported), ccuda.CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":500
 *     device[0].deviceProperties.textureAlignment = textureAlignment
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.streamPrioritiesSupported), ccuda.CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.globalL1CacheSupported), ccuda.CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":502
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.globalL1CacheSupported), ccuda.CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.globalL1CacheSupported), CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 502, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":503
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.globalL1CacheSupported), ccuda.CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.localL1CacheSupported), ccuda.CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":504
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.globalL1CacheSupported), ccuda.CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.localL1CacheSupported), ccuda.CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":503
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.globalL1CacheSupported), ccuda.CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.localL1CacheSupported), ccuda.CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":505
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.localL1CacheSupported), ccuda.CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.localL1CacheSupported), CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 505, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":506
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.localL1CacheSupported), ccuda.CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.managedMemory), ccuda.CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":507
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.localL1CacheSupported), ccuda.CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.managedMemory), ccuda.CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":506
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.localL1CacheSupported), ccuda.CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.managedMemory), ccuda.CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":508
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.managedMemory), ccuda.CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.managedMemory), CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 508, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":509
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.managedMemory), ccuda.CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.isMultiGpuBoard), ccuda.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":510
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.managedMemory), ccuda.CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.isMultiGpuBoard), ccuda.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":509
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.managedMemory), ccuda.CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.isMultiGpuBoard), ccuda.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":511
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.isMultiGpuBoard), ccuda.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.isMultiGpuBoard), CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 511, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":512
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.isMultiGpuBoard), ccuda.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.multiGpuBoardGroupID), ccuda.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":513
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.isMultiGpuBoard), ccuda.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.multiGpuBoardGroupID), ccuda.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":512
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.isMultiGpuBoard), ccuda.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.multiGpuBoardGroupID), ccuda.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":514
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.multiGpuBoardGroupID), ccuda.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.multiGpuBoardGroupID), CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 514, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":515
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.multiGpuBoardGroupID), ccuda.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.hostNativeAtomicSupported), ccuda.CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":516
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.multiGpuBoardGroupID), ccuda.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.hostNativeAtomicSupported), ccuda.CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":515
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.multiGpuBoardGroupID), ccuda.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.hostNativeAtomicSupported), ccuda.CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":517
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.hostNativeAtomicSupported), ccuda.CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.hostNativeAtomicSupported), CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 517, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":518
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.hostNativeAtomicSupported), ccuda.CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":519
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.hostNativeAtomicSupported), ccuda.CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":518
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.hostNativeAtomicSupported), ccuda.CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":520
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.singleToDoublePrecisionPerfRatio), CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 520, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":521
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pageableMemoryAccess), ccuda.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":522
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pageableMemoryAccess), ccuda.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":521
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.singleToDoublePrecisionPerfRatio), ccuda.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pageableMemoryAccess), ccuda.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":523
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pageableMemoryAccess), ccuda.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.pageableMemoryAccess), CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 523, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":524
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pageableMemoryAccess), ccuda.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.concurrentManagedAccess), ccuda.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":525
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pageableMemoryAccess), ccuda.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.concurrentManagedAccess), ccuda.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":524
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pageableMemoryAccess), ccuda.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.concurrentManagedAccess), ccuda.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":526
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.concurrentManagedAccess), ccuda.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.concurrentManagedAccess), CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 526, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":527
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.concurrentManagedAccess), ccuda.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computePreemptionSupported), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":528
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.concurrentManagedAccess), ccuda.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computePreemptionSupported), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":527
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.concurrentManagedAccess), ccuda.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computePreemptionSupported), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":529
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computePreemptionSupported), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.computePreemptionSupported), CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 529, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":530
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computePreemptionSupported), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.canUseHostPointerForRegisteredMem), ccuda.CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":531
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computePreemptionSupported), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.canUseHostPointerForRegisteredMem), ccuda.CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":530
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.computePreemptionSupported), ccuda.CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.canUseHostPointerForRegisteredMem), ccuda.CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":532
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.canUseHostPointerForRegisteredMem), ccuda.CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.canUseHostPointerForRegisteredMem), CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 532, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":533
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.canUseHostPointerForRegisteredMem), ccuda.CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.cooperativeLaunch), ccuda.CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":534
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.canUseHostPointerForRegisteredMem), ccuda.CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.cooperativeLaunch), ccuda.CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":533
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.canUseHostPointerForRegisteredMem), ccuda.CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.cooperativeLaunch), ccuda.CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":535
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.cooperativeLaunch), ccuda.CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.cooperativeLaunch), CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 535, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":536
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.cooperativeLaunch), ccuda.CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.cooperativeMultiDeviceLaunch), ccuda.CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":537
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.cooperativeLaunch), ccuda.CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.cooperativeMultiDeviceLaunch), ccuda.CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":536
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.cooperativeLaunch), ccuda.CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.cooperativeMultiDeviceLaunch), ccuda.CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":538
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.cooperativeMultiDeviceLaunch), ccuda.CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.cooperativeMultiDeviceLaunch), CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 538, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":539
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.cooperativeMultiDeviceLaunch), ccuda.CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pageableMemoryAccessUsesHostPageTables), ccuda.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":540
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.cooperativeMultiDeviceLaunch), ccuda.CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pageableMemoryAccessUsesHostPageTables), ccuda.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":539
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.cooperativeMultiDeviceLaunch), ccuda.CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pageableMemoryAccessUsesHostPageTables), ccuda.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":541
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pageableMemoryAccessUsesHostPageTables), ccuda.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.pageableMemoryAccessUsesHostPageTables), CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 541, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":542
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pageableMemoryAccessUsesHostPageTables), ccuda.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.directManagedMemAccessFromHost), ccuda.CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":543
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pageableMemoryAccessUsesHostPageTables), ccuda.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.directManagedMemAccessFromHost), ccuda.CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":542
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.pageableMemoryAccessUsesHostPageTables), ccuda.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.directManagedMemAccessFromHost), ccuda.CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":544
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.directManagedMemAccessFromHost), ccuda.CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.directManagedMemAccessFromHost), CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 544, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":545
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.directManagedMemAccessFromHost), ccuda.CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":546
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.directManagedMemAccessFromHost), ccuda.CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     err = ccuda._cuDeviceGetUuid(<ccuda.CUuuid_st*>(&(device[0].deviceProperties.uuid)), <ccuda.CUdevice>deviceOrdinal)
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":545
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.directManagedMemAccessFromHost), ccuda.CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":548
 *         return cudaErrorInitializationError
 * 
 *     err = ccuda._cuDeviceGetUuid(<ccuda.CUuuid_st*>(&(device[0].deviceProperties.uuid)), <ccuda.CUdevice>deviceOrdinal)             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetUuid(((struct CUuuid_st *)(&(__pyx_v_device[0]).deviceProperties.uuid)), ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 548, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":549
 * 
 *     err = ccuda._cuDeviceGetUuid(<ccuda.CUuuid_st*>(&(device[0].deviceProperties.uuid)), <ccuda.CUdevice>deviceOrdinal)
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxBlocksPerMultiProcessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":550
 *     err = ccuda._cuDeviceGetUuid(<ccuda.CUuuid_st*>(&(device[0].deviceProperties.uuid)), <ccuda.CUdevice>deviceOrdinal)
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxBlocksPerMultiProcessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":549
 * 
 *     err = ccuda._cuDeviceGetUuid(<ccuda.CUuuid_st*>(&(device[0].deviceProperties.uuid)), <ccuda.CUdevice>deviceOrdinal)
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxBlocksPerMultiProcessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":551
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxBlocksPerMultiProcessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.maxBlocksPerMultiProcessor), CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 551, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":552
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxBlocksPerMultiProcessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.accessPolicyMaxWindowSize), ccuda.CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":553
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxBlocksPerMultiProcessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.accessPolicyMaxWindowSize), ccuda.CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":552
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.maxBlocksPerMultiProcessor), ccuda.CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.accessPolicyMaxWindowSize), ccuda.CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":554
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.accessPolicyMaxWindowSize), ccuda.CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&(__pyx_v_device[0]).deviceProperties.accessPolicyMaxWindowSize), CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 554, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":555
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.accessPolicyMaxWindowSize), ccuda.CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":556
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.accessPolicyMaxWindowSize), ccuda.CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 * 
 *     cdef int reservedSharedMemPerBlock
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":555
 *         return cudaErrorInitializationError
 *     err = ccuda._cuDeviceGetAttribute(&(device[0].deviceProperties.accessPolicyMaxWindowSize), ccuda.CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":559
 * 
 *     cdef int reservedSharedMemPerBlock
 *     err = ccuda._cuDeviceGetAttribute(&reservedSharedMemPerBlock, ccuda.CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))             # <<<<<<<<<<<<<<
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute((&__pyx_v_reservedSharedMemPerBlock), CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK, ((CUdevice)__pyx_v_deviceOrdinal)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 559, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":560
 *     cdef int reservedSharedMemPerBlock
 *     err = ccuda._cuDeviceGetAttribute(&reservedSharedMemPerBlock, ccuda.CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.reservedSharedMemPerBlock = reservedSharedMemPerBlock
 */
  __pyx_t_2 = (__pyx_v_err != CUDA_SUCCESS);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":561
 *     err = ccuda._cuDeviceGetAttribute(&reservedSharedMemPerBlock, ccuda.CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError             # <<<<<<<<<<<<<<
 *     device[0].deviceProperties.reservedSharedMemPerBlock = reservedSharedMemPerBlock
 * 
 */
    __pyx_r = cudaErrorInitializationError;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":560
 *     cdef int reservedSharedMemPerBlock
 *     err = ccuda._cuDeviceGetAttribute(&reservedSharedMemPerBlock, ccuda.CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK, <ccuda.CUdevice>(deviceOrdinal))
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.reservedSharedMemPerBlock = reservedSharedMemPerBlock
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":562
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:
 *         return cudaErrorInitializationError
 *     device[0].deviceProperties.reservedSharedMemPerBlock = reservedSharedMemPerBlock             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
  (__pyx_v_device[0]).deviceProperties.reservedSharedMemPerBlock = __pyx_v_reservedSharedMemPerBlock;

  /* "cuda/_lib/ccudart/utils.pyx":564
 *     device[0].deviceProperties.reservedSharedMemPerBlock = reservedSharedMemPerBlock
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":142
 * 
 * 
 * cdef cudaError_t initDevice(cudaPythonDevice *device, int deviceOrdinal) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     # ccuda.CUcontext primaryContext
 *     device[0].primaryContext = NULL
 */

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

/* "cuda/_lib/ccudart/utils.pyx":567
 * 
 * 
 * cdef cudaError_t initPrimaryContext(cudaPythonDevice *device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_initPrimaryContext(struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device) {
  cudaError_t __pyx_v_err;
  unsigned int __pyx_v_version;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  CUresult __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("initPrimaryContext", __pyx_f[0], 567, 1, __PYX_ERR(0, 567, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":568
 * 
 * cdef cudaError_t initPrimaryContext(cudaPythonDevice *device) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     # If we have context retained we need to check if it is not reset
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":572
 *     # If we have context retained we need to check if it is not reset
 *     cdef unsigned int version
 *     if device[0].primaryContextRetained:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuCtxGetApiVersion(device[0].primaryContext, &version)
 *         if err == cudaErrorDeviceUninitialized:
 */
  __pyx_t_1 = ((__pyx_v_device[0]).primaryContextRetained != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":573
 *     cdef unsigned int version
 *     if device[0].primaryContextRetained:
 *         err = <cudaError_t>ccuda._cuCtxGetApiVersion(device[0].primaryContext, &version)             # <<<<<<<<<<<<<<
 *         if err == cudaErrorDeviceUninitialized:
 *             err = <cudaError_t>ccuda.cuDevicePrimaryCtxRelease(device[0].driverDevice)
 */
    __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetApiVersion((__pyx_v_device[0]).primaryContext, (&__pyx_v_version)); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 573, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_2);

    /* "cuda/_lib/ccudart/utils.pyx":574
 *     if device[0].primaryContextRetained:
 *         err = <cudaError_t>ccuda._cuCtxGetApiVersion(device[0].primaryContext, &version)
 *         if err == cudaErrorDeviceUninitialized:             # <<<<<<<<<<<<<<
 *             err = <cudaError_t>ccuda.cuDevicePrimaryCtxRelease(device[0].driverDevice)
 *             if err != cudaSuccess:
 */
    __pyx_t_1 = (__pyx_v_err == cudaErrorDeviceUninitialized);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":575
 *         err = <cudaError_t>ccuda._cuCtxGetApiVersion(device[0].primaryContext, &version)
 *         if err == cudaErrorDeviceUninitialized:
 *             err = <cudaError_t>ccuda.cuDevicePrimaryCtxRelease(device[0].driverDevice)             # <<<<<<<<<<<<<<
 *             if err != cudaSuccess:
 *                 return err
 */
      __pyx_t_2 = __pyx_f_4cuda_5ccuda_cuDevicePrimaryCtxRelease((__pyx_v_device[0]).driverDevice); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 575, __pyx_L1_error)
      __pyx_v_err = ((cudaError_t)__pyx_t_2);

      /* "cuda/_lib/ccudart/utils.pyx":576
 *         if err == cudaErrorDeviceUninitialized:
 *             err = <cudaError_t>ccuda.cuDevicePrimaryCtxRelease(device[0].driverDevice)
 *             if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *                 return err
 *             device[0].primaryContextRetained = False
 */
      __pyx_t_1 = (__pyx_v_err != cudaSuccess);
      if (__pyx_t_1) {

        /* "cuda/_lib/ccudart/utils.pyx":577
 *             err = <cudaError_t>ccuda.cuDevicePrimaryCtxRelease(device[0].driverDevice)
 *             if err != cudaSuccess:
 *                 return err             # <<<<<<<<<<<<<<
 *             device[0].primaryContextRetained = False
 *         elif err != cudaSuccess:
 */
        __pyx_r = __pyx_v_err;
        goto __pyx_L0;

        /* "cuda/_lib/ccudart/utils.pyx":576
 *         if err == cudaErrorDeviceUninitialized:
 *             err = <cudaError_t>ccuda.cuDevicePrimaryCtxRelease(device[0].driverDevice)
 *             if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *                 return err
 *             device[0].primaryContextRetained = False
 */
      }

      /* "cuda/_lib/ccudart/utils.pyx":578
 *             if err != cudaSuccess:
 *                 return err
 *             device[0].primaryContextRetained = False             # <<<<<<<<<<<<<<
 *         elif err != cudaSuccess:
 *             return err
 */
      (__pyx_v_device[0]).primaryContextRetained = 0;

      /* "cuda/_lib/ccudart/utils.pyx":574
 *     if device[0].primaryContextRetained:
 *         err = <cudaError_t>ccuda._cuCtxGetApiVersion(device[0].primaryContext, &version)
 *         if err == cudaErrorDeviceUninitialized:             # <<<<<<<<<<<<<<
 *             err = <cudaError_t>ccuda.cuDevicePrimaryCtxRelease(device[0].driverDevice)
 *             if err != cudaSuccess:
 */
      goto __pyx_L4;
    }

    /* "cuda/_lib/ccudart/utils.pyx":579
 *                 return err
 *             device[0].primaryContextRetained = False
 *         elif err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":580
 *             device[0].primaryContextRetained = False
 *         elif err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *     # If we don't or it is invalid we need to recreate it
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":579
 *                 return err
 *             device[0].primaryContextRetained = False
 *         elif err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }
    __pyx_L4:;

    /* "cuda/_lib/ccudart/utils.pyx":572
 *     # If we have context retained we need to check if it is not reset
 *     cdef unsigned int version
 *     if device[0].primaryContextRetained:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuCtxGetApiVersion(device[0].primaryContext, &version)
 *         if err == cudaErrorDeviceUninitialized:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":583
 * 
 *     # If we don't or it is invalid we need to recreate it
 *     if not device[0].primaryContextRetained:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuDevicePrimaryCtxRetain(&device[0].primaryContext, device[0].driverDevice)
 *         if err != cudaSuccess:
 */
  __pyx_t_1 = (!((__pyx_v_device[0]).primaryContextRetained != 0));
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":584
 *     # If we don't or it is invalid we need to recreate it
 *     if not device[0].primaryContextRetained:
 *         err = <cudaError_t>ccuda._cuDevicePrimaryCtxRetain(&device[0].primaryContext, device[0].driverDevice)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxRetain((&(__pyx_v_device[0]).primaryContext), (__pyx_v_device[0]).driverDevice); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 584, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_2);

    /* "cuda/_lib/ccudart/utils.pyx":585
 *     if not device[0].primaryContextRetained:
 *         err = <cudaError_t>ccuda._cuDevicePrimaryCtxRetain(&device[0].primaryContext, device[0].driverDevice)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         device[0].primaryContextRetained = True
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":586
 *         err = <cudaError_t>ccuda._cuDevicePrimaryCtxRetain(&device[0].primaryContext, device[0].driverDevice)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         device[0].primaryContextRetained = True
 *     return err
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":585
 *     if not device[0].primaryContextRetained:
 *         err = <cudaError_t>ccuda._cuDevicePrimaryCtxRetain(&device[0].primaryContext, device[0].driverDevice)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         device[0].primaryContextRetained = True
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":587
 *         if err != cudaSuccess:
 *             return err
 *         device[0].primaryContextRetained = True             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (__pyx_v_device[0]).primaryContextRetained = 1;

    /* "cuda/_lib/ccudart/utils.pyx":583
 * 
 *     # If we don't or it is invalid we need to recreate it
 *     if not device[0].primaryContextRetained:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuDevicePrimaryCtxRetain(&device[0].primaryContext, device[0].driverDevice)
 *         if err != cudaSuccess:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":588
 *             return err
 *         device[0].primaryContextRetained = True
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t resetPrimaryContext(cudaPythonDevice* device) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":567
 * 
 * 
 * cdef cudaError_t initPrimaryContext(cudaPythonDevice *device) 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.utils.initPrimaryContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":590
 *     return err
 * 
 * cdef cudaError_t resetPrimaryContext(cudaPythonDevice* device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef unsigned int version
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_resetPrimaryContext(struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_device) {
  cudaError_t __pyx_v_err;
  unsigned int __pyx_v_version;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __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("resetPrimaryContext", __pyx_f[0], 590, 1, __PYX_ERR(0, 590, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":591
 * 
 * cdef cudaError_t resetPrimaryContext(cudaPythonDevice* device) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef unsigned int version
 * 
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":594
 *     cdef unsigned int version
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetApiVersion(device[0].primaryContext, &version)             # <<<<<<<<<<<<<<
 *     if err == cudaSuccess:
 *         if not device[0].primaryContextRetained:
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetApiVersion((__pyx_v_device[0]).primaryContext, (&__pyx_v_version)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 594, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/utils.pyx":595
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetApiVersion(device[0].primaryContext, &version)
 *     if err == cudaSuccess:             # <<<<<<<<<<<<<<
 *         if not device[0].primaryContextRetained:
 *             err = <cudaError_t>ccuda._cuDevicePrimaryCtxRetain(&device[0].primaryContext, device[0].driverDevice)
 */
  switch (__pyx_v_err) {
    case cudaSuccess:

    /* "cuda/_lib/ccudart/utils.pyx":596
 *     err = <cudaError_t>ccuda._cuCtxGetApiVersion(device[0].primaryContext, &version)
 *     if err == cudaSuccess:
 *         if not device[0].primaryContextRetained:             # <<<<<<<<<<<<<<
 *             err = <cudaError_t>ccuda._cuDevicePrimaryCtxRetain(&device[0].primaryContext, device[0].driverDevice)
 *             if err != cudaSuccess:
 */
    __pyx_t_2 = (!((__pyx_v_device[0]).primaryContextRetained != 0));
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":597
 *     if err == cudaSuccess:
 *         if not device[0].primaryContextRetained:
 *             err = <cudaError_t>ccuda._cuDevicePrimaryCtxRetain(&device[0].primaryContext, device[0].driverDevice)             # <<<<<<<<<<<<<<
 *             if err != cudaSuccess:
 *                 return err
 */
      __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxRetain((&(__pyx_v_device[0]).primaryContext), (__pyx_v_device[0]).driverDevice); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 597, __pyx_L1_error)
      __pyx_v_err = ((cudaError_t)__pyx_t_1);

      /* "cuda/_lib/ccudart/utils.pyx":598
 *         if not device[0].primaryContextRetained:
 *             err = <cudaError_t>ccuda._cuDevicePrimaryCtxRetain(&device[0].primaryContext, device[0].driverDevice)
 *             if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *                 return err
 *             device[0].primaryContextRetained = True
 */
      __pyx_t_2 = (__pyx_v_err != cudaSuccess);
      if (__pyx_t_2) {

        /* "cuda/_lib/ccudart/utils.pyx":599
 *             err = <cudaError_t>ccuda._cuDevicePrimaryCtxRetain(&device[0].primaryContext, device[0].driverDevice)
 *             if err != cudaSuccess:
 *                 return err             # <<<<<<<<<<<<<<
 *             device[0].primaryContextRetained = True
 *         ccuda._cuDevicePrimaryCtxReset_v2(device[0].driverDevice)
 */
        __pyx_r = __pyx_v_err;
        goto __pyx_L0;

        /* "cuda/_lib/ccudart/utils.pyx":598
 *         if not device[0].primaryContextRetained:
 *             err = <cudaError_t>ccuda._cuDevicePrimaryCtxRetain(&device[0].primaryContext, device[0].driverDevice)
 *             if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *                 return err
 *             device[0].primaryContextRetained = True
 */
      }

      /* "cuda/_lib/ccudart/utils.pyx":600
 *             if err != cudaSuccess:
 *                 return err
 *             device[0].primaryContextRetained = True             # <<<<<<<<<<<<<<
 *         ccuda._cuDevicePrimaryCtxReset_v2(device[0].driverDevice)
 *         return cudaSuccess
 */
      (__pyx_v_device[0]).primaryContextRetained = 1;

      /* "cuda/_lib/ccudart/utils.pyx":596
 *     err = <cudaError_t>ccuda._cuCtxGetApiVersion(device[0].primaryContext, &version)
 *     if err == cudaSuccess:
 *         if not device[0].primaryContextRetained:             # <<<<<<<<<<<<<<
 *             err = <cudaError_t>ccuda._cuDevicePrimaryCtxRetain(&device[0].primaryContext, device[0].driverDevice)
 *             if err != cudaSuccess:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":601
 *                 return err
 *             device[0].primaryContextRetained = True
 *         ccuda._cuDevicePrimaryCtxReset_v2(device[0].driverDevice)             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     elif err == cudaErrorDeviceUninitialized:
 */
    __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxReset_v2((__pyx_v_device[0]).driverDevice); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 601, __pyx_L1_error)

    /* "cuda/_lib/ccudart/utils.pyx":602
 *             device[0].primaryContextRetained = True
 *         ccuda._cuDevicePrimaryCtxReset_v2(device[0].driverDevice)
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     elif err == cudaErrorDeviceUninitialized:
 *         return cudaSuccess
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":595
 * 
 *     err = <cudaError_t>ccuda._cuCtxGetApiVersion(device[0].primaryContext, &version)
 *     if err == cudaSuccess:             # <<<<<<<<<<<<<<
 *         if not device[0].primaryContextRetained:
 *             err = <cudaError_t>ccuda._cuDevicePrimaryCtxRetain(&device[0].primaryContext, device[0].driverDevice)
 */
    break;
    case cudaErrorDeviceUninitialized:

    /* "cuda/_lib/ccudart/utils.pyx":604
 *         return cudaSuccess
 *     elif err == cudaErrorDeviceUninitialized:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     else:
 *         return err
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":603
 *         ccuda._cuDevicePrimaryCtxReset_v2(device[0].driverDevice)
 *         return cudaSuccess
 *     elif err == cudaErrorDeviceUninitialized:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     else:
 */
    break;
    default:

    /* "cuda/_lib/ccudart/utils.pyx":606
 *         return cudaSuccess
 *     else:
 *         return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;
    break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":590
 *     return err
 * 
 * cdef cudaError_t resetPrimaryContext(cudaPythonDevice* device) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef unsigned int version
 */

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

/* "cuda/_lib/ccudart/utils.pyx":609
 * 
 * 
 * cdef cudaPythonGlobal globalGetInstance():             # <<<<<<<<<<<<<<
 *     return m_global
 * 
 */

static struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_f_4cuda_4_lib_7ccudart_5utils_globalGetInstance(void) {
  struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("globalGetInstance", 1);
  __Pyx_TraceCall("globalGetInstance", __pyx_f[0], 609, 0, __PYX_ERR(0, 609, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":610
 * 
 * cdef cudaPythonGlobal globalGetInstance():
 *     return m_global             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_4cuda_4_lib_7ccudart_5utils_m_global);
  __pyx_r = __pyx_v_4cuda_4_lib_7ccudart_5utils_m_global;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":609
 * 
 * 
 * cdef cudaPythonGlobal globalGetInstance():             # <<<<<<<<<<<<<<
 *     return m_global
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cuda._lib.ccudart.utils.globalGetInstance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":613
 * 
 * 
 * cdef cudaError_t _setLastError(cudaError_t err) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         m_global._lastError = err
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils__setLastError(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("_setLastError", __pyx_f[0], 613, 1, __PYX_ERR(0, 613, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":614
 * 
 * cdef cudaError_t _setLastError(cudaError_t err) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         m_global._lastError = err
 * 
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":615
 * cdef cudaError_t _setLastError(cudaError_t err) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if err != cudaSuccess:
 *         m_global._lastError = err             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_4cuda_4_lib_7ccudart_5utils_m_global->_lastError = __pyx_v_err;

    /* "cuda/_lib/ccudart/utils.pyx":614
 * 
 * cdef cudaError_t _setLastError(cudaError_t err) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         m_global._lastError = err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":613
 * 
 * 
 * cdef cudaError_t _setLastError(cudaError_t err) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         m_global._lastError = err
 */

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

/* "cuda/_lib/ccudart/utils.pyx":618
 * 
 * 
 * cdef int case_desc(const cudaChannelFormatDesc* d, int x, int y, int z, int w, int f) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     return d[0].x == x and d[0].y == y and d[0].z == z and d[0].w == w and d[0].f == f
 * 
 */

static int __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(struct cudaChannelFormatDesc const *__pyx_v_d, int __pyx_v_x, int __pyx_v_y, int __pyx_v_z, int __pyx_v_w, int __pyx_v_f) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  int __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("case_desc", __pyx_f[0], 618, 1, __PYX_ERR(0, 618, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":619
 * 
 * cdef int case_desc(const cudaChannelFormatDesc* d, int x, int y, int z, int w, int f) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     return d[0].x == x and d[0].y == y and d[0].z == z and d[0].w == w and d[0].f == f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = ((__pyx_v_d[0]).x == __pyx_v_x);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_d[0]).y == __pyx_v_y);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_d[0]).z == __pyx_v_z);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_d[0]).w == __pyx_v_w);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_d[0]).f == __pyx_v_f);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":618
 * 
 * 
 * cdef int case_desc(const cudaChannelFormatDesc* d, int x, int y, int z, int w, int f) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     return d[0].x == x and d[0].y == y and d[0].z == z and d[0].w == w and d[0].f == f
 * 
 */

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

/* "cuda/_lib/ccudart/utils.pyx":622
 * 
 * 
 * cdef cudaError_t getDescInfo(const cudaChannelFormatDesc* d, int *numberOfChannels, ccuda.CUarray_format *format) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     # Check validity
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSigned,
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo(struct cudaChannelFormatDesc const *__pyx_v_d, int *__pyx_v_numberOfChannels, CUarray_format *__pyx_v_format) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  enum cudaChannelFormatKind __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __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("getDescInfo", __pyx_f[0], 622, 1, __PYX_ERR(0, 622, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":624
 * cdef cudaError_t getDescInfo(const cudaChannelFormatDesc* d, int *numberOfChannels, ccuda.CUarray_format *format) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     # Check validity
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSigned,             # <<<<<<<<<<<<<<
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         if (d[0].x != 8) and (d[0].x != 16) and (d[0].x != 32):
 */
  __pyx_t_1 = (__pyx_v_d[0]).f;
  __pyx_t_3 = (__pyx_t_1 == cudaChannelFormatKindSigned);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":625
 *     # Check validity
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSigned,
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         if (d[0].x != 8) and (d[0].x != 16) and (d[0].x != 32):
 *             return cudaErrorInvalidChannelDescriptor
 */
  __pyx_t_3 = (__pyx_t_1 == cudaChannelFormatKindUnsigned);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":624
 * cdef cudaError_t getDescInfo(const cudaChannelFormatDesc* d, int *numberOfChannels, ccuda.CUarray_format *format) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     # Check validity
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSigned,             # <<<<<<<<<<<<<<
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         if (d[0].x != 8) and (d[0].x != 16) and (d[0].x != 32):
 */
  __pyx_t_3 = __pyx_t_2;
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":626
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSigned,
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         if (d[0].x != 8) and (d[0].x != 16) and (d[0].x != 32):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindFloat,):
 */
    __pyx_t_2 = ((__pyx_v_d[0]).x != 8);
    if (__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_d[0]).x != 16);
    if (__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_d[0]).x != 32);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_3) {

      /* "cuda/_lib/ccudart/utils.pyx":627
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         if (d[0].x != 8) and (d[0].x != 16) and (d[0].x != 32):
 *             return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindFloat,):
 *         if (d[0].x != 16) and (d[0].x != 32):
 */
      __pyx_r = cudaErrorInvalidChannelDescriptor;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":626
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSigned,
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         if (d[0].x != 8) and (d[0].x != 16) and (d[0].x != 32):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindFloat,):
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":624
 * cdef cudaError_t getDescInfo(const cudaChannelFormatDesc* d, int *numberOfChannels, ccuda.CUarray_format *format) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     # Check validity
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSigned,             # <<<<<<<<<<<<<<
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         if (d[0].x != 8) and (d[0].x != 16) and (d[0].x != 32):
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":628
 *         if (d[0].x != 8) and (d[0].x != 16) and (d[0].x != 32):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindFloat,):             # <<<<<<<<<<<<<<
 *         if (d[0].x != 16) and (d[0].x != 32):
 *             return cudaErrorInvalidChannelDescriptor
 */
  __pyx_t_1 = (__pyx_v_d[0]).f;
  __pyx_t_3 = (__pyx_t_1 == cudaChannelFormatKindFloat);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":629
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindFloat,):
 *         if (d[0].x != 16) and (d[0].x != 32):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,):
 */
    __pyx_t_2 = ((__pyx_v_d[0]).x != 16);
    if (__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_d[0]).x != 32);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_3) {

      /* "cuda/_lib/ccudart/utils.pyx":630
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindFloat,):
 *         if (d[0].x != 16) and (d[0].x != 32):
 *             return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,):
 *         if (d[0].x != 8) or (d[0].y != 8) or (d[0].z != 8) or (d[0].w != 0):
 */
      __pyx_r = cudaErrorInvalidChannelDescriptor;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":629
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindFloat,):
 *         if (d[0].x != 16) and (d[0].x != 32):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,):
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":628
 *         if (d[0].x != 8) and (d[0].x != 16) and (d[0].x != 32):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindFloat,):             # <<<<<<<<<<<<<<
 *         if (d[0].x != 16) and (d[0].x != 32):
 *             return cudaErrorInvalidChannelDescriptor
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":631
 *         if (d[0].x != 16) and (d[0].x != 32):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,):             # <<<<<<<<<<<<<<
 *         if (d[0].x != 8) or (d[0].y != 8) or (d[0].z != 8) or (d[0].w != 0):
 *             return cudaErrorInvalidChannelDescriptor
 */
  __pyx_t_1 = (__pyx_v_d[0]).f;
  __pyx_t_3 = (__pyx_t_1 == cudaChannelFormatKindNV12);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":632
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,):
 *         if (d[0].x != 8) or (d[0].y != 8) or (d[0].z != 8) or (d[0].w != 0):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1,
 */
    __pyx_t_2 = ((__pyx_v_d[0]).x != 8);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_d[0]).y != 8);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_d[0]).z != 8);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_d[0]).w != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L14_bool_binop_done:;
    if (__pyx_t_3) {

      /* "cuda/_lib/ccudart/utils.pyx":633
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,):
 *         if (d[0].x != 8) or (d[0].y != 8) or (d[0].z != 8) or (d[0].w != 0):
 *             return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2,
 */
      __pyx_r = cudaErrorInvalidChannelDescriptor;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":632
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,):
 *         if (d[0].x != 8) or (d[0].y != 8) or (d[0].z != 8) or (d[0].w != 0):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1,
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":631
 *         if (d[0].x != 16) and (d[0].x != 32):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,):             # <<<<<<<<<<<<<<
 *         if (d[0].x != 8) or (d[0].y != 8) or (d[0].z != 8) or (d[0].w != 0):
 *             return cudaErrorInvalidChannelDescriptor
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":634
 *         if (d[0].x != 8) or (d[0].y != 8) or (d[0].z != 8) or (d[0].w != 0):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4,
 */
  __pyx_t_1 = (__pyx_v_d[0]).f;
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindSignedNormalized8X1);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L18_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":635
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1,
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindSignedNormalized8X2);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L18_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":634
 *         if (d[0].x != 8) or (d[0].y != 8) or (d[0].z != 8) or (d[0].w != 0):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4,
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindSignedNormalized8X4);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L18_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":637
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4,):
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindUnsignedNormalized8X1);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L18_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":634
 *         if (d[0].x != 8) or (d[0].y != 8) or (d[0].z != 8) or (d[0].w != 0):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4,
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindUnsignedNormalized8X2);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L18_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":639
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4,):             # <<<<<<<<<<<<<<
 *         if (d[0].x != 8):
 *             return cudaErrorInvalidChannelDescriptor
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindUnsignedNormalized8X4);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L18_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":634
 *         if (d[0].x != 8) or (d[0].y != 8) or (d[0].z != 8) or (d[0].w != 0):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4,
 */
  __pyx_t_2 = __pyx_t_3;
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":640
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4,):
 *         if (d[0].x != 8):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1,
 */
    __pyx_t_2 = ((__pyx_v_d[0]).x != 8);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":641
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4,):
 *         if (d[0].x != 8):
 *             return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2,
 */
      __pyx_r = cudaErrorInvalidChannelDescriptor;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":640
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4,):
 *         if (d[0].x != 8):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1,
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":634
 *         if (d[0].x != 8) or (d[0].y != 8) or (d[0].z != 8) or (d[0].w != 0):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4,
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":642
 *         if (d[0].x != 8):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4,
 */
  __pyx_t_1 = (__pyx_v_d[0]).f;
  __pyx_t_3 = (__pyx_t_1 == cudaChannelFormatKindSignedNormalized16X1);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L25_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":643
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1,
 */
  __pyx_t_3 = (__pyx_t_1 == cudaChannelFormatKindSignedNormalized16X2);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L25_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":642
 *         if (d[0].x != 8):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4,
 */
  __pyx_t_3 = (__pyx_t_1 == cudaChannelFormatKindSignedNormalized16X4);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L25_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":645
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4,):
 */
  __pyx_t_3 = (__pyx_t_1 == cudaChannelFormatKindUnsignedNormalized16X1);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L25_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":642
 *         if (d[0].x != 8):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4,
 */
  __pyx_t_3 = (__pyx_t_1 == cudaChannelFormatKindUnsignedNormalized16X2);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L25_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":647
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4,):             # <<<<<<<<<<<<<<
 *         if (d[0].x != 16):
 *             return cudaErrorInvalidChannelDescriptor
 */
  __pyx_t_3 = (__pyx_t_1 == cudaChannelFormatKindUnsignedNormalized16X4);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L25_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":642
 *         if (d[0].x != 8):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4,
 */
  __pyx_t_3 = __pyx_t_2;
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":648
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4,):
 *         if (d[0].x != 16):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1,
 */
    __pyx_t_3 = ((__pyx_v_d[0]).x != 16);
    if (__pyx_t_3) {

      /* "cuda/_lib/ccudart/utils.pyx":649
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4,):
 *         if (d[0].x != 16):
 *             return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB,
 */
      __pyx_r = cudaErrorInvalidChannelDescriptor;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":648
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4,):
 *         if (d[0].x != 16):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1,
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":642
 *         if (d[0].x != 8):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4,
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":650
 *         if (d[0].x != 16):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2,
 */
  __pyx_t_1 = (__pyx_v_d[0]).f;
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed1);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":651
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB,
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed1SRGB);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":650
 *         if (d[0].x != 16):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2,
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed2);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":653
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB,
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed2SRGB);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":650
 *         if (d[0].x != 16):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2,
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed3);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":655
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4,
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed3SRGB);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":650
 *         if (d[0].x != 16):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2,
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed4);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":657
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5,
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindSignedBlockCompressed4);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":650
 *         if (d[0].x != 16):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2,
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed5);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":659
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB,):
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindSignedBlockCompressed5);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":650
 *         if (d[0].x != 16):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2,
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed7);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":661
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB,):             # <<<<<<<<<<<<<<
 *         if (d[0].x != 8):
 *             return cudaErrorInvalidChannelDescriptor
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed7SRGB);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L32_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":650
 *         if (d[0].x != 16):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2,
 */
  __pyx_t_2 = __pyx_t_3;
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":662
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB,):
 *         if (d[0].x != 8):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,
 */
    __pyx_t_2 = ((__pyx_v_d[0]).x != 8);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":663
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB,):
 *         if (d[0].x != 8):
 *             return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 */
      __pyx_r = cudaErrorInvalidChannelDescriptor;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":662
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB,):
 *         if (d[0].x != 8):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":650
 *         if (d[0].x != 16):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2,
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":664
 *         if (d[0].x != 8):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 *         if (d[0].x != 16) or (d[0].y != 16) or (d[0].z != 16) or (d[0].w != 0):
 */
  __pyx_t_1 = (__pyx_v_d[0]).f;
  __pyx_t_3 = (__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed6H);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L45_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":665
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):             # <<<<<<<<<<<<<<
 *         if (d[0].x != 16) or (d[0].y != 16) or (d[0].z != 16) or (d[0].w != 0):
 *             return cudaErrorInvalidChannelDescriptor
 */
  __pyx_t_3 = (__pyx_t_1 == cudaChannelFormatKindSignedBlockCompressed6H);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L45_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":664
 *         if (d[0].x != 8):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 *         if (d[0].x != 16) or (d[0].y != 16) or (d[0].z != 16) or (d[0].w != 0):
 */
  __pyx_t_3 = __pyx_t_2;
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":666
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 *         if (d[0].x != 16) or (d[0].y != 16) or (d[0].z != 16) or (d[0].w != 0):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     else:
 */
    __pyx_t_2 = ((__pyx_v_d[0]).x != 16);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L48_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_d[0]).y != 16);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L48_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_d[0]).z != 16);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L48_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_d[0]).w != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L48_bool_binop_done:;
    if (__pyx_t_3) {

      /* "cuda/_lib/ccudart/utils.pyx":667
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 *         if (d[0].x != 16) or (d[0].y != 16) or (d[0].z != 16) or (d[0].w != 0):
 *             return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorInvalidChannelDescriptor
 */
      __pyx_r = cudaErrorInvalidChannelDescriptor;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":666
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 *         if (d[0].x != 16) or (d[0].y != 16) or (d[0].z != 16) or (d[0].w != 0):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     else:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":664
 *         if (d[0].x != 8):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 *         if (d[0].x != 16) or (d[0].y != 16) or (d[0].z != 16) or (d[0].w != 0):
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":669
 *             return cudaErrorInvalidChannelDescriptor
 *     else:
 *         return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 * 
 *     # If Y is non-zero, it must match X
 */
  /*else*/ {
    __pyx_r = cudaErrorInvalidChannelDescriptor;
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "cuda/_lib/ccudart/utils.pyx":674
 *     # If Z is non-zero, it must match Y
 *     # If W is non-zero, it must match Z
 *     if (((d[0].y != 0) and (d[0].y != d[0].x)) or             # <<<<<<<<<<<<<<
 *         ((d[0].z != 0) and (d[0].z != d[0].y)) or
 *         ((d[0].w != 0) and (d[0].w != d[0].z))):
 */
  __pyx_t_2 = ((__pyx_v_d[0]).y != 0);
  if (!__pyx_t_2) {
    goto __pyx_L54_next_or;
  } else {
  }
  __pyx_t_2 = ((__pyx_v_d[0]).y != (__pyx_v_d[0]).x);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L53_bool_binop_done;
  }
  __pyx_L54_next_or:;

  /* "cuda/_lib/ccudart/utils.pyx":675
 *     # If W is non-zero, it must match Z
 *     if (((d[0].y != 0) and (d[0].y != d[0].x)) or
 *         ((d[0].z != 0) and (d[0].z != d[0].y)) or             # <<<<<<<<<<<<<<
 *         ((d[0].w != 0) and (d[0].w != d[0].z))):
 *         return cudaErrorInvalidChannelDescriptor
 */
  __pyx_t_2 = ((__pyx_v_d[0]).z != 0);
  if (!__pyx_t_2) {
    goto __pyx_L56_next_or;
  } else {
  }
  __pyx_t_2 = ((__pyx_v_d[0]).z != (__pyx_v_d[0]).y);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L53_bool_binop_done;
  }
  __pyx_L56_next_or:;

  /* "cuda/_lib/ccudart/utils.pyx":676
 *     if (((d[0].y != 0) and (d[0].y != d[0].x)) or
 *         ((d[0].z != 0) and (d[0].z != d[0].y)) or
 *         ((d[0].w != 0) and (d[0].w != d[0].z))):             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidChannelDescriptor
 *     if case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 */
  __pyx_t_2 = ((__pyx_v_d[0]).w != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L53_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_d[0]).w != (__pyx_v_d[0]).z);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L53_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":674
 *     # If Z is non-zero, it must match Y
 *     # If W is non-zero, it must match Z
 *     if (((d[0].y != 0) and (d[0].y != d[0].x)) or             # <<<<<<<<<<<<<<
 *         ((d[0].z != 0) and (d[0].z != d[0].y)) or
 *         ((d[0].w != 0) and (d[0].w != d[0].z))):
 */
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":677
 *         ((d[0].z != 0) and (d[0].z != d[0].y)) or
 *         ((d[0].w != 0) and (d[0].w != d[0].z))):
 *         return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 *     if case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 1
 */
    __pyx_r = cudaErrorInvalidChannelDescriptor;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":674
 *     # If Z is non-zero, it must match Y
 *     # If W is non-zero, it must match Z
 *     if (((d[0].y != 0) and (d[0].y != d[0].x)) or             # <<<<<<<<<<<<<<
 *         ((d[0].z != 0) and (d[0].z != d[0].y)) or
 *         ((d[0].w != 0) and (d[0].w != d[0].z))):
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":678
 *         ((d[0].w != 0) and (d[0].w != d[0].z))):
 *         return cudaErrorInvalidChannelDescriptor
 *     if case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 0, 0, 0, cudaChannelFormatKindSigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 678, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":679
 *         return cudaErrorInvalidChannelDescriptor
 *     if case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 1             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 */
    (__pyx_v_numberOfChannels[0]) = 1;

    /* "cuda/_lib/ccudart/utils.pyx":680
 *     if case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 2
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_SIGNED_INT8;

    /* "cuda/_lib/ccudart/utils.pyx":678
 *         ((d[0].w != 0) and (d[0].w != d[0].z))):
 *         return cudaErrorInvalidChannelDescriptor
 *     if case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":681
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 0, 0, cudaChannelFormatKindSigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 681, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":682
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 2             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 */
    (__pyx_v_numberOfChannels[0]) = 2;

    /* "cuda/_lib/ccudart/utils.pyx":683
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 3
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_SIGNED_INT8;

    /* "cuda/_lib/ccudart/utils.pyx":681
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":684
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 8, 0, cudaChannelFormatKindSigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 684, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":685
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 3             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 */
    (__pyx_v_numberOfChannels[0]) = 3;

    /* "cuda/_lib/ccudart/utils.pyx":686
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 4
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_SIGNED_INT8;

    /* "cuda/_lib/ccudart/utils.pyx":684
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":687
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 8, 8, cudaChannelFormatKindSigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 687, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":688
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 4             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 */
    (__pyx_v_numberOfChannels[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":689
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 1
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_SIGNED_INT8;

    /* "cuda/_lib/ccudart/utils.pyx":687
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":690
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 0, 0, 0, cudaChannelFormatKindUnsigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 690, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":691
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 1             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 */
    (__pyx_v_numberOfChannels[0]) = 1;

    /* "cuda/_lib/ccudart/utils.pyx":692
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 2
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_UNSIGNED_INT8;

    /* "cuda/_lib/ccudart/utils.pyx":690
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":693
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 0, 0, cudaChannelFormatKindUnsigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 693, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":694
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 2             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 */
    (__pyx_v_numberOfChannels[0]) = 2;

    /* "cuda/_lib/ccudart/utils.pyx":695
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 3
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_UNSIGNED_INT8;

    /* "cuda/_lib/ccudart/utils.pyx":693
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":696
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 8, 0, cudaChannelFormatKindUnsigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 696, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":697
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 3             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 */
    (__pyx_v_numberOfChannels[0]) = 3;

    /* "cuda/_lib/ccudart/utils.pyx":698
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 4
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_UNSIGNED_INT8;

    /* "cuda/_lib/ccudart/utils.pyx":696
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":699
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 8, 8, cudaChannelFormatKindUnsigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 699, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":700
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 4             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 */
    (__pyx_v_numberOfChannels[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":701
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 1
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_UNSIGNED_INT8;

    /* "cuda/_lib/ccudart/utils.pyx":699
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":702
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 16, 0, 0, 0, cudaChannelFormatKindSigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 702, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":703
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 1             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 */
    (__pyx_v_numberOfChannels[0]) = 1;

    /* "cuda/_lib/ccudart/utils.pyx":704
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 2
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_SIGNED_INT16;

    /* "cuda/_lib/ccudart/utils.pyx":702
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":705
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 16, 16, 0, 0, cudaChannelFormatKindSigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 705, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":706
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 2             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 */
    (__pyx_v_numberOfChannels[0]) = 2;

    /* "cuda/_lib/ccudart/utils.pyx":707
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 3
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_SIGNED_INT16;

    /* "cuda/_lib/ccudart/utils.pyx":705
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":708
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 16, 16, 16, 0, cudaChannelFormatKindSigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 708, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":709
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 3             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 */
    (__pyx_v_numberOfChannels[0]) = 3;

    /* "cuda/_lib/ccudart/utils.pyx":710
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 4
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_SIGNED_INT16;

    /* "cuda/_lib/ccudart/utils.pyx":708
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":711
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 16, 16, 16, 16, cudaChannelFormatKindSigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 711, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":712
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 4             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 */
    (__pyx_v_numberOfChannels[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":713
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 1
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_SIGNED_INT16;

    /* "cuda/_lib/ccudart/utils.pyx":711
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":714
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 16, 0, 0, 0, cudaChannelFormatKindUnsigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 714, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":715
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 1             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 */
    (__pyx_v_numberOfChannels[0]) = 1;

    /* "cuda/_lib/ccudart/utils.pyx":716
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 2
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_UNSIGNED_INT16;

    /* "cuda/_lib/ccudart/utils.pyx":714
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":717
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 16, 16, 0, 0, cudaChannelFormatKindUnsigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 717, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":718
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 2             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 */
    (__pyx_v_numberOfChannels[0]) = 2;

    /* "cuda/_lib/ccudart/utils.pyx":719
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 3
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_UNSIGNED_INT16;

    /* "cuda/_lib/ccudart/utils.pyx":717
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":720
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 16, 16, 16, 0, cudaChannelFormatKindUnsigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 720, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":721
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 3             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 */
    (__pyx_v_numberOfChannels[0]) = 3;

    /* "cuda/_lib/ccudart/utils.pyx":722
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 4
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_UNSIGNED_INT16;

    /* "cuda/_lib/ccudart/utils.pyx":720
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":723
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 16, 16, 16, 16, cudaChannelFormatKindUnsigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 723, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":724
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 4             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 */
    (__pyx_v_numberOfChannels[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":725
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 1
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_UNSIGNED_INT16;

    /* "cuda/_lib/ccudart/utils.pyx":723
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":726
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 32, 0, 0, 0, cudaChannelFormatKindSigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 726, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":727
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 1             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 */
    (__pyx_v_numberOfChannels[0]) = 1;

    /* "cuda/_lib/ccudart/utils.pyx":728
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 2
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_SIGNED_INT32;

    /* "cuda/_lib/ccudart/utils.pyx":726
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":729
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 32, 32, 0, 0, cudaChannelFormatKindSigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 729, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":730
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 2             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 */
    (__pyx_v_numberOfChannels[0]) = 2;

    /* "cuda/_lib/ccudart/utils.pyx":731
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 3
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_SIGNED_INT32;

    /* "cuda/_lib/ccudart/utils.pyx":729
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":732
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 32, 32, 32, 0, cudaChannelFormatKindSigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 732, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":733
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 3             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 */
    (__pyx_v_numberOfChannels[0]) = 3;

    /* "cuda/_lib/ccudart/utils.pyx":734
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 4
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_SIGNED_INT32;

    /* "cuda/_lib/ccudart/utils.pyx":732
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":735
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 32, 32, 32, 32, cudaChannelFormatKindSigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 735, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":736
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 4             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 */
    (__pyx_v_numberOfChannels[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":737
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindSigned):
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 1
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_SIGNED_INT32;

    /* "cuda/_lib/ccudart/utils.pyx":735
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindSigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":738
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 32, 0, 0, 0, cudaChannelFormatKindUnsigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 738, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":739
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 1             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 */
    (__pyx_v_numberOfChannels[0]) = 1;

    /* "cuda/_lib/ccudart/utils.pyx":740
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 2
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_UNSIGNED_INT32;

    /* "cuda/_lib/ccudart/utils.pyx":738
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":741
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 32, 32, 0, 0, cudaChannelFormatKindUnsigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 741, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":742
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 2             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 */
    (__pyx_v_numberOfChannels[0]) = 2;

    /* "cuda/_lib/ccudart/utils.pyx":743
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 3
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_UNSIGNED_INT32;

    /* "cuda/_lib/ccudart/utils.pyx":741
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":744
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 32, 32, 32, 0, cudaChannelFormatKindUnsigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 744, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":745
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 3             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 */
    (__pyx_v_numberOfChannels[0]) = 3;

    /* "cuda/_lib/ccudart/utils.pyx":746
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 4
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_UNSIGNED_INT32;

    /* "cuda/_lib/ccudart/utils.pyx":744
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":747
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 32, 32, 32, 32, cudaChannelFormatKindUnsigned); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 747, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":748
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 4             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 */
    (__pyx_v_numberOfChannels[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":749
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 1
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_UNSIGNED_INT32;

    /* "cuda/_lib/ccudart/utils.pyx":747
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindUnsigned):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":750
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 16, 0, 0, 0, cudaChannelFormatKindFloat); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 750, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":751
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 1             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 */
    (__pyx_v_numberOfChannels[0]) = 1;

    /* "cuda/_lib/ccudart/utils.pyx":752
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 2
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_HALF;

    /* "cuda/_lib/ccudart/utils.pyx":750
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32
 *     elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":753
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 16, 16, 0, 0, cudaChannelFormatKindFloat); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 753, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":754
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 2             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 */
    (__pyx_v_numberOfChannels[0]) = 2;

    /* "cuda/_lib/ccudart/utils.pyx":755
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 3
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_HALF;

    /* "cuda/_lib/ccudart/utils.pyx":753
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 *     elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":756
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 16, 16, 16, 0, cudaChannelFormatKindFloat); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 756, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":757
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 3             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 */
    (__pyx_v_numberOfChannels[0]) = 3;

    /* "cuda/_lib/ccudart/utils.pyx":758
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 4
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_HALF;

    /* "cuda/_lib/ccudart/utils.pyx":756
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":759
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindFloat):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 16, 16, 16, 16, cudaChannelFormatKindFloat); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 759, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":760
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 4             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 */
    (__pyx_v_numberOfChannels[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":761
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 1
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_HALF;

    /* "cuda/_lib/ccudart/utils.pyx":759
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 *     elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindFloat):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":762
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 32, 0, 0, 0, cudaChannelFormatKindFloat); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 762, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":763
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 1             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 */
    (__pyx_v_numberOfChannels[0]) = 1;

    /* "cuda/_lib/ccudart/utils.pyx":764
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 2
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_FLOAT;

    /* "cuda/_lib/ccudart/utils.pyx":762
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_HALF
 *     elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":765
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 32, 32, 0, 0, cudaChannelFormatKindFloat); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 765, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":766
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 2             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 */
    (__pyx_v_numberOfChannels[0]) = 2;

    /* "cuda/_lib/ccudart/utils.pyx":767
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 3
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_FLOAT;

    /* "cuda/_lib/ccudart/utils.pyx":765
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 *     elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":768
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 32, 32, 32, 0, cudaChannelFormatKindFloat); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 768, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":769
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 3             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 */
    (__pyx_v_numberOfChannels[0]) = 3;

    /* "cuda/_lib/ccudart/utils.pyx":770
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 4
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_FLOAT;

    /* "cuda/_lib/ccudart/utils.pyx":768
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 *     elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":771
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindFloat):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 32, 32, 32, 32, cudaChannelFormatKindFloat); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 771, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":772
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 4             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindNV12):
 */
    (__pyx_v_numberOfChannels[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":773
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindFloat):
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindNV12):
 *         numberOfChannels[0] = 3
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_FLOAT;

    /* "cuda/_lib/ccudart/utils.pyx":771
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 *     elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindFloat):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":774
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindNV12):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_NV12
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 8, 0, cudaChannelFormatKindNV12); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 774, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":775
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindNV12):
 *         numberOfChannels[0] = 3             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_NV12
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1):
 */
    (__pyx_v_numberOfChannels[0]) = 3;

    /* "cuda/_lib/ccudart/utils.pyx":776
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindNV12):
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_NV12             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1):
 *         numberOfChannels[0] = 4
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_NV12;

    /* "cuda/_lib/ccudart/utils.pyx":774
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_FLOAT
 *     elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindNV12):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_NV12
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":777
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_NV12
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 8, 8, cudaChannelFormatKindUnsignedBlockCompressed1); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 777, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":778
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_NV12
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1):
 *         numberOfChannels[0] = 4             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB):
 */
    (__pyx_v_numberOfChannels[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":779
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1):
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB):
 *         numberOfChannels[0] = 4
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_BC1_UNORM;

    /* "cuda/_lib/ccudart/utils.pyx":777
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_NV12
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":780
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM_SRGB
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 8, 8, cudaChannelFormatKindUnsignedBlockCompressed1SRGB); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 780, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":781
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB):
 *         numberOfChannels[0] = 4             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM_SRGB
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2):
 */
    (__pyx_v_numberOfChannels[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":782
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB):
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM_SRGB             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2):
 *         numberOfChannels[0] = 4
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_BC1_UNORM_SRGB;

    /* "cuda/_lib/ccudart/utils.pyx":780
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM_SRGB
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":783
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM_SRGB
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 8, 8, cudaChannelFormatKindUnsignedBlockCompressed2); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 783, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":784
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM_SRGB
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2):
 *         numberOfChannels[0] = 4             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB):
 */
    (__pyx_v_numberOfChannels[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":785
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2):
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB):
 *         numberOfChannels[0] = 4
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_BC2_UNORM;

    /* "cuda/_lib/ccudart/utils.pyx":783
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM_SRGB
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":786
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM_SRGB
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 8, 8, cudaChannelFormatKindUnsignedBlockCompressed2SRGB); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 786, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":787
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB):
 *         numberOfChannels[0] = 4             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM_SRGB
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3):
 */
    (__pyx_v_numberOfChannels[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":788
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB):
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM_SRGB             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3):
 *         numberOfChannels[0] = 4
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_BC2_UNORM_SRGB;

    /* "cuda/_lib/ccudart/utils.pyx":786
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM_SRGB
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":789
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM_SRGB
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 8, 8, cudaChannelFormatKindUnsignedBlockCompressed3); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 789, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":790
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM_SRGB
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3):
 *         numberOfChannels[0] = 4             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB):
 */
    (__pyx_v_numberOfChannels[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":791
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3):
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB):
 *         numberOfChannels[0] = 4
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_BC3_UNORM;

    /* "cuda/_lib/ccudart/utils.pyx":789
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM_SRGB
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":792
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM_SRGB
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 8, 8, cudaChannelFormatKindUnsignedBlockCompressed3SRGB); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 792, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":793
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB):
 *         numberOfChannels[0] = 4             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM_SRGB
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4):
 */
    (__pyx_v_numberOfChannels[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":794
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB):
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM_SRGB             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4):
 *         numberOfChannels[0] = 1
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_BC3_UNORM_SRGB;

    /* "cuda/_lib/ccudart/utils.pyx":792
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM_SRGB
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":795
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM_SRGB
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC4_UNORM
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 0, 0, 0, cudaChannelFormatKindUnsignedBlockCompressed4); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 795, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":796
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM_SRGB
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4):
 *         numberOfChannels[0] = 1             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC4_UNORM
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4):
 */
    (__pyx_v_numberOfChannels[0]) = 1;

    /* "cuda/_lib/ccudart/utils.pyx":797
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4):
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC4_UNORM             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4):
 *         numberOfChannels[0] = 1
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_BC4_UNORM;

    /* "cuda/_lib/ccudart/utils.pyx":795
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM_SRGB
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC4_UNORM
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":798
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC4_UNORM
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC4_SNORM
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 0, 0, 0, cudaChannelFormatKindSignedBlockCompressed4); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 798, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":799
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC4_UNORM
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4):
 *         numberOfChannels[0] = 1             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC4_SNORM
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5):
 */
    (__pyx_v_numberOfChannels[0]) = 1;

    /* "cuda/_lib/ccudart/utils.pyx":800
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4):
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC4_SNORM             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5):
 *         numberOfChannels[0] = 2
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_BC4_SNORM;

    /* "cuda/_lib/ccudart/utils.pyx":798
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC4_UNORM
 *     elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC4_SNORM
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":801
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC4_SNORM
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC5_UNORM
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 0, 0, cudaChannelFormatKindUnsignedBlockCompressed5); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 801, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":802
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC4_SNORM
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5):
 *         numberOfChannels[0] = 2             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC5_UNORM
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5):
 */
    (__pyx_v_numberOfChannels[0]) = 2;

    /* "cuda/_lib/ccudart/utils.pyx":803
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5):
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC5_UNORM             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5):
 *         numberOfChannels[0] = 2
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_BC5_UNORM;

    /* "cuda/_lib/ccudart/utils.pyx":801
 *         numberOfChannels[0] = 1
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC4_SNORM
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC5_UNORM
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":804
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC5_UNORM
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC5_SNORM
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 0, 0, cudaChannelFormatKindSignedBlockCompressed5); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 804, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":805
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC5_UNORM
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5):
 *         numberOfChannels[0] = 2             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC5_SNORM
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H):
 */
    (__pyx_v_numberOfChannels[0]) = 2;

    /* "cuda/_lib/ccudart/utils.pyx":806
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5):
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC5_SNORM             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H):
 *         numberOfChannels[0] = 3
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_BC5_SNORM;

    /* "cuda/_lib/ccudart/utils.pyx":804
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC5_UNORM
 *     elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC5_SNORM
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":807
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC5_SNORM
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC6H_UF16
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 16, 16, 16, 0, cudaChannelFormatKindUnsignedBlockCompressed6H); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 807, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":808
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC5_SNORM
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H):
 *         numberOfChannels[0] = 3             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC6H_UF16
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H):
 */
    (__pyx_v_numberOfChannels[0]) = 3;

    /* "cuda/_lib/ccudart/utils.pyx":809
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H):
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC6H_UF16             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H):
 *         numberOfChannels[0] = 3
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_BC6H_UF16;

    /* "cuda/_lib/ccudart/utils.pyx":807
 *         numberOfChannels[0] = 2
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC5_SNORM
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC6H_UF16
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":810
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC6H_UF16
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC6H_SF16
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 16, 16, 16, 0, cudaChannelFormatKindSignedBlockCompressed6H); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 810, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":811
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC6H_UF16
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H):
 *         numberOfChannels[0] = 3             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC6H_SF16
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7):
 */
    (__pyx_v_numberOfChannels[0]) = 3;

    /* "cuda/_lib/ccudart/utils.pyx":812
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H):
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC6H_SF16             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7):
 *         numberOfChannels[0] = 4
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_BC6H_SF16;

    /* "cuda/_lib/ccudart/utils.pyx":810
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC6H_UF16
 *     elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC6H_SF16
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":813
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC6H_SF16
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 8, 8, cudaChannelFormatKindUnsignedBlockCompressed7); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 813, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":814
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC6H_SF16
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7):
 *         numberOfChannels[0] = 4             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB):
 */
    (__pyx_v_numberOfChannels[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":815
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7):
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM             # <<<<<<<<<<<<<<
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB):
 *         numberOfChannels[0] = 4
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_BC7_UNORM;

    /* "cuda/_lib/ccudart/utils.pyx":813
 *         numberOfChannels[0] = 3
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC6H_SF16
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":816
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM_SRGB
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_case_desc(__pyx_v_d, 8, 8, 8, 8, cudaChannelFormatKindUnsignedBlockCompressed7SRGB); if (unlikely(__pyx_t_4 == ((int)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 816, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":817
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB):
 *         numberOfChannels[0] = 4             # <<<<<<<<<<<<<<
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM_SRGB
 *     else:
 */
    (__pyx_v_numberOfChannels[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":818
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB):
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM_SRGB             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorInvalidChannelDescriptor
 */
    (__pyx_v_format[0]) = CU_AD_FORMAT_BC7_UNORM_SRGB;

    /* "cuda/_lib/ccudart/utils.pyx":816
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM
 *     elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB):             # <<<<<<<<<<<<<<
 *         numberOfChannels[0] = 4
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM_SRGB
 */
    goto __pyx_L59;
  }

  /* "cuda/_lib/ccudart/utils.pyx":820
 *         format[0] = ccuda.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM_SRGB
 *     else:
 *         return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 * 
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,
 */
  /*else*/ {
    __pyx_r = cudaErrorInvalidChannelDescriptor;
    goto __pyx_L0;
  }
  __pyx_L59:;

  /* "cuda/_lib/ccudart/utils.pyx":822
 *         return cudaErrorInvalidChannelDescriptor
 * 
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,             # <<<<<<<<<<<<<<
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,
 *                   cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 */
  __pyx_t_1 = (__pyx_v_d[0]).f;
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindNV12);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L61_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":823
 * 
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,             # <<<<<<<<<<<<<<
 *                   cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 *         if numberOfChannels[0] != 3:
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed6H);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L61_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":822
 *         return cudaErrorInvalidChannelDescriptor
 * 
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,             # <<<<<<<<<<<<<<
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,
 *                   cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 */
  __pyx_t_2 = (__pyx_t_1 == cudaChannelFormatKindSignedBlockCompressed6H);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L61_bool_binop_done:;
  __pyx_t_2 = __pyx_t_3;
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":825
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,
 *                   cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 *         if numberOfChannels[0] != 3:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     else:
 */
    __pyx_t_2 = ((__pyx_v_numberOfChannels[0]) != 3);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":826
 *                   cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 *         if numberOfChannels[0] != 3:
 *             return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 *     else:
 *         if (numberOfChannels[0] != 1) and (numberOfChannels[0] != 2) and (numberOfChannels[0] != 4):
 */
      __pyx_r = cudaErrorInvalidChannelDescriptor;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":825
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,
 *                   cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 *         if numberOfChannels[0] != 3:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     else:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":822
 *         return cudaErrorInvalidChannelDescriptor
 * 
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,             # <<<<<<<<<<<<<<
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,
 *                   cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 */
    goto __pyx_L60;
  }

  /* "cuda/_lib/ccudart/utils.pyx":828
 *             return cudaErrorInvalidChannelDescriptor
 *     else:
 *         if (numberOfChannels[0] != 1) and (numberOfChannels[0] != 2) and (numberOfChannels[0] != 4):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     return cudaSuccess
 */
  /*else*/ {
    __pyx_t_3 = ((__pyx_v_numberOfChannels[0]) != 1);
    if (__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L66_bool_binop_done;
    }
    __pyx_t_3 = ((__pyx_v_numberOfChannels[0]) != 2);
    if (__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L66_bool_binop_done;
    }
    __pyx_t_3 = ((__pyx_v_numberOfChannels[0]) != 4);
    __pyx_t_2 = __pyx_t_3;
    __pyx_L66_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":829
 *     else:
 *         if (numberOfChannels[0] != 1) and (numberOfChannels[0] != 2) and (numberOfChannels[0] != 4):
 *             return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
      __pyx_r = cudaErrorInvalidChannelDescriptor;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":828
 *             return cudaErrorInvalidChannelDescriptor
 *     else:
 *         if (numberOfChannels[0] != 1) and (numberOfChannels[0] != 2) and (numberOfChannels[0] != 4):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     return cudaSuccess
 */
    }
  }
  __pyx_L60:;

  /* "cuda/_lib/ccudart/utils.pyx":830
 *         if (numberOfChannels[0] != 1) and (numberOfChannels[0] != 2) and (numberOfChannels[0] != 4):
 *             return cudaErrorInvalidChannelDescriptor
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":622
 * 
 * 
 * cdef cudaError_t getDescInfo(const cudaChannelFormatDesc* d, int *numberOfChannels, ccuda.CUarray_format *format) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     # Check validity
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSigned,
 */

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

/* "cuda/_lib/ccudart/utils.pyx":834
 * 
 * @cython.show_performance_hints(False)
 * cdef void cudaStreamRtCallbackWrapper(ccuda.CUstream stream, ccuda.CUresult status, void *data) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaStreamCallbackData *cbData = <cudaStreamCallbackData *>data
 *     cdef cudaError_t err = <cudaError_t>status
 */

static void __pyx_f_4cuda_4_lib_7ccudart_5utils_cudaStreamRtCallbackWrapper(CUstream __pyx_v_stream, CUresult __pyx_v_status, void *__pyx_v_data) {
  __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamCallbackData *__pyx_v_cbData;
  cudaError_t __pyx_v_err;
  __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("cudaStreamRtCallbackWrapper", __pyx_f[0], 834, 1, __PYX_ERR(0, 834, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":835
 * @cython.show_performance_hints(False)
 * cdef void cudaStreamRtCallbackWrapper(ccuda.CUstream stream, ccuda.CUresult status, void *data) nogil:
 *     cdef cudaStreamCallbackData *cbData = <cudaStreamCallbackData *>data             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = <cudaError_t>status
 *     with gil:
 */
  __pyx_v_cbData = ((__pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamCallbackData *)__pyx_v_data);

  /* "cuda/_lib/ccudart/utils.pyx":836
 * cdef void cudaStreamRtCallbackWrapper(ccuda.CUstream stream, ccuda.CUresult status, void *data) nogil:
 *     cdef cudaStreamCallbackData *cbData = <cudaStreamCallbackData *>data
 *     cdef cudaError_t err = <cudaError_t>status             # <<<<<<<<<<<<<<
 *     with gil:
 *         cbData.callback(stream, err, cbData.userData)
 */
  __pyx_v_err = ((cudaError_t)__pyx_v_status);

  /* "cuda/_lib/ccudart/utils.pyx":837
 *     cdef cudaStreamCallbackData *cbData = <cudaStreamCallbackData *>data
 *     cdef cudaError_t err = <cudaError_t>status
 *     with gil:             # <<<<<<<<<<<<<<
 *         cbData.callback(stream, err, cbData.userData)
 *     free(cbData)
 */
  {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      /*try:*/ {

        /* "cuda/_lib/ccudart/utils.pyx":838
 *     cdef cudaError_t err = <cudaError_t>status
 *     with gil:
 *         cbData.callback(stream, err, cbData.userData)             # <<<<<<<<<<<<<<
 *     free(cbData)
 * 
 */
        __pyx_v_cbData->callback(__pyx_v_stream, __pyx_v_err, __pyx_v_cbData->userData);
      }

      /* "cuda/_lib/ccudart/utils.pyx":837
 *     cdef cudaStreamCallbackData *cbData = <cudaStreamCallbackData *>data
 *     cdef cudaError_t err = <cudaError_t>status
 *     with gil:             # <<<<<<<<<<<<<<
 *         cbData.callback(stream, err, cbData.userData)
 *     free(cbData)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cuda/_lib/ccudart/utils.pyx":839
 *     with gil:
 *         cbData.callback(stream, err, cbData.userData)
 *     free(cbData)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  free(__pyx_v_cbData);

  /* "cuda/_lib/ccudart/utils.pyx":834
 * 
 * @cython.show_performance_hints(False)
 * cdef void cudaStreamRtCallbackWrapper(ccuda.CUstream stream, ccuda.CUresult status, void *data) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaStreamCallbackData *cbData = <cudaStreamCallbackData *>data
 *     cdef cudaError_t err = <cudaError_t>status
 */

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

/* "cuda/_lib/ccudart/utils.pyx":842
 * 
 * 
 * cdef cudaError_t streamAddCallbackCommon(             # <<<<<<<<<<<<<<
 *   cudaStream_t stream,
 *   cudaStreamCallback_t callback,
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_streamAddCallbackCommon(cudaStream_t __pyx_v_stream, cudaStreamCallback_t __pyx_v_callback, void *__pyx_v_userData, unsigned int __pyx_v_flags) {
  __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamCallbackData *__pyx_v_cbData;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  CUresult __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("streamAddCallbackCommon", __pyx_f[0], 842, 1, __PYX_ERR(0, 842, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":848
 *   unsigned int flags
 * ) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if callback == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_1 = (__pyx_v_callback == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":849
 * ) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if callback == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaStreamCallbackData *cbData = NULL
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":848
 *   unsigned int flags
 * ) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if callback == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":851
 *         return cudaErrorInvalidValue
 * 
 *     cdef cudaStreamCallbackData *cbData = NULL             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cbData = <cudaStreamCallbackData *>malloc(sizeof(cbData[0]))
 */
  __pyx_v_cbData = NULL;

  /* "cuda/_lib/ccudart/utils.pyx":852
 * 
 *     cdef cudaStreamCallbackData *cbData = NULL
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cbData = <cudaStreamCallbackData *>malloc(sizeof(cbData[0]))
 * 
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":853
 *     cdef cudaStreamCallbackData *cbData = NULL
 *     cdef cudaError_t err = cudaSuccess
 *     cbData = <cudaStreamCallbackData *>malloc(sizeof(cbData[0]))             # <<<<<<<<<<<<<<
 * 
 *     if cbData == NULL:
 */
  __pyx_v_cbData = ((__pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamCallbackData *)malloc((sizeof((__pyx_v_cbData[0])))));

  /* "cuda/_lib/ccudart/utils.pyx":855
 *     cbData = <cudaStreamCallbackData *>malloc(sizeof(cbData[0]))
 * 
 *     if cbData == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorMemoryAllocation
 * 
 */
  __pyx_t_1 = (__pyx_v_cbData == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":856
 * 
 *     if cbData == NULL:
 *         return cudaErrorMemoryAllocation             # <<<<<<<<<<<<<<
 * 
 *     cbData.callback = callback
 */
    __pyx_r = cudaErrorMemoryAllocation;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":855
 *     cbData = <cudaStreamCallbackData *>malloc(sizeof(cbData[0]))
 * 
 *     if cbData == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorMemoryAllocation
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":858
 *         return cudaErrorMemoryAllocation
 * 
 *     cbData.callback = callback             # <<<<<<<<<<<<<<
 *     cbData.userData = userData
 *     err = <cudaError_t>ccuda._cuStreamAddCallback(stream, <ccuda.CUstreamCallback>cudaStreamRtCallbackWrapper, <void *>cbData, flags)
 */
  __pyx_v_cbData->callback = __pyx_v_callback;

  /* "cuda/_lib/ccudart/utils.pyx":859
 * 
 *     cbData.callback = callback
 *     cbData.userData = userData             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuStreamAddCallback(stream, <ccuda.CUstreamCallback>cudaStreamRtCallbackWrapper, <void *>cbData, flags)
 *     if err != cudaSuccess:
 */
  __pyx_v_cbData->userData = __pyx_v_userData;

  /* "cuda/_lib/ccudart/utils.pyx":860
 *     cbData.callback = callback
 *     cbData.userData = userData
 *     err = <cudaError_t>ccuda._cuStreamAddCallback(stream, <ccuda.CUstreamCallback>cudaStreamRtCallbackWrapper, <void *>cbData, flags)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         free(cbData)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamAddCallback(__pyx_v_stream, ((CUstreamCallback)__pyx_f_4cuda_4_lib_7ccudart_5utils_cudaStreamRtCallbackWrapper), ((void *)__pyx_v_cbData), __pyx_v_flags); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 860, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/utils.pyx":861
 *     cbData.userData = userData
 *     err = <cudaError_t>ccuda._cuStreamAddCallback(stream, <ccuda.CUstreamCallback>cudaStreamRtCallbackWrapper, <void *>cbData, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         free(cbData)
 *     return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":862
 *     err = <cudaError_t>ccuda._cuStreamAddCallback(stream, <ccuda.CUstreamCallback>cudaStreamRtCallbackWrapper, <void *>cbData, flags)
 *     if err != cudaSuccess:
 *         free(cbData)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    free(__pyx_v_cbData);

    /* "cuda/_lib/ccudart/utils.pyx":861
 *     cbData.userData = userData
 *     err = <cudaError_t>ccuda._cuStreamAddCallback(stream, <ccuda.CUstreamCallback>cudaStreamRtCallbackWrapper, <void *>cbData, flags)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         free(cbData)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/utils.pyx":842
 * 
 * 
 * cdef cudaError_t streamAddCallbackCommon(             # <<<<<<<<<<<<<<
 *   cudaStream_t stream,
 *   cudaStreamCallback_t callback,
 */

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

/* "cuda/_lib/ccudart/utils.pyx":867
 * 
 * @cython.show_performance_hints(False)
 * cdef void cudaStreamRtHostCallbackWrapper(void *data) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaStreamHostCallbackData *cbData = <cudaStreamHostCallbackData *>data
 *     with gil:
 */

static void __pyx_f_4cuda_4_lib_7ccudart_5utils_cudaStreamRtHostCallbackWrapper(void *__pyx_v_data) {
  __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamHostCallbackData *__pyx_v_cbData;
  __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("cudaStreamRtHostCallbackWrapper", __pyx_f[0], 867, 1, __PYX_ERR(0, 867, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":868
 * @cython.show_performance_hints(False)
 * cdef void cudaStreamRtHostCallbackWrapper(void *data) nogil:
 *     cdef cudaStreamHostCallbackData *cbData = <cudaStreamHostCallbackData *>data             # <<<<<<<<<<<<<<
 *     with gil:
 *         cbData.callback(cbData.userData)
 */
  __pyx_v_cbData = ((__pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamHostCallbackData *)__pyx_v_data);

  /* "cuda/_lib/ccudart/utils.pyx":869
 * cdef void cudaStreamRtHostCallbackWrapper(void *data) nogil:
 *     cdef cudaStreamHostCallbackData *cbData = <cudaStreamHostCallbackData *>data
 *     with gil:             # <<<<<<<<<<<<<<
 *         cbData.callback(cbData.userData)
 *     free(cbData)
 */
  {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      /*try:*/ {

        /* "cuda/_lib/ccudart/utils.pyx":870
 *     cdef cudaStreamHostCallbackData *cbData = <cudaStreamHostCallbackData *>data
 *     with gil:
 *         cbData.callback(cbData.userData)             # <<<<<<<<<<<<<<
 *     free(cbData)
 * 
 */
        __pyx_v_cbData->callback(__pyx_v_cbData->userData);
      }

      /* "cuda/_lib/ccudart/utils.pyx":869
 * cdef void cudaStreamRtHostCallbackWrapper(void *data) nogil:
 *     cdef cudaStreamHostCallbackData *cbData = <cudaStreamHostCallbackData *>data
 *     with gil:             # <<<<<<<<<<<<<<
 *         cbData.callback(cbData.userData)
 *     free(cbData)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cuda/_lib/ccudart/utils.pyx":871
 *     with gil:
 *         cbData.callback(cbData.userData)
 *     free(cbData)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  free(__pyx_v_cbData);

  /* "cuda/_lib/ccudart/utils.pyx":867
 * 
 * @cython.show_performance_hints(False)
 * cdef void cudaStreamRtHostCallbackWrapper(void *data) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaStreamHostCallbackData *cbData = <cudaStreamHostCallbackData *>data
 *     with gil:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":874
 * 
 * 
 * cdef cudaError_t streamAddHostCallbackCommon(             # <<<<<<<<<<<<<<
 *   cudaStream_t stream,
 *   cudaHostFn_t callback,
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_streamAddHostCallbackCommon(cudaStream_t __pyx_v_stream, cudaHostFn_t __pyx_v_callback, void *__pyx_v_userData) {
  __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamHostCallbackData *__pyx_v_cbData;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  CUresult __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("streamAddHostCallbackCommon", __pyx_f[0], 874, 1, __PYX_ERR(0, 874, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":879
 *   void *userData
 * ) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if callback == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_1 = (__pyx_v_callback == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":880
 * ) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if callback == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaStreamHostCallbackData *cbData = NULL
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":879
 *   void *userData
 * ) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if callback == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":882
 *         return cudaErrorInvalidValue
 * 
 *     cdef cudaStreamHostCallbackData *cbData = NULL             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cbData = <cudaStreamHostCallbackData *>malloc(sizeof(cbData[0]))
 */
  __pyx_v_cbData = NULL;

  /* "cuda/_lib/ccudart/utils.pyx":883
 * 
 *     cdef cudaStreamHostCallbackData *cbData = NULL
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cbData = <cudaStreamHostCallbackData *>malloc(sizeof(cbData[0]))
 * 
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":884
 *     cdef cudaStreamHostCallbackData *cbData = NULL
 *     cdef cudaError_t err = cudaSuccess
 *     cbData = <cudaStreamHostCallbackData *>malloc(sizeof(cbData[0]))             # <<<<<<<<<<<<<<
 * 
 *     if cbData == NULL:
 */
  __pyx_v_cbData = ((__pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamHostCallbackData *)malloc((sizeof((__pyx_v_cbData[0])))));

  /* "cuda/_lib/ccudart/utils.pyx":886
 *     cbData = <cudaStreamHostCallbackData *>malloc(sizeof(cbData[0]))
 * 
 *     if cbData == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorMemoryAllocation
 * 
 */
  __pyx_t_1 = (__pyx_v_cbData == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":887
 * 
 *     if cbData == NULL:
 *         return cudaErrorMemoryAllocation             # <<<<<<<<<<<<<<
 * 
 *     cbData.callback = callback
 */
    __pyx_r = cudaErrorMemoryAllocation;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":886
 *     cbData = <cudaStreamHostCallbackData *>malloc(sizeof(cbData[0]))
 * 
 *     if cbData == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorMemoryAllocation
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":889
 *         return cudaErrorMemoryAllocation
 * 
 *     cbData.callback = callback             # <<<<<<<<<<<<<<
 *     cbData.userData = userData
 *     err = <cudaError_t>ccuda._cuLaunchHostFunc(<ccuda.CUstream>stream, <ccuda.CUhostFn>cudaStreamRtHostCallbackWrapper, <void *>cbData)
 */
  __pyx_v_cbData->callback = __pyx_v_callback;

  /* "cuda/_lib/ccudart/utils.pyx":890
 * 
 *     cbData.callback = callback
 *     cbData.userData = userData             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuLaunchHostFunc(<ccuda.CUstream>stream, <ccuda.CUhostFn>cudaStreamRtHostCallbackWrapper, <void *>cbData)
 *     if err != cudaSuccess:
 */
  __pyx_v_cbData->userData = __pyx_v_userData;

  /* "cuda/_lib/ccudart/utils.pyx":891
 *     cbData.callback = callback
 *     cbData.userData = userData
 *     err = <cudaError_t>ccuda._cuLaunchHostFunc(<ccuda.CUstream>stream, <ccuda.CUhostFn>cudaStreamRtHostCallbackWrapper, <void *>cbData)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         free(cbData)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuLaunchHostFunc(((CUstream)__pyx_v_stream), ((CUhostFn)__pyx_f_4cuda_4_lib_7ccudart_5utils_cudaStreamRtHostCallbackWrapper), ((void *)__pyx_v_cbData)); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 891, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/utils.pyx":892
 *     cbData.userData = userData
 *     err = <cudaError_t>ccuda._cuLaunchHostFunc(<ccuda.CUstream>stream, <ccuda.CUhostFn>cudaStreamRtHostCallbackWrapper, <void *>cbData)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         free(cbData)
 *     return err
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":893
 *     err = <cudaError_t>ccuda._cuLaunchHostFunc(<ccuda.CUstream>stream, <ccuda.CUhostFn>cudaStreamRtHostCallbackWrapper, <void *>cbData)
 *     if err != cudaSuccess:
 *         free(cbData)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    free(__pyx_v_cbData);

    /* "cuda/_lib/ccudart/utils.pyx":892
 *     cbData.userData = userData
 *     err = <cudaError_t>ccuda._cuLaunchHostFunc(<ccuda.CUstream>stream, <ccuda.CUhostFn>cudaStreamRtHostCallbackWrapper, <void *>cbData)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         free(cbData)
 *     return err
 */
  }

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

  /* "cuda/_lib/ccudart/utils.pyx":874
 * 
 * 
 * cdef cudaError_t streamAddHostCallbackCommon(             # <<<<<<<<<<<<<<
 *   cudaStream_t stream,
 *   cudaHostFn_t callback,
 */

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

/* "cuda/_lib/ccudart/utils.pyx":897
 * 
 * 
 * cdef cudaError_t toRuntimeStreamCaptureStatus(ccuda.CUstreamCaptureStatus driverCaptureStatus, cudaStreamCaptureStatus *runtimeStatus) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_NONE:
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusNone
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_toRuntimeStreamCaptureStatus(CUstreamCaptureStatus __pyx_v_driverCaptureStatus, enum cudaStreamCaptureStatus *__pyx_v_runtimeStatus) {
  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("toRuntimeStreamCaptureStatus", __pyx_f[0], 897, 1, __PYX_ERR(0, 897, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":898
 * 
 * cdef cudaError_t toRuntimeStreamCaptureStatus(ccuda.CUstreamCaptureStatus driverCaptureStatus, cudaStreamCaptureStatus *runtimeStatus) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_NONE:             # <<<<<<<<<<<<<<
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusNone
 *     elif driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_ACTIVE:
 */
  switch (__pyx_v_driverCaptureStatus) {
    case CU_STREAM_CAPTURE_STATUS_NONE:

    /* "cuda/_lib/ccudart/utils.pyx":899
 * cdef cudaError_t toRuntimeStreamCaptureStatus(ccuda.CUstreamCaptureStatus driverCaptureStatus, cudaStreamCaptureStatus *runtimeStatus) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_NONE:
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusNone             # <<<<<<<<<<<<<<
 *     elif driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_ACTIVE:
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusActive
 */
    (__pyx_v_runtimeStatus[0]) = cudaStreamCaptureStatusNone;

    /* "cuda/_lib/ccudart/utils.pyx":898
 * 
 * cdef cudaError_t toRuntimeStreamCaptureStatus(ccuda.CUstreamCaptureStatus driverCaptureStatus, cudaStreamCaptureStatus *runtimeStatus) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_NONE:             # <<<<<<<<<<<<<<
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusNone
 *     elif driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_ACTIVE:
 */
    break;
    case CU_STREAM_CAPTURE_STATUS_ACTIVE:

    /* "cuda/_lib/ccudart/utils.pyx":901
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusNone
 *     elif driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_ACTIVE:
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusActive             # <<<<<<<<<<<<<<
 *     elif driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_INVALIDATED:
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusInvalidated
 */
    (__pyx_v_runtimeStatus[0]) = cudaStreamCaptureStatusActive;

    /* "cuda/_lib/ccudart/utils.pyx":900
 *     if driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_NONE:
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusNone
 *     elif driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_ACTIVE:             # <<<<<<<<<<<<<<
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusActive
 *     elif driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_INVALIDATED:
 */
    break;
    case CU_STREAM_CAPTURE_STATUS_INVALIDATED:

    /* "cuda/_lib/ccudart/utils.pyx":903
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusActive
 *     elif driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_INVALIDATED:
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusInvalidated             # <<<<<<<<<<<<<<
 *     else:
 *          return cudaErrorUnknown
 */
    (__pyx_v_runtimeStatus[0]) = cudaStreamCaptureStatusInvalidated;

    /* "cuda/_lib/ccudart/utils.pyx":902
 *     elif driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_ACTIVE:
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusActive
 *     elif driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_INVALIDATED:             # <<<<<<<<<<<<<<
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusInvalidated
 *     else:
 */
    break;
    default:

    /* "cuda/_lib/ccudart/utils.pyx":905
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusInvalidated
 *     else:
 *          return cudaErrorUnknown             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
    __pyx_r = cudaErrorUnknown;
    goto __pyx_L0;
    break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":906
 *     else:
 *          return cudaErrorUnknown
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":897
 * 
 * 
 * cdef cudaError_t toRuntimeStreamCaptureStatus(ccuda.CUstreamCaptureStatus driverCaptureStatus, cudaStreamCaptureStatus *runtimeStatus) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_NONE:
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusNone
 */

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

/* "cuda/_lib/ccudart/utils.pyx":909
 * 
 * 
 * cdef cudaError_t streamGetCaptureInfoCommon(             # <<<<<<<<<<<<<<
 *         cudaStream_t stream,
 *         cudaStreamCaptureStatus* captureStatus_out,
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_streamGetCaptureInfoCommon(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;
  CUstreamCaptureStatus __pyx_v_driverCaptureStatus;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  CUresult __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("streamGetCaptureInfoCommon", __pyx_f[0], 909, 1, __PYX_ERR(0, 909, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":916
 *         const cudaGraphNode_t **dependencies_out,
 *         size_t *numDependencies_out)  except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if captureStatus_out == NULL:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":918
 *     cdef cudaError_t err = cudaSuccess
 * 
 *     if captureStatus_out == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_1 = (__pyx_v_captureStatus_out == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":919
 * 
 *     if captureStatus_out == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUstreamCaptureStatus driverCaptureStatus
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":918
 *     cdef cudaError_t err = cudaSuccess
 * 
 *     if captureStatus_out == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":923
 *     cdef ccuda.CUstreamCaptureStatus driverCaptureStatus
 * 
 *     err = <cudaError_t>ccuda._cuStreamGetCaptureInfo_v2(stream, &driverCaptureStatus, <ccuda.cuuint64_t*>id_out,             # <<<<<<<<<<<<<<
 *             graph_out, dependencies_out, numDependencies_out)
 *     if err != cudaSuccess:
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetCaptureInfo_v2(__pyx_v_stream, (&__pyx_v_driverCaptureStatus), ((cuuint64_t *)__pyx_v_id_out), __pyx_v_graph_out, __pyx_v_dependencies_out, __pyx_v_numDependencies_out); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 923, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/utils.pyx":925
 *     err = <cudaError_t>ccuda._cuStreamGetCaptureInfo_v2(stream, &driverCaptureStatus, <ccuda.cuuint64_t*>id_out,
 *             graph_out, dependencies_out, numDependencies_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":926
 *             graph_out, dependencies_out, numDependencies_out)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     return toRuntimeStreamCaptureStatus(driverCaptureStatus, captureStatus_out)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":925
 *     err = <cudaError_t>ccuda._cuStreamGetCaptureInfo_v2(stream, &driverCaptureStatus, <ccuda.cuuint64_t*>id_out,
 *             graph_out, dependencies_out, numDependencies_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":928
 *         return err
 * 
 *     return toRuntimeStreamCaptureStatus(driverCaptureStatus, captureStatus_out)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toRuntimeStreamCaptureStatus(__pyx_v_driverCaptureStatus, __pyx_v_captureStatus_out); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 928, __pyx_L1_error)
  __pyx_r = __pyx_t_3;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":909
 * 
 * 
 * cdef cudaError_t streamGetCaptureInfoCommon(             # <<<<<<<<<<<<<<
 *         cudaStream_t stream,
 *         cudaStreamCaptureStatus* captureStatus_out,
 */

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

/* "cuda/_lib/ccudart/utils.pyx":931
 * 
 * 
 * cdef cudaError_t streamGetCaptureInfoCommon_v3(             # <<<<<<<<<<<<<<
 *         cudaStream_t stream,
 *         cudaStreamCaptureStatus* captureStatus_out,
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_streamGetCaptureInfoCommon_v3(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, cudaGraphEdgeData const **__pyx_v_edgeData_out, size_t *__pyx_v_numDependencies_out) {
  cudaError_t __pyx_v_err;
  CUstreamCaptureStatus __pyx_v_driverCaptureStatus;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  CUresult __pyx_t_2;
  cudaError_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("streamGetCaptureInfoCommon_v3", __pyx_f[0], 931, 1, __PYX_ERR(0, 931, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":939
 *         const cudaGraphEdgeData** edgeData_out,
 *         size_t *numDependencies_out)  except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if captureStatus_out == NULL:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":941
 *     cdef cudaError_t err = cudaSuccess
 * 
 *     if captureStatus_out == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_1 = (__pyx_v_captureStatus_out == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":942
 * 
 *     if captureStatus_out == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUstreamCaptureStatus driverCaptureStatus
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":941
 *     cdef cudaError_t err = cudaSuccess
 * 
 *     if captureStatus_out == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":946
 *     cdef ccuda.CUstreamCaptureStatus driverCaptureStatus
 * 
 *     err = <cudaError_t>ccuda._cuStreamGetCaptureInfo_v3(stream, &driverCaptureStatus, <ccuda.cuuint64_t*>id_out,             # <<<<<<<<<<<<<<
 *             graph_out, dependencies_out, <const ccuda.CUgraphEdgeData**>edgeData_out, numDependencies_out)
 *     if err != cudaSuccess:
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetCaptureInfo_v3(__pyx_v_stream, (&__pyx_v_driverCaptureStatus), ((cuuint64_t *)__pyx_v_id_out), __pyx_v_graph_out, __pyx_v_dependencies_out, ((CUgraphEdgeData const **)__pyx_v_edgeData_out), __pyx_v_numDependencies_out); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 946, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/utils.pyx":948
 *     err = <cudaError_t>ccuda._cuStreamGetCaptureInfo_v3(stream, &driverCaptureStatus, <ccuda.cuuint64_t*>id_out,
 *             graph_out, dependencies_out, <const ccuda.CUgraphEdgeData**>edgeData_out, numDependencies_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":949
 *             graph_out, dependencies_out, <const ccuda.CUgraphEdgeData**>edgeData_out, numDependencies_out)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     return toRuntimeStreamCaptureStatus(driverCaptureStatus, captureStatus_out)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":948
 *     err = <cudaError_t>ccuda._cuStreamGetCaptureInfo_v3(stream, &driverCaptureStatus, <ccuda.cuuint64_t*>id_out,
 *             graph_out, dependencies_out, <const ccuda.CUgraphEdgeData**>edgeData_out, numDependencies_out)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":951
 *         return err
 * 
 *     return toRuntimeStreamCaptureStatus(driverCaptureStatus, captureStatus_out)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toRuntimeStreamCaptureStatus(__pyx_v_driverCaptureStatus, __pyx_v_captureStatus_out); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 951, __pyx_L1_error)
  __pyx_r = __pyx_t_3;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":931
 * 
 * 
 * cdef cudaError_t streamGetCaptureInfoCommon_v3(             # <<<<<<<<<<<<<<
 *         cudaStream_t stream,
 *         cudaStreamCaptureStatus* captureStatus_out,
 */

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

/* "cuda/_lib/ccudart/utils.pyx":954
 * 
 * 
 * cdef ccuda.CUDA_MEMCPY3D_v2 memCopy3DInit(ccuda.CUmemorytype_enum dstType, ccuda.CUmemorytype_enum srcType) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp
 *     memset(&cp, 0, sizeof(cp))
 */

static CUDA_MEMCPY3D_v2 __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy3DInit(enum CUmemorytype_enum __pyx_v_dstType, enum CUmemorytype_enum __pyx_v_srcType) {
  CUDA_MEMCPY3D_v2 __pyx_v_cp;
  CUDA_MEMCPY3D_v2 __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("memCopy3DInit", __pyx_f[0], 954, 1, __PYX_ERR(0, 954, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":956
 * cdef ccuda.CUDA_MEMCPY3D_v2 memCopy3DInit(ccuda.CUmemorytype_enum dstType, ccuda.CUmemorytype_enum srcType) noexcept nogil:
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp
 *     memset(&cp, 0, sizeof(cp))             # <<<<<<<<<<<<<<
 *     cp.dstMemoryType = dstType
 *     cp.srcMemoryType = srcType
 */
  (void)(memset((&__pyx_v_cp), 0, (sizeof(__pyx_v_cp))));

  /* "cuda/_lib/ccudart/utils.pyx":957
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp
 *     memset(&cp, 0, sizeof(cp))
 *     cp.dstMemoryType = dstType             # <<<<<<<<<<<<<<
 *     cp.srcMemoryType = srcType
 *     cp.WidthInBytes = 0
 */
  __pyx_v_cp.dstMemoryType = __pyx_v_dstType;

  /* "cuda/_lib/ccudart/utils.pyx":958
 *     memset(&cp, 0, sizeof(cp))
 *     cp.dstMemoryType = dstType
 *     cp.srcMemoryType = srcType             # <<<<<<<<<<<<<<
 *     cp.WidthInBytes = 0
 *     cp.Height = 1
 */
  __pyx_v_cp.srcMemoryType = __pyx_v_srcType;

  /* "cuda/_lib/ccudart/utils.pyx":959
 *     cp.dstMemoryType = dstType
 *     cp.srcMemoryType = srcType
 *     cp.WidthInBytes = 0             # <<<<<<<<<<<<<<
 *     cp.Height = 1
 *     cp.Depth = 1
 */
  __pyx_v_cp.WidthInBytes = 0;

  /* "cuda/_lib/ccudart/utils.pyx":960
 *     cp.srcMemoryType = srcType
 *     cp.WidthInBytes = 0
 *     cp.Height = 1             # <<<<<<<<<<<<<<
 *     cp.Depth = 1
 *     return cp
 */
  __pyx_v_cp.Height = 1;

  /* "cuda/_lib/ccudart/utils.pyx":961
 *     cp.WidthInBytes = 0
 *     cp.Height = 1
 *     cp.Depth = 1             # <<<<<<<<<<<<<<
 *     return cp
 * 
 */
  __pyx_v_cp.Depth = 1;

  /* "cuda/_lib/ccudart/utils.pyx":962
 *     cp.Height = 1
 *     cp.Depth = 1
 *     return cp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_cp;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":954
 * 
 * 
 * cdef ccuda.CUDA_MEMCPY3D_v2 memCopy3DInit(ccuda.CUmemorytype_enum dstType, ccuda.CUmemorytype_enum srcType) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp
 *     memset(&cp, 0, sizeof(cp))
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_WriteUnraisable("cuda._lib.ccudart.utils.memCopy3DInit", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __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/utils.pyx":965
 * 
 * 
 * cdef ccuda.CUDA_MEMCPY2D_v2 memCopy2DInit(ccuda.CUmemorytype_enum dstType, ccuda.CUmemorytype_enum srcType) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY2D_v2 cp
 *     memset(&cp, 0, sizeof(cp))
 */

static CUDA_MEMCPY2D_v2 __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy2DInit(enum CUmemorytype_enum __pyx_v_dstType, enum CUmemorytype_enum __pyx_v_srcType) {
  CUDA_MEMCPY2D_v2 __pyx_v_cp;
  CUDA_MEMCPY2D_v2 __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("memCopy2DInit", __pyx_f[0], 965, 1, __PYX_ERR(0, 965, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":967
 * cdef ccuda.CUDA_MEMCPY2D_v2 memCopy2DInit(ccuda.CUmemorytype_enum dstType, ccuda.CUmemorytype_enum srcType) noexcept nogil:
 *     cdef ccuda.CUDA_MEMCPY2D_v2 cp
 *     memset(&cp, 0, sizeof(cp))             # <<<<<<<<<<<<<<
 *     cp.dstMemoryType = dstType
 *     cp.srcMemoryType = srcType
 */
  (void)(memset((&__pyx_v_cp), 0, (sizeof(__pyx_v_cp))));

  /* "cuda/_lib/ccudart/utils.pyx":968
 *     cdef ccuda.CUDA_MEMCPY2D_v2 cp
 *     memset(&cp, 0, sizeof(cp))
 *     cp.dstMemoryType = dstType             # <<<<<<<<<<<<<<
 *     cp.srcMemoryType = srcType
 *     cp.WidthInBytes = 0
 */
  __pyx_v_cp.dstMemoryType = __pyx_v_dstType;

  /* "cuda/_lib/ccudart/utils.pyx":969
 *     memset(&cp, 0, sizeof(cp))
 *     cp.dstMemoryType = dstType
 *     cp.srcMemoryType = srcType             # <<<<<<<<<<<<<<
 *     cp.WidthInBytes = 0
 *     cp.Height = 1
 */
  __pyx_v_cp.srcMemoryType = __pyx_v_srcType;

  /* "cuda/_lib/ccudart/utils.pyx":970
 *     cp.dstMemoryType = dstType
 *     cp.srcMemoryType = srcType
 *     cp.WidthInBytes = 0             # <<<<<<<<<<<<<<
 *     cp.Height = 1
 *     return cp
 */
  __pyx_v_cp.WidthInBytes = 0;

  /* "cuda/_lib/ccudart/utils.pyx":971
 *     cp.srcMemoryType = srcType
 *     cp.WidthInBytes = 0
 *     cp.Height = 1             # <<<<<<<<<<<<<<
 *     return cp
 * 
 */
  __pyx_v_cp.Height = 1;

  /* "cuda/_lib/ccudart/utils.pyx":972
 *     cp.WidthInBytes = 0
 *     cp.Height = 1
 *     return cp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_cp;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":965
 * 
 * 
 * cdef ccuda.CUDA_MEMCPY2D_v2 memCopy2DInit(ccuda.CUmemorytype_enum dstType, ccuda.CUmemorytype_enum srcType) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY2D_v2 cp
 *     memset(&cp, 0, sizeof(cp))
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_WriteUnraisable("cuda._lib.ccudart.utils.memCopy2DInit", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __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/utils.pyx":975
 * 
 * 
 * cdef cudaError_t bytesPerElement(size_t *bytes, int numberOfChannels, ccuda.CUarray_format format) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if format in (ccuda.CU_AD_FORMAT_FLOAT,
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT32,
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_bytesPerElement(size_t *__pyx_v_bytes, int __pyx_v_numberOfChannels, CUarray_format __pyx_v_format) {
  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("bytesPerElement", __pyx_f[0], 975, 1, __PYX_ERR(0, 975, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":976
 * 
 * cdef cudaError_t bytesPerElement(size_t *bytes, int numberOfChannels, ccuda.CUarray_format format) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if format in (ccuda.CU_AD_FORMAT_FLOAT,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT32,
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT32):
 */
  switch (__pyx_v_format) {
    case CU_AD_FORMAT_FLOAT:
    case CU_AD_FORMAT_UNSIGNED_INT32:

    /* "cuda/_lib/ccudart/utils.pyx":977
 * cdef cudaError_t bytesPerElement(size_t *bytes, int numberOfChannels, ccuda.CUarray_format format) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if format in (ccuda.CU_AD_FORMAT_FLOAT,
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT32,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT32):
 *         bytes[0] = numberOfChannels * 4
 */
    case CU_AD_FORMAT_SIGNED_INT32:

    /* "cuda/_lib/ccudart/utils.pyx":979
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT32,
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT32):
 *         bytes[0] = numberOfChannels * 4             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_HALF,
 */
    (__pyx_v_bytes[0]) = (__pyx_v_numberOfChannels * 4);

    /* "cuda/_lib/ccudart/utils.pyx":980
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT32):
 *         bytes[0] = numberOfChannels * 4
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     elif format in (ccuda.CU_AD_FORMAT_HALF,
 *                     ccuda.CU_AD_FORMAT_SIGNED_INT16,
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":976
 * 
 * cdef cudaError_t bytesPerElement(size_t *bytes, int numberOfChannels, ccuda.CUarray_format format) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if format in (ccuda.CU_AD_FORMAT_FLOAT,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT32,
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT32):
 */
    break;
    case CU_AD_FORMAT_HALF:

    /* "cuda/_lib/ccudart/utils.pyx":981
 *         bytes[0] = numberOfChannels * 4
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_HALF,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_SIGNED_INT16,
 *                     ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 */
    case CU_AD_FORMAT_SIGNED_INT16:

    /* "cuda/_lib/ccudart/utils.pyx":982
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_HALF,
 *                     ccuda.CU_AD_FORMAT_SIGNED_INT16,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 *         bytes[0] = numberOfChannels * 2
 */
    case CU_AD_FORMAT_UNSIGNED_INT16:

    /* "cuda/_lib/ccudart/utils.pyx":984
 *                     ccuda.CU_AD_FORMAT_SIGNED_INT16,
 *                     ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 *         bytes[0] = numberOfChannels * 2             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,
 */
    (__pyx_v_bytes[0]) = (__pyx_v_numberOfChannels * 2);

    /* "cuda/_lib/ccudart/utils.pyx":985
 *                     ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 *         bytes[0] = numberOfChannels * 2
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     elif format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,
 *                     ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":981
 *         bytes[0] = numberOfChannels * 4
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_HALF,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_SIGNED_INT16,
 *                     ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 */
    break;
    case CU_AD_FORMAT_SIGNED_INT8:

    /* "cuda/_lib/ccudart/utils.pyx":986
 *         bytes[0] = numberOfChannels * 2
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 *                     ccuda.CU_AD_FORMAT_NV12):
 */
    case CU_AD_FORMAT_UNSIGNED_INT8:

    /* "cuda/_lib/ccudart/utils.pyx":987
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,
 *                     ccuda.CU_AD_FORMAT_UNSIGNED_INT8,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_NV12):
 *         bytes[0] = numberOfChannels
 */
    case CU_AD_FORMAT_NV12:

    /* "cuda/_lib/ccudart/utils.pyx":989
 *                     ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 *                     ccuda.CU_AD_FORMAT_NV12):
 *         bytes[0] = numberOfChannels             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X1,
 */
    (__pyx_v_bytes[0]) = __pyx_v_numberOfChannels;

    /* "cuda/_lib/ccudart/utils.pyx":990
 *                     ccuda.CU_AD_FORMAT_NV12):
 *         bytes[0] = numberOfChannels
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X1,
 *                     ccuda.CU_AD_FORMAT_UNORM_INT8X1):
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":986
 *         bytes[0] = numberOfChannels * 2
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 *                     ccuda.CU_AD_FORMAT_NV12):
 */
    break;
    case CU_AD_FORMAT_SNORM_INT8X1:

    /* "cuda/_lib/ccudart/utils.pyx":991
 *         bytes[0] = numberOfChannels
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X1,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_UNORM_INT8X1):
 *         bytes[0] = 1
 */
    case CU_AD_FORMAT_UNORM_INT8X1:

    /* "cuda/_lib/ccudart/utils.pyx":993
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X1,
 *                     ccuda.CU_AD_FORMAT_UNORM_INT8X1):
 *         bytes[0] = 1             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X2,
 */
    (__pyx_v_bytes[0]) = 1;

    /* "cuda/_lib/ccudart/utils.pyx":994
 *                     ccuda.CU_AD_FORMAT_UNORM_INT8X1):
 *         bytes[0] = 1
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X2,
 *                     ccuda.CU_AD_FORMAT_UNORM_INT8X2,
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":991
 *         bytes[0] = numberOfChannels
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X1,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_UNORM_INT8X1):
 *         bytes[0] = 1
 */
    break;
    case CU_AD_FORMAT_SNORM_INT8X2:

    /* "cuda/_lib/ccudart/utils.pyx":995
 *         bytes[0] = 1
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X2,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_UNORM_INT8X2,
 *                     ccuda.CU_AD_FORMAT_SNORM_INT16X1,
 */
    case CU_AD_FORMAT_UNORM_INT8X2:

    /* "cuda/_lib/ccudart/utils.pyx":996
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X2,
 *                     ccuda.CU_AD_FORMAT_UNORM_INT8X2,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_SNORM_INT16X1,
 *                     ccuda.CU_AD_FORMAT_UNORM_INT16X1):
 */
    case CU_AD_FORMAT_SNORM_INT16X1:

    /* "cuda/_lib/ccudart/utils.pyx":997
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X2,
 *                     ccuda.CU_AD_FORMAT_UNORM_INT8X2,
 *                     ccuda.CU_AD_FORMAT_SNORM_INT16X1,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_UNORM_INT16X1):
 *         bytes[0] = 2
 */
    case CU_AD_FORMAT_UNORM_INT16X1:

    /* "cuda/_lib/ccudart/utils.pyx":999
 *                     ccuda.CU_AD_FORMAT_SNORM_INT16X1,
 *                     ccuda.CU_AD_FORMAT_UNORM_INT16X1):
 *         bytes[0] = 2             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 */
    (__pyx_v_bytes[0]) = 2;

    /* "cuda/_lib/ccudart/utils.pyx":1000
 *                     ccuda.CU_AD_FORMAT_UNORM_INT16X1):
 *         bytes[0] = 2
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 *                     ccuda.CU_AD_FORMAT_UNORM_INT8X4,
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":995
 *         bytes[0] = 1
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X2,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_UNORM_INT8X2,
 *                     ccuda.CU_AD_FORMAT_SNORM_INT16X1,
 */
    break;
    case CU_AD_FORMAT_SNORM_INT8X4:

    /* "cuda/_lib/ccudart/utils.pyx":1001
 *         bytes[0] = 2
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X4,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_UNORM_INT8X4,
 *                     ccuda.CU_AD_FORMAT_SNORM_INT16X2,
 */
    case CU_AD_FORMAT_UNORM_INT8X4:

    /* "cuda/_lib/ccudart/utils.pyx":1002
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 *                     ccuda.CU_AD_FORMAT_UNORM_INT8X4,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_SNORM_INT16X2,
 *                     ccuda.CU_AD_FORMAT_UNORM_INT16X2):
 */
    case CU_AD_FORMAT_SNORM_INT16X2:

    /* "cuda/_lib/ccudart/utils.pyx":1003
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 *                     ccuda.CU_AD_FORMAT_UNORM_INT8X4,
 *                     ccuda.CU_AD_FORMAT_SNORM_INT16X2,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_UNORM_INT16X2):
 *         bytes[0] = 4
 */
    case CU_AD_FORMAT_UNORM_INT16X2:

    /* "cuda/_lib/ccudart/utils.pyx":1005
 *                     ccuda.CU_AD_FORMAT_SNORM_INT16X2,
 *                     ccuda.CU_AD_FORMAT_UNORM_INT16X2):
 *         bytes[0] = 4             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT16X4,
 */
    (__pyx_v_bytes[0]) = 4;

    /* "cuda/_lib/ccudart/utils.pyx":1006
 *                     ccuda.CU_AD_FORMAT_UNORM_INT16X2):
 *         bytes[0] = 4
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT16X4,
 *                     ccuda.CU_AD_FORMAT_UNORM_INT16X4):
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1001
 *         bytes[0] = 2
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT8X4,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_UNORM_INT8X4,
 *                     ccuda.CU_AD_FORMAT_SNORM_INT16X2,
 */
    break;
    case CU_AD_FORMAT_SNORM_INT16X4:

    /* "cuda/_lib/ccudart/utils.pyx":1007
 *         bytes[0] = 4
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT16X4,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_UNORM_INT16X4):
 *         bytes[0] = 8
 */
    case CU_AD_FORMAT_UNORM_INT16X4:

    /* "cuda/_lib/ccudart/utils.pyx":1009
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT16X4,
 *                     ccuda.CU_AD_FORMAT_UNORM_INT16X4):
 *         bytes[0] = 8             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_BC2_UNORM,
 */
    (__pyx_v_bytes[0]) = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1010
 *                     ccuda.CU_AD_FORMAT_UNORM_INT16X4):
 *         bytes[0] = 8
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     elif format in (ccuda.CU_AD_FORMAT_BC2_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1007
 *         bytes[0] = 4
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_SNORM_INT16X4,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_UNORM_INT16X4):
 *         bytes[0] = 8
 */
    break;
    case CU_AD_FORMAT_BC2_UNORM:

    /* "cuda/_lib/ccudart/utils.pyx":1011
 *         bytes[0] = 8
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_BC2_UNORM,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM,
 */
    case CU_AD_FORMAT_BC2_UNORM_SRGB:

    /* "cuda/_lib/ccudart/utils.pyx":1012
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_BC2_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,
 */
    case CU_AD_FORMAT_BC3_UNORM:

    /* "cuda/_lib/ccudart/utils.pyx":1013
 *     elif format in (ccuda.CU_AD_FORMAT_BC2_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC5_UNORM,
 */
    case CU_AD_FORMAT_BC3_UNORM_SRGB:

    /* "cuda/_lib/ccudart/utils.pyx":1014
 *                     ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC5_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC5_SNORM,
 */
    case CU_AD_FORMAT_BC5_UNORM:

    /* "cuda/_lib/ccudart/utils.pyx":1015
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC5_UNORM,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC5_SNORM,
 *                     ccuda.CU_AD_FORMAT_BC6H_UF16,
 */
    case CU_AD_FORMAT_BC5_SNORM:

    /* "cuda/_lib/ccudart/utils.pyx":1016
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC5_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC5_SNORM,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC6H_UF16,
 *                     ccuda.CU_AD_FORMAT_BC6H_SF16,
 */
    case CU_AD_FORMAT_BC6H_UF16:

    /* "cuda/_lib/ccudart/utils.pyx":1017
 *                     ccuda.CU_AD_FORMAT_BC5_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC5_SNORM,
 *                     ccuda.CU_AD_FORMAT_BC6H_UF16,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC6H_SF16,
 *                     ccuda.CU_AD_FORMAT_BC7_UNORM,
 */
    case CU_AD_FORMAT_BC6H_SF16:

    /* "cuda/_lib/ccudart/utils.pyx":1018
 *                     ccuda.CU_AD_FORMAT_BC5_SNORM,
 *                     ccuda.CU_AD_FORMAT_BC6H_UF16,
 *                     ccuda.CU_AD_FORMAT_BC6H_SF16,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC7_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 */
    case CU_AD_FORMAT_BC7_UNORM:

    /* "cuda/_lib/ccudart/utils.pyx":1019
 *                     ccuda.CU_AD_FORMAT_BC6H_UF16,
 *                     ccuda.CU_AD_FORMAT_BC6H_SF16,
 *                     ccuda.CU_AD_FORMAT_BC7_UNORM,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 *         bytes[0] = 16
 */
    case CU_AD_FORMAT_BC7_UNORM_SRGB:

    /* "cuda/_lib/ccudart/utils.pyx":1021
 *                     ccuda.CU_AD_FORMAT_BC7_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 *         bytes[0] = 16             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     return cudaErrorInvalidChannelDescriptor
 */
    (__pyx_v_bytes[0]) = 16;

    /* "cuda/_lib/ccudart/utils.pyx":1022
 *                     ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 *         bytes[0] = 16
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     return cudaErrorInvalidChannelDescriptor
 * 
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1011
 *         bytes[0] = 8
 *         return cudaSuccess
 *     elif format in (ccuda.CU_AD_FORMAT_BC2_UNORM,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM,
 */
    break;
    default: break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1023
 *         bytes[0] = 16
 *         return cudaSuccess
 *     return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaErrorInvalidChannelDescriptor;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":975
 * 
 * 
 * cdef cudaError_t bytesPerElement(size_t *bytes, int numberOfChannels, ccuda.CUarray_format format) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if format in (ccuda.CU_AD_FORMAT_FLOAT,
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT32,
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1026
 * 
 * 
 * cdef cudaError_t getChannelFormatDescFromDriverDesc(             # <<<<<<<<<<<<<<
 *     cudaChannelFormatDesc* pRuntimeDesc, size_t* pDepth, size_t* pHeight, size_t* pWidth,
 *     const ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2* pDriverDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelFormatDescFromDriverDesc(struct cudaChannelFormatDesc *__pyx_v_pRuntimeDesc, size_t *__pyx_v_pDepth, size_t *__pyx_v_pHeight, size_t *__pyx_v_pWidth, CUDA_ARRAY3D_DESCRIPTOR_v2 const *__pyx_v_pDriverDesc) {
  int __pyx_v_channel_size;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  unsigned int __pyx_t_2;
  int __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("getChannelFormatDescFromDriverDesc", __pyx_f[0], 1026, 1, __PYX_ERR(0, 1026, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1030
 *     const ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2* pDriverDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 * 
 *     cdef int channel_size = 0             # <<<<<<<<<<<<<<
 *     if pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 */
  __pyx_v_channel_size = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1031
 * 
 *     cdef int channel_size = 0
 *     if pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_UNSIGNED_INT8);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1032
 *     cdef int channel_size = 0
 *     if pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsigned;

    /* "cuda/_lib/ccudart/utils.pyx":1033
 *     if pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1031
 * 
 *     cdef int channel_size = 0
 *     if pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1034
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *         channel_size = 16
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_UNSIGNED_INT16);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1035
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned             # <<<<<<<<<<<<<<
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsigned;

    /* "cuda/_lib/ccudart/utils.pyx":1036
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *         channel_size = 16             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 */
    __pyx_v_channel_size = 16;

    /* "cuda/_lib/ccudart/utils.pyx":1034
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *         channel_size = 16
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1037
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *         channel_size = 32
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_UNSIGNED_INT32);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1038
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned             # <<<<<<<<<<<<<<
 *         channel_size = 32
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT8:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsigned;

    /* "cuda/_lib/ccudart/utils.pyx":1039
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *         channel_size = 32             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT8:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 */
    __pyx_v_channel_size = 32;

    /* "cuda/_lib/ccudart/utils.pyx":1037
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *         channel_size = 32
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1040
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *         channel_size = 32
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT8:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_SIGNED_INT8);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1041
 *         channel_size = 32
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT8:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT16:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindSigned;

    /* "cuda/_lib/ccudart/utils.pyx":1042
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT8:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT16:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1040
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned
 *         channel_size = 32
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT8:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1043
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT16:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *         channel_size = 16
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_SIGNED_INT16);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1044
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT16:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned             # <<<<<<<<<<<<<<
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT32:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindSigned;

    /* "cuda/_lib/ccudart/utils.pyx":1045
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT16:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *         channel_size = 16             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT32:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 */
    __pyx_v_channel_size = 16;

    /* "cuda/_lib/ccudart/utils.pyx":1043
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT16:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *         channel_size = 16
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1046
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT32:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *         channel_size = 32
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_SIGNED_INT32);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1047
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT32:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned             # <<<<<<<<<<<<<<
 *         channel_size = 32
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_HALF:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindSigned;

    /* "cuda/_lib/ccudart/utils.pyx":1048
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT32:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *         channel_size = 32             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_HALF:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 */
    __pyx_v_channel_size = 32;

    /* "cuda/_lib/ccudart/utils.pyx":1046
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SIGNED_INT32:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *         channel_size = 32
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1049
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *         channel_size = 32
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_HALF:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *         channel_size = 16
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_HALF);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1050
 *         channel_size = 32
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_HALF:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat             # <<<<<<<<<<<<<<
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_FLOAT:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindFloat;

    /* "cuda/_lib/ccudart/utils.pyx":1051
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_HALF:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *         channel_size = 16             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_FLOAT:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 */
    __pyx_v_channel_size = 16;

    /* "cuda/_lib/ccudart/utils.pyx":1049
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned
 *         channel_size = 32
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_HALF:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *         channel_size = 16
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1052
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_FLOAT:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *         channel_size = 32
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_FLOAT);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1053
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_FLOAT:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat             # <<<<<<<<<<<<<<
 *         channel_size = 32
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_NV12:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindFloat;

    /* "cuda/_lib/ccudart/utils.pyx":1054
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_FLOAT:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *         channel_size = 32             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_NV12:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindNV12
 */
    __pyx_v_channel_size = 32;

    /* "cuda/_lib/ccudart/utils.pyx":1052
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_FLOAT:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *         channel_size = 32
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1055
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *         channel_size = 32
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_NV12:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindNV12
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_NV12);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1056
 *         channel_size = 32
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_NV12:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindNV12             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X1:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindNV12;

    /* "cuda/_lib/ccudart/utils.pyx":1057
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_NV12:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindNV12
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X1:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1055
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat
 *         channel_size = 32
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_NV12:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindNV12
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1058
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindNV12
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X1:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_UNORM_INT8X1);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1059
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X1:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X2:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedNormalized8X1;

    /* "cuda/_lib/ccudart/utils.pyx":1060
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X1:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X2:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1058
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindNV12
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X1:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1061
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X2:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_UNORM_INT8X2);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1062
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X2:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X4:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedNormalized8X2;

    /* "cuda/_lib/ccudart/utils.pyx":1063
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X2:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X4:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1061
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X2:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1064
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X4:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_UNORM_INT8X4);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1065
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X4:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X1:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedNormalized8X4;

    /* "cuda/_lib/ccudart/utils.pyx":1066
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X4:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X1:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1064
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT8X4:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1067
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X1:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_SNORM_INT8X1);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1068
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X1:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X2:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindSignedNormalized8X1;

    /* "cuda/_lib/ccudart/utils.pyx":1069
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X1:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X2:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1067
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X1:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1070
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X2:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_SNORM_INT8X2);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1071
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X2:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X4:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindSignedNormalized8X2;

    /* "cuda/_lib/ccudart/utils.pyx":1072
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X2:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X4:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1070
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X2:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1073
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X4:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_SNORM_INT8X4);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1074
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X4:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X1:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindSignedNormalized8X4;

    /* "cuda/_lib/ccudart/utils.pyx":1075
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X4:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X1:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1073
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT8X4:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1076
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X1:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1
 *         channel_size = 16
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_UNORM_INT16X1);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1077
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X1:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1             # <<<<<<<<<<<<<<
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X2:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedNormalized16X1;

    /* "cuda/_lib/ccudart/utils.pyx":1078
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X1:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1
 *         channel_size = 16             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X2:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2
 */
    __pyx_v_channel_size = 16;

    /* "cuda/_lib/ccudart/utils.pyx":1076
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X1:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1
 *         channel_size = 16
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1079
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X2:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2
 *         channel_size = 16
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_UNORM_INT16X2);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1080
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X2:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2             # <<<<<<<<<<<<<<
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X4:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedNormalized16X2;

    /* "cuda/_lib/ccudart/utils.pyx":1081
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X2:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2
 *         channel_size = 16             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X4:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4
 */
    __pyx_v_channel_size = 16;

    /* "cuda/_lib/ccudart/utils.pyx":1079
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X2:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2
 *         channel_size = 16
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1082
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X4:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4
 *         channel_size = 16
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_UNORM_INT16X4);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1083
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X4:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4             # <<<<<<<<<<<<<<
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X1:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedNormalized16X4;

    /* "cuda/_lib/ccudart/utils.pyx":1084
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X4:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4
 *         channel_size = 16             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X1:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1
 */
    __pyx_v_channel_size = 16;

    /* "cuda/_lib/ccudart/utils.pyx":1082
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_UNORM_INT16X4:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4
 *         channel_size = 16
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1085
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X1:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1
 *         channel_size = 16
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_SNORM_INT16X1);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1086
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X1:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1             # <<<<<<<<<<<<<<
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X2:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindSignedNormalized16X1;

    /* "cuda/_lib/ccudart/utils.pyx":1087
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X1:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1
 *         channel_size = 16             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X2:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2
 */
    __pyx_v_channel_size = 16;

    /* "cuda/_lib/ccudart/utils.pyx":1085
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X1:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1
 *         channel_size = 16
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1088
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X2:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2
 *         channel_size = 16
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_SNORM_INT16X2);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1089
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X2:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2             # <<<<<<<<<<<<<<
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X4:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindSignedNormalized16X2;

    /* "cuda/_lib/ccudart/utils.pyx":1090
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X2:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2
 *         channel_size = 16             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X4:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4
 */
    __pyx_v_channel_size = 16;

    /* "cuda/_lib/ccudart/utils.pyx":1088
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X2:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2
 *         channel_size = 16
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1091
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X4:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4
 *         channel_size = 16
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_SNORM_INT16X4);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1092
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X4:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4             # <<<<<<<<<<<<<<
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC1_UNORM:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindSignedNormalized16X4;

    /* "cuda/_lib/ccudart/utils.pyx":1093
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X4:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4
 *         channel_size = 16             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC1_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1
 */
    __pyx_v_channel_size = 16;

    /* "cuda/_lib/ccudart/utils.pyx":1091
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_SNORM_INT16X4:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4
 *         channel_size = 16
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1094
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC1_UNORM:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_BC1_UNORM);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1095
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC1_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedBlockCompressed1;

    /* "cuda/_lib/ccudart/utils.pyx":1096
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC1_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1094
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC1_UNORM:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1097
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_BC1_UNORM_SRGB);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1098
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC2_UNORM:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedBlockCompressed1SRGB;

    /* "cuda/_lib/ccudart/utils.pyx":1099
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC2_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1097
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1100
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC2_UNORM:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_BC2_UNORM);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1101
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC2_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedBlockCompressed2;

    /* "cuda/_lib/ccudart/utils.pyx":1102
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC2_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1100
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC2_UNORM:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1103
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_BC2_UNORM_SRGB);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1104
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC3_UNORM:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedBlockCompressed2SRGB;

    /* "cuda/_lib/ccudart/utils.pyx":1105
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC3_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1103
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1106
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC3_UNORM:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_BC3_UNORM);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1107
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC3_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedBlockCompressed3;

    /* "cuda/_lib/ccudart/utils.pyx":1108
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC3_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1106
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC3_UNORM:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1109
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_BC3_UNORM_SRGB);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1110
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC4_UNORM:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedBlockCompressed3SRGB;

    /* "cuda/_lib/ccudart/utils.pyx":1111
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC4_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1109
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1112
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC4_UNORM:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_BC4_UNORM);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1113
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC4_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC4_SNORM:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedBlockCompressed4;

    /* "cuda/_lib/ccudart/utils.pyx":1114
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC4_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC4_SNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1112
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC4_UNORM:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1115
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC4_SNORM:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_BC4_SNORM);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1116
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC4_SNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC5_UNORM:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindSignedBlockCompressed4;

    /* "cuda/_lib/ccudart/utils.pyx":1117
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC4_SNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC5_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1115
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC4_SNORM:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1118
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC5_UNORM:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_BC5_UNORM);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1119
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC5_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC5_SNORM:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedBlockCompressed5;

    /* "cuda/_lib/ccudart/utils.pyx":1120
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC5_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC5_SNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1118
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC5_UNORM:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1121
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC5_SNORM:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_BC5_SNORM);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1122
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC5_SNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC6H_UF16:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindSignedBlockCompressed5;

    /* "cuda/_lib/ccudart/utils.pyx":1123
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC5_SNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC6H_UF16:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1121
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC5_SNORM:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1124
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC6H_UF16:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H
 *         channel_size = 16
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_BC6H_UF16);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1125
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC6H_UF16:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H             # <<<<<<<<<<<<<<
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC6H_SF16:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedBlockCompressed6H;

    /* "cuda/_lib/ccudart/utils.pyx":1126
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC6H_UF16:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H
 *         channel_size = 16             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC6H_SF16:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H
 */
    __pyx_v_channel_size = 16;

    /* "cuda/_lib/ccudart/utils.pyx":1124
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC6H_UF16:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H
 *         channel_size = 16
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1127
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC6H_SF16:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H
 *         channel_size = 16
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_BC6H_SF16);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1128
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC6H_SF16:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H             # <<<<<<<<<<<<<<
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC7_UNORM:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindSignedBlockCompressed6H;

    /* "cuda/_lib/ccudart/utils.pyx":1129
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC6H_SF16:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H
 *         channel_size = 16             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC7_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7
 */
    __pyx_v_channel_size = 16;

    /* "cuda/_lib/ccudart/utils.pyx":1127
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC6H_SF16:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H
 *         channel_size = 16
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1130
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC7_UNORM:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_BC7_UNORM);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1131
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC7_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedBlockCompressed7;

    /* "cuda/_lib/ccudart/utils.pyx":1132
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC7_UNORM:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1130
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H
 *         channel_size = 16
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC7_UNORM:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1133
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB
 *         channel_size = 8
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).Format == CU_AD_FORMAT_BC7_UNORM_SRGB);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1134
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB             # <<<<<<<<<<<<<<
 *         channel_size = 8
 *     else:
 */
    (__pyx_v_pRuntimeDesc[0]).f = cudaChannelFormatKindUnsignedBlockCompressed7SRGB;

    /* "cuda/_lib/ccudart/utils.pyx":1135
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB:
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB
 *         channel_size = 8             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorInvalidChannelDescriptor
 */
    __pyx_v_channel_size = 8;

    /* "cuda/_lib/ccudart/utils.pyx":1133
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7
 *         channel_size = 8
 *     elif pDriverDesc[0].Format == ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB
 *         channel_size = 8
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1137
 *         channel_size = 8
 *     else:
 *         return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 * 
 *     # populate bits per channel
 */
  /*else*/ {
    __pyx_r = cudaErrorInvalidChannelDescriptor;
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "cuda/_lib/ccudart/utils.pyx":1140
 * 
 *     # populate bits per channel
 *     pRuntimeDesc[0].x = 0             # <<<<<<<<<<<<<<
 *     pRuntimeDesc[0].y = 0
 *     pRuntimeDesc[0].z = 0
 */
  (__pyx_v_pRuntimeDesc[0]).x = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1141
 *     # populate bits per channel
 *     pRuntimeDesc[0].x = 0
 *     pRuntimeDesc[0].y = 0             # <<<<<<<<<<<<<<
 *     pRuntimeDesc[0].z = 0
 *     pRuntimeDesc[0].w = 0
 */
  (__pyx_v_pRuntimeDesc[0]).y = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1142
 *     pRuntimeDesc[0].x = 0
 *     pRuntimeDesc[0].y = 0
 *     pRuntimeDesc[0].z = 0             # <<<<<<<<<<<<<<
 *     pRuntimeDesc[0].w = 0
 * 
 */
  (__pyx_v_pRuntimeDesc[0]).z = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1143
 *     pRuntimeDesc[0].y = 0
 *     pRuntimeDesc[0].z = 0
 *     pRuntimeDesc[0].w = 0             # <<<<<<<<<<<<<<
 * 
 *     if pDriverDesc[0].NumChannels >= 4:
 */
  (__pyx_v_pRuntimeDesc[0]).w = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1145
 *     pRuntimeDesc[0].w = 0
 * 
 *     if pDriverDesc[0].NumChannels >= 4:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].w = channel_size
 *     if pDriverDesc[0].NumChannels >= 3:
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).NumChannels >= 4);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1146
 * 
 *     if pDriverDesc[0].NumChannels >= 4:
 *         pRuntimeDesc[0].w = channel_size             # <<<<<<<<<<<<<<
 *     if pDriverDesc[0].NumChannels >= 3:
 *         pRuntimeDesc[0].z = channel_size
 */
    (__pyx_v_pRuntimeDesc[0]).w = __pyx_v_channel_size;

    /* "cuda/_lib/ccudart/utils.pyx":1145
 *     pRuntimeDesc[0].w = 0
 * 
 *     if pDriverDesc[0].NumChannels >= 4:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].w = channel_size
 *     if pDriverDesc[0].NumChannels >= 3:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1147
 *     if pDriverDesc[0].NumChannels >= 4:
 *         pRuntimeDesc[0].w = channel_size
 *     if pDriverDesc[0].NumChannels >= 3:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].z = channel_size
 *     if pDriverDesc[0].NumChannels >= 2:
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).NumChannels >= 3);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1148
 *         pRuntimeDesc[0].w = channel_size
 *     if pDriverDesc[0].NumChannels >= 3:
 *         pRuntimeDesc[0].z = channel_size             # <<<<<<<<<<<<<<
 *     if pDriverDesc[0].NumChannels >= 2:
 *         pRuntimeDesc[0].y = channel_size
 */
    (__pyx_v_pRuntimeDesc[0]).z = __pyx_v_channel_size;

    /* "cuda/_lib/ccudart/utils.pyx":1147
 *     if pDriverDesc[0].NumChannels >= 4:
 *         pRuntimeDesc[0].w = channel_size
 *     if pDriverDesc[0].NumChannels >= 3:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].z = channel_size
 *     if pDriverDesc[0].NumChannels >= 2:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1149
 *     if pDriverDesc[0].NumChannels >= 3:
 *         pRuntimeDesc[0].z = channel_size
 *     if pDriverDesc[0].NumChannels >= 2:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].y = channel_size
 *     if pDriverDesc[0].NumChannels >= 1:
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).NumChannels >= 2);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1150
 *         pRuntimeDesc[0].z = channel_size
 *     if pDriverDesc[0].NumChannels >= 2:
 *         pRuntimeDesc[0].y = channel_size             # <<<<<<<<<<<<<<
 *     if pDriverDesc[0].NumChannels >= 1:
 *         pRuntimeDesc[0].x = channel_size
 */
    (__pyx_v_pRuntimeDesc[0]).y = __pyx_v_channel_size;

    /* "cuda/_lib/ccudart/utils.pyx":1149
 *     if pDriverDesc[0].NumChannels >= 3:
 *         pRuntimeDesc[0].z = channel_size
 *     if pDriverDesc[0].NumChannels >= 2:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].y = channel_size
 *     if pDriverDesc[0].NumChannels >= 1:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1151
 *     if pDriverDesc[0].NumChannels >= 2:
 *         pRuntimeDesc[0].y = channel_size
 *     if pDriverDesc[0].NumChannels >= 1:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].x = channel_size
 * 
 */
  __pyx_t_1 = ((__pyx_v_pDriverDesc[0]).NumChannels >= 1);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1152
 *         pRuntimeDesc[0].y = channel_size
 *     if pDriverDesc[0].NumChannels >= 1:
 *         pRuntimeDesc[0].x = channel_size             # <<<<<<<<<<<<<<
 * 
 *     if pDriverDesc[0].NumChannels not in (4, 3, 2, 1):
 */
    (__pyx_v_pRuntimeDesc[0]).x = __pyx_v_channel_size;

    /* "cuda/_lib/ccudart/utils.pyx":1151
 *     if pDriverDesc[0].NumChannels >= 2:
 *         pRuntimeDesc[0].y = channel_size
 *     if pDriverDesc[0].NumChannels >= 1:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].x = channel_size
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1154
 *         pRuntimeDesc[0].x = channel_size
 * 
 *     if pDriverDesc[0].NumChannels not in (4, 3, 2, 1):             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidChannelDescriptor
 * 
 */
  __pyx_t_2 = (__pyx_v_pDriverDesc[0]).NumChannels;
  __pyx_t_3 = (__pyx_t_2 != 4);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_t_2 != 3);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_t_2 != 2);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_t_2 != 1);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L9_bool_binop_done:;
  __pyx_t_3 = __pyx_t_1;
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":1155
 * 
 *     if pDriverDesc[0].NumChannels not in (4, 3, 2, 1):
 *         return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 * 
 *     # populate dimensions
 */
    __pyx_r = cudaErrorInvalidChannelDescriptor;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1154
 *         pRuntimeDesc[0].x = channel_size
 * 
 *     if pDriverDesc[0].NumChannels not in (4, 3, 2, 1):             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidChannelDescriptor
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1158
 * 
 *     # populate dimensions
 *     if pDepth != NULL:             # <<<<<<<<<<<<<<
 *         pDepth[0]  = pDriverDesc[0].Depth
 *     if pHeight != NULL:
 */
  __pyx_t_3 = (__pyx_v_pDepth != NULL);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":1159
 *     # populate dimensions
 *     if pDepth != NULL:
 *         pDepth[0]  = pDriverDesc[0].Depth             # <<<<<<<<<<<<<<
 *     if pHeight != NULL:
 *         pHeight[0] = pDriverDesc[0].Height
 */
    __pyx_t_4 = (__pyx_v_pDriverDesc[0]).Depth;
    (__pyx_v_pDepth[0]) = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1158
 * 
 *     # populate dimensions
 *     if pDepth != NULL:             # <<<<<<<<<<<<<<
 *         pDepth[0]  = pDriverDesc[0].Depth
 *     if pHeight != NULL:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1160
 *     if pDepth != NULL:
 *         pDepth[0]  = pDriverDesc[0].Depth
 *     if pHeight != NULL:             # <<<<<<<<<<<<<<
 *         pHeight[0] = pDriverDesc[0].Height
 *     if pWidth != NULL:
 */
  __pyx_t_3 = (__pyx_v_pHeight != NULL);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":1161
 *         pDepth[0]  = pDriverDesc[0].Depth
 *     if pHeight != NULL:
 *         pHeight[0] = pDriverDesc[0].Height             # <<<<<<<<<<<<<<
 *     if pWidth != NULL:
 *         pWidth[0]  = pDriverDesc[0].Width
 */
    __pyx_t_4 = (__pyx_v_pDriverDesc[0]).Height;
    (__pyx_v_pHeight[0]) = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1160
 *     if pDepth != NULL:
 *         pDepth[0]  = pDriverDesc[0].Depth
 *     if pHeight != NULL:             # <<<<<<<<<<<<<<
 *         pHeight[0] = pDriverDesc[0].Height
 *     if pWidth != NULL:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1162
 *     if pHeight != NULL:
 *         pHeight[0] = pDriverDesc[0].Height
 *     if pWidth != NULL:             # <<<<<<<<<<<<<<
 *         pWidth[0]  = pDriverDesc[0].Width
 *     return cudaSuccess
 */
  __pyx_t_3 = (__pyx_v_pWidth != NULL);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":1163
 *         pHeight[0] = pDriverDesc[0].Height
 *     if pWidth != NULL:
 *         pWidth[0]  = pDriverDesc[0].Width             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
    __pyx_t_4 = (__pyx_v_pDriverDesc[0]).Width;
    (__pyx_v_pWidth[0]) = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1162
 *     if pHeight != NULL:
 *         pHeight[0] = pDriverDesc[0].Height
 *     if pWidth != NULL:             # <<<<<<<<<<<<<<
 *         pWidth[0]  = pDriverDesc[0].Width
 *     return cudaSuccess
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1164
 *     if pWidth != NULL:
 *         pWidth[0]  = pDriverDesc[0].Width
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1026
 * 
 * 
 * cdef cudaError_t getChannelFormatDescFromDriverDesc(             # <<<<<<<<<<<<<<
 *     cudaChannelFormatDesc* pRuntimeDesc, size_t* pDepth, size_t* pHeight, size_t* pWidth,
 *     const ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2* pDriverDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1167
 * 
 * 
 * cdef cudaError_t getArrayBlockExtent(cudaExtent *blockExtent, ccuda.CUarray_format format) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if format in (ccuda.CU_AD_FORMAT_FLOAT,
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT32,
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_getArrayBlockExtent(struct cudaExtent *__pyx_v_blockExtent, CUarray_format __pyx_v_format) {
  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("getArrayBlockExtent", __pyx_f[0], 1167, 1, __PYX_ERR(0, 1167, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1168
 * 
 * cdef cudaError_t getArrayBlockExtent(cudaExtent *blockExtent, ccuda.CUarray_format format) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if format in (ccuda.CU_AD_FORMAT_FLOAT,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT32,
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT32,
 */
  switch (__pyx_v_format) {
    case CU_AD_FORMAT_FLOAT:
    case CU_AD_FORMAT_UNSIGNED_INT32:

    /* "cuda/_lib/ccudart/utils.pyx":1169
 * cdef cudaError_t getArrayBlockExtent(cudaExtent *blockExtent, ccuda.CUarray_format format) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if format in (ccuda.CU_AD_FORMAT_FLOAT,
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT32,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT32,
 *                   ccuda.CU_AD_FORMAT_HALF,
 */
    case CU_AD_FORMAT_SIGNED_INT32:

    /* "cuda/_lib/ccudart/utils.pyx":1170
 *     if format in (ccuda.CU_AD_FORMAT_FLOAT,
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT32,
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT32,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_HALF,
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT16,
 */
    case CU_AD_FORMAT_HALF:

    /* "cuda/_lib/ccudart/utils.pyx":1171
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT32,
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT32,
 *                   ccuda.CU_AD_FORMAT_HALF,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT16,
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT16,
 */
    case CU_AD_FORMAT_SIGNED_INT16:

    /* "cuda/_lib/ccudart/utils.pyx":1172
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT32,
 *                   ccuda.CU_AD_FORMAT_HALF,
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT16,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT16,
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT8,
 */
    case CU_AD_FORMAT_UNSIGNED_INT16:

    /* "cuda/_lib/ccudart/utils.pyx":1173
 *                   ccuda.CU_AD_FORMAT_HALF,
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT16,
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT16,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT8,
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 */
    case CU_AD_FORMAT_SIGNED_INT8:

    /* "cuda/_lib/ccudart/utils.pyx":1174
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT16,
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT16,
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT8,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 *                   ccuda.CU_AD_FORMAT_NV12,
 */
    case CU_AD_FORMAT_UNSIGNED_INT8:

    /* "cuda/_lib/ccudart/utils.pyx":1175
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT16,
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT8,
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT8,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_NV12,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT8X1,
 */
    case CU_AD_FORMAT_NV12:

    /* "cuda/_lib/ccudart/utils.pyx":1176
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT8,
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 *                   ccuda.CU_AD_FORMAT_NV12,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_SNORM_INT8X1,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT8X1,
 */
    case CU_AD_FORMAT_SNORM_INT8X1:

    /* "cuda/_lib/ccudart/utils.pyx":1177
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 *                   ccuda.CU_AD_FORMAT_NV12,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT8X1,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_UNORM_INT8X1,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT8X2,
 */
    case CU_AD_FORMAT_UNORM_INT8X1:

    /* "cuda/_lib/ccudart/utils.pyx":1178
 *                   ccuda.CU_AD_FORMAT_NV12,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT8X1,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT8X1,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_SNORM_INT8X2,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT8X2,
 */
    case CU_AD_FORMAT_SNORM_INT8X2:

    /* "cuda/_lib/ccudart/utils.pyx":1179
 *                   ccuda.CU_AD_FORMAT_SNORM_INT8X1,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT8X1,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT8X2,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_UNORM_INT8X2,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT16X1,
 */
    case CU_AD_FORMAT_UNORM_INT8X2:

    /* "cuda/_lib/ccudart/utils.pyx":1180
 *                   ccuda.CU_AD_FORMAT_UNORM_INT8X1,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT8X2,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT8X2,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_SNORM_INT16X1,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT16X1,
 */
    case CU_AD_FORMAT_SNORM_INT16X1:

    /* "cuda/_lib/ccudart/utils.pyx":1181
 *                   ccuda.CU_AD_FORMAT_SNORM_INT8X2,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT8X2,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT16X1,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_UNORM_INT16X1,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 */
    case CU_AD_FORMAT_UNORM_INT16X1:

    /* "cuda/_lib/ccudart/utils.pyx":1182
 *                   ccuda.CU_AD_FORMAT_UNORM_INT8X2,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT16X1,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT16X1,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT8X4,
 */
    case CU_AD_FORMAT_SNORM_INT8X4:

    /* "cuda/_lib/ccudart/utils.pyx":1183
 *                   ccuda.CU_AD_FORMAT_SNORM_INT16X1,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT16X1,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT8X4,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_UNORM_INT8X4,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT16X2,
 */
    case CU_AD_FORMAT_UNORM_INT8X4:

    /* "cuda/_lib/ccudart/utils.pyx":1184
 *                   ccuda.CU_AD_FORMAT_UNORM_INT16X1,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT8X4,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_SNORM_INT16X2,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT16X2,
 */
    case CU_AD_FORMAT_SNORM_INT16X2:

    /* "cuda/_lib/ccudart/utils.pyx":1185
 *                   ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT8X4,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT16X2,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_UNORM_INT16X2,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT16X4,
 */
    case CU_AD_FORMAT_UNORM_INT16X2:

    /* "cuda/_lib/ccudart/utils.pyx":1186
 *                   ccuda.CU_AD_FORMAT_UNORM_INT8X4,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT16X2,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT16X2,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_SNORM_INT16X4,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT16X4):
 */
    case CU_AD_FORMAT_SNORM_INT16X4:

    /* "cuda/_lib/ccudart/utils.pyx":1187
 *                   ccuda.CU_AD_FORMAT_SNORM_INT16X2,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT16X2,
 *                   ccuda.CU_AD_FORMAT_SNORM_INT16X4,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_UNORM_INT16X4):
 *         blockExtent[0].width = 1
 */
    case CU_AD_FORMAT_UNORM_INT16X4:

    /* "cuda/_lib/ccudart/utils.pyx":1189
 *                   ccuda.CU_AD_FORMAT_SNORM_INT16X4,
 *                   ccuda.CU_AD_FORMAT_UNORM_INT16X4):
 *         blockExtent[0].width = 1             # <<<<<<<<<<<<<<
 *         blockExtent[0].height = 1
 *         blockExtent[0].depth = 1
 */
    (__pyx_v_blockExtent[0]).width = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1190
 *                   ccuda.CU_AD_FORMAT_UNORM_INT16X4):
 *         blockExtent[0].width = 1
 *         blockExtent[0].height = 1             # <<<<<<<<<<<<<<
 *         blockExtent[0].depth = 1
 *     elif format in (ccuda.CU_AD_FORMAT_BC1_UNORM,
 */
    (__pyx_v_blockExtent[0]).height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1191
 *         blockExtent[0].width = 1
 *         blockExtent[0].height = 1
 *         blockExtent[0].depth = 1             # <<<<<<<<<<<<<<
 *     elif format in (ccuda.CU_AD_FORMAT_BC1_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB,
 */
    (__pyx_v_blockExtent[0]).depth = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1168
 * 
 * cdef cudaError_t getArrayBlockExtent(cudaExtent *blockExtent, ccuda.CUarray_format format) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if format in (ccuda.CU_AD_FORMAT_FLOAT,             # <<<<<<<<<<<<<<
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT32,
 *                   ccuda.CU_AD_FORMAT_SIGNED_INT32,
 */
    break;
    case CU_AD_FORMAT_BC1_UNORM:

    /* "cuda/_lib/ccudart/utils.pyx":1192
 *         blockExtent[0].height = 1
 *         blockExtent[0].depth = 1
 *     elif format in (ccuda.CU_AD_FORMAT_BC1_UNORM,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC4_UNORM,
 */
    case CU_AD_FORMAT_BC1_UNORM_SRGB:

    /* "cuda/_lib/ccudart/utils.pyx":1193
 *         blockExtent[0].depth = 1
 *     elif format in (ccuda.CU_AD_FORMAT_BC1_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC4_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC4_SNORM,
 */
    case CU_AD_FORMAT_BC4_UNORM:

    /* "cuda/_lib/ccudart/utils.pyx":1194
 *     elif format in (ccuda.CU_AD_FORMAT_BC1_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC4_UNORM,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC4_SNORM,
 *                     ccuda.CU_AD_FORMAT_BC2_UNORM,
 */
    case CU_AD_FORMAT_BC4_SNORM:

    /* "cuda/_lib/ccudart/utils.pyx":1195
 *                     ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC4_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC4_SNORM,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC2_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 */
    case CU_AD_FORMAT_BC2_UNORM:

    /* "cuda/_lib/ccudart/utils.pyx":1196
 *                     ccuda.CU_AD_FORMAT_BC4_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC4_SNORM,
 *                     ccuda.CU_AD_FORMAT_BC2_UNORM,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM,
 */
    case CU_AD_FORMAT_BC2_UNORM_SRGB:

    /* "cuda/_lib/ccudart/utils.pyx":1197
 *                     ccuda.CU_AD_FORMAT_BC4_SNORM,
 *                     ccuda.CU_AD_FORMAT_BC2_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,
 */
    case CU_AD_FORMAT_BC3_UNORM:

    /* "cuda/_lib/ccudart/utils.pyx":1198
 *                     ccuda.CU_AD_FORMAT_BC2_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC5_UNORM,
 */
    case CU_AD_FORMAT_BC3_UNORM_SRGB:

    /* "cuda/_lib/ccudart/utils.pyx":1199
 *                     ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC5_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC5_SNORM,
 */
    case CU_AD_FORMAT_BC5_UNORM:

    /* "cuda/_lib/ccudart/utils.pyx":1200
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC5_UNORM,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC5_SNORM,
 *                     ccuda.CU_AD_FORMAT_BC6H_UF16,
 */
    case CU_AD_FORMAT_BC5_SNORM:

    /* "cuda/_lib/ccudart/utils.pyx":1201
 *                     ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC5_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC5_SNORM,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC6H_UF16,
 *                     ccuda.CU_AD_FORMAT_BC6H_SF16,
 */
    case CU_AD_FORMAT_BC6H_UF16:

    /* "cuda/_lib/ccudart/utils.pyx":1202
 *                     ccuda.CU_AD_FORMAT_BC5_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC5_SNORM,
 *                     ccuda.CU_AD_FORMAT_BC6H_UF16,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC6H_SF16,
 *                     ccuda.CU_AD_FORMAT_BC7_UNORM,
 */
    case CU_AD_FORMAT_BC6H_SF16:

    /* "cuda/_lib/ccudart/utils.pyx":1203
 *                     ccuda.CU_AD_FORMAT_BC5_SNORM,
 *                     ccuda.CU_AD_FORMAT_BC6H_UF16,
 *                     ccuda.CU_AD_FORMAT_BC6H_SF16,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC7_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 */
    case CU_AD_FORMAT_BC7_UNORM:

    /* "cuda/_lib/ccudart/utils.pyx":1204
 *                     ccuda.CU_AD_FORMAT_BC6H_UF16,
 *                     ccuda.CU_AD_FORMAT_BC6H_SF16,
 *                     ccuda.CU_AD_FORMAT_BC7_UNORM,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 *         blockExtent[0].width = 4
 */
    case CU_AD_FORMAT_BC7_UNORM_SRGB:

    /* "cuda/_lib/ccudart/utils.pyx":1206
 *                     ccuda.CU_AD_FORMAT_BC7_UNORM,
 *                     ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 *         blockExtent[0].width = 4             # <<<<<<<<<<<<<<
 *         blockExtent[0].height = 4
 *         blockExtent[0].depth = 1
 */
    (__pyx_v_blockExtent[0]).width = 4;

    /* "cuda/_lib/ccudart/utils.pyx":1207
 *                     ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 *         blockExtent[0].width = 4
 *         blockExtent[0].height = 4             # <<<<<<<<<<<<<<
 *         blockExtent[0].depth = 1
 *     else:
 */
    (__pyx_v_blockExtent[0]).height = 4;

    /* "cuda/_lib/ccudart/utils.pyx":1208
 *         blockExtent[0].width = 4
 *         blockExtent[0].height = 4
 *         blockExtent[0].depth = 1             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorInvalidChannelDescriptor
 */
    (__pyx_v_blockExtent[0]).depth = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1192
 *         blockExtent[0].height = 1
 *         blockExtent[0].depth = 1
 *     elif format in (ccuda.CU_AD_FORMAT_BC1_UNORM,             # <<<<<<<<<<<<<<
 *                     ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB,
 *                     ccuda.CU_AD_FORMAT_BC4_UNORM,
 */
    break;
    default:

    /* "cuda/_lib/ccudart/utils.pyx":1210
 *         blockExtent[0].depth = 1
 *     else:
 *         return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
    __pyx_r = cudaErrorInvalidChannelDescriptor;
    goto __pyx_L0;
    break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1211
 *     else:
 *         return cudaErrorInvalidChannelDescriptor
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1167
 * 
 * 
 * cdef cudaError_t getArrayBlockExtent(cudaExtent *blockExtent, ccuda.CUarray_format format) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if format in (ccuda.CU_AD_FORMAT_FLOAT,
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT32,
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1214
 * 
 * 
 * cdef cudaError_t getLocalState(cudaArrayLocalState *state, cudaArray_const_t thisArray) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     memset(&arrayState, 0, sizeof(arrayState))
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_getLocalState(struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaArrayLocalState *__pyx_v_state, cudaArray_const_t __pyx_v_thisArray) {
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaArrayLocalState __pyx_v_arrayState;
  struct cudaExtent __pyx_v_compBlockExtent;
  CUDA_ARRAY3D_DESCRIPTOR_v2 __pyx_v_driverDesc;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __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("getLocalState", __pyx_f[0], 1214, 1, __PYX_ERR(0, 1214, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1216
 * cdef cudaError_t getLocalState(cudaArrayLocalState *state, cudaArray_const_t thisArray) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaArrayLocalState arrayState
 *     memset(&arrayState, 0, sizeof(arrayState))             # <<<<<<<<<<<<<<
 *     arrayState.array = <ccuda.CUarray>thisArray
 * 
 */
  (void)(memset((&__pyx_v_arrayState), 0, (sizeof(__pyx_v_arrayState))));

  /* "cuda/_lib/ccudart/utils.pyx":1217
 *     cdef cudaArrayLocalState arrayState
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     arrayState.array = <ccuda.CUarray>thisArray             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaExtent compBlockExtent
 */
  __pyx_v_arrayState.array = ((CUarray)__pyx_v_thisArray);

  /* "cuda/_lib/ccudart/utils.pyx":1220
 * 
 *     cdef cudaExtent compBlockExtent
 *     compBlockExtent.width = 1             # <<<<<<<<<<<<<<
 *     compBlockExtent.height = 1
 *     compBlockExtent.depth = 1
 */
  __pyx_v_compBlockExtent.width = 1;

  /* "cuda/_lib/ccudart/utils.pyx":1221
 *     cdef cudaExtent compBlockExtent
 *     compBlockExtent.width = 1
 *     compBlockExtent.height = 1             # <<<<<<<<<<<<<<
 *     compBlockExtent.depth = 1
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 driverDesc
 */
  __pyx_v_compBlockExtent.height = 1;

  /* "cuda/_lib/ccudart/utils.pyx":1222
 *     compBlockExtent.width = 1
 *     compBlockExtent.height = 1
 *     compBlockExtent.depth = 1             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 driverDesc
 *     memset(&driverDesc, 0, sizeof(driverDesc))
 */
  __pyx_v_compBlockExtent.depth = 1;

  /* "cuda/_lib/ccudart/utils.pyx":1224
 *     compBlockExtent.depth = 1
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 driverDesc
 *     memset(&driverDesc, 0, sizeof(driverDesc))             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>arrayState.array)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v_driverDesc), 0, (sizeof(__pyx_v_driverDesc))));

  /* "cuda/_lib/ccudart/utils.pyx":1225
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 driverDesc
 *     memset(&driverDesc, 0, sizeof(driverDesc))
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>arrayState.array)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuArray3DGetDescriptor_v2((&__pyx_v_driverDesc), ((CUarray)__pyx_v_arrayState.array)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1225, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/utils.pyx":1226
 *     memset(&driverDesc, 0, sizeof(driverDesc))
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>arrayState.array)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = getChannelFormatDescFromDriverDesc(&arrayState.desc, &arrayState.depth, &arrayState.height, &arrayState.width, &driverDesc)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1227
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>arrayState.array)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = getChannelFormatDescFromDriverDesc(&arrayState.desc, &arrayState.depth, &arrayState.height, &arrayState.width, &driverDesc)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1226
 *     memset(&driverDesc, 0, sizeof(driverDesc))
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>arrayState.array)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = getChannelFormatDescFromDriverDesc(&arrayState.desc, &arrayState.depth, &arrayState.height, &arrayState.width, &driverDesc)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1228
 *     if err != cudaSuccess:
 *         return err
 *     err = getChannelFormatDescFromDriverDesc(&arrayState.desc, &arrayState.depth, &arrayState.height, &arrayState.width, &driverDesc)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelFormatDescFromDriverDesc((&__pyx_v_arrayState.desc), (&__pyx_v_arrayState.depth), (&__pyx_v_arrayState.height), (&__pyx_v_arrayState.width), (&__pyx_v_driverDesc)); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1228, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":1229
 *         return err
 *     err = getChannelFormatDescFromDriverDesc(&arrayState.desc, &arrayState.depth, &arrayState.height, &arrayState.width, &driverDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = bytesPerElement(&arrayState.elementSize, driverDesc.NumChannels, driverDesc.Format)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1230
 *     err = getChannelFormatDescFromDriverDesc(&arrayState.desc, &arrayState.depth, &arrayState.height, &arrayState.width, &driverDesc)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = bytesPerElement(&arrayState.elementSize, driverDesc.NumChannels, driverDesc.Format)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1229
 *         return err
 *     err = getChannelFormatDescFromDriverDesc(&arrayState.desc, &arrayState.depth, &arrayState.height, &arrayState.width, &driverDesc)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = bytesPerElement(&arrayState.elementSize, driverDesc.NumChannels, driverDesc.Format)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1231
 *     if err != cudaSuccess:
 *         return err
 *     err = bytesPerElement(&arrayState.elementSize, driverDesc.NumChannels, driverDesc.Format)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_bytesPerElement((&__pyx_v_arrayState.elementSize), __pyx_v_driverDesc.NumChannels, __pyx_v_driverDesc.Format); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1231, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":1232
 *         return err
 *     err = bytesPerElement(&arrayState.elementSize, driverDesc.NumChannels, driverDesc.Format)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = getArrayBlockExtent(&compBlockExtent, driverDesc.Format)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1233
 *     err = bytesPerElement(&arrayState.elementSize, driverDesc.NumChannels, driverDesc.Format)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = getArrayBlockExtent(&compBlockExtent, driverDesc.Format)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1232
 *         return err
 *     err = bytesPerElement(&arrayState.elementSize, driverDesc.NumChannels, driverDesc.Format)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = getArrayBlockExtent(&compBlockExtent, driverDesc.Format)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1234
 *     if err != cudaSuccess:
 *         return err
 *     err = getArrayBlockExtent(&compBlockExtent, driverDesc.Format)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getArrayBlockExtent((&__pyx_v_compBlockExtent), __pyx_v_driverDesc.Format); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1234, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":1235
 *         return err
 *     err = getArrayBlockExtent(&compBlockExtent, driverDesc.Format)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     arrayState.widthInBytes = <size_t>((arrayState.width + compBlockExtent.width - 1) / compBlockExtent.width) * arrayState.elementSize
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1236
 *     err = getArrayBlockExtent(&compBlockExtent, driverDesc.Format)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     arrayState.widthInBytes = <size_t>((arrayState.width + compBlockExtent.width - 1) / compBlockExtent.width) * arrayState.elementSize
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1235
 *         return err
 *     err = getArrayBlockExtent(&compBlockExtent, driverDesc.Format)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     arrayState.widthInBytes = <size_t>((arrayState.width + compBlockExtent.width - 1) / compBlockExtent.width) * arrayState.elementSize
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1237
 *     if err != cudaSuccess:
 *         return err
 *     arrayState.widthInBytes = <size_t>((arrayState.width + compBlockExtent.width - 1) / compBlockExtent.width) * arrayState.elementSize             # <<<<<<<<<<<<<<
 * 
 *     state[0] = arrayState
 */
  __pyx_t_4 = ((__pyx_v_arrayState.width + __pyx_v_compBlockExtent.width) - 1);
  if (unlikely(__pyx_v_compBlockExtent.width == 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, 1237, __pyx_L1_error)
  }
  __pyx_v_arrayState.widthInBytes = (((size_t)(((double)__pyx_t_4) / ((double)__pyx_v_compBlockExtent.width))) * __pyx_v_arrayState.elementSize);

  /* "cuda/_lib/ccudart/utils.pyx":1239
 *     arrayState.widthInBytes = <size_t>((arrayState.width + compBlockExtent.width - 1) / compBlockExtent.width) * arrayState.elementSize
 * 
 *     state[0] = arrayState             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  (__pyx_v_state[0]) = __pyx_v_arrayState;

  /* "cuda/_lib/ccudart/utils.pyx":1240
 * 
 *     state[0] = arrayState
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1214
 * 
 * 
 * cdef cudaError_t getLocalState(cudaArrayLocalState *state, cudaArray_const_t thisArray) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     memset(&arrayState, 0, sizeof(arrayState))
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1243
 * 
 * 
 * cdef cudaError_t copyFromHost2D(cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *src, size_t spitch, size_t width, size_t height, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaArrayLocalState arrayState
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromHost2D(cudaArray_const_t __pyx_v_thisArray, size_t __pyx_v_hOffset, size_t __pyx_v_wOffset, char const *__pyx_v_src, size_t __pyx_v_spitch, size_t __pyx_v_width, size_t __pyx_v_height, CUstream __pyx_v_stream, bool __pyx_v_async) {
  cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaArrayLocalState __pyx_v_arrayState;
  CUDA_MEMCPY3D_v2 __pyx_v_cp;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUarray __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("copyFromHost2D", __pyx_f[0], 1243, 1, __PYX_ERR(0, 1243, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1244
 * 
 * cdef cudaError_t copyFromHost2D(cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *src, size_t spitch, size_t width, size_t height, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     memset(&arrayState, 0, sizeof(arrayState))
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":1246
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaArrayLocalState arrayState
 *     memset(&arrayState, 0, sizeof(arrayState))             # <<<<<<<<<<<<<<
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v_arrayState), 0, (sizeof(__pyx_v_arrayState))));

  /* "cuda/_lib/ccudart/utils.pyx":1247
 *     cdef cudaArrayLocalState arrayState
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getLocalState((&__pyx_v_arrayState), __pyx_v_thisArray); 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/utils.pyx":1248
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1249
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1248
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1250
 *     if err != cudaSuccess:
 *         return err
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)             # <<<<<<<<<<<<<<
 * 
 *     cp.dstArray      = arrayState.array
 */
  __pyx_v_cp = __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy3DInit(CU_MEMORYTYPE_ARRAY, CU_MEMORYTYPE_HOST);

  /* "cuda/_lib/ccudart/utils.pyx":1252
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)
 * 
 *     cp.dstArray      = arrayState.array             # <<<<<<<<<<<<<<
 *     cp.dstXInBytes   = wOffset
 *     cp.dstY          = hOffset
 */
  __pyx_t_3 = __pyx_v_arrayState.array;
  __pyx_v_cp.dstArray = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":1253
 * 
 *     cp.dstArray      = arrayState.array
 *     cp.dstXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *     cp.dstY          = hOffset
 * 
 */
  __pyx_v_cp.dstXInBytes = __pyx_v_wOffset;

  /* "cuda/_lib/ccudart/utils.pyx":1254
 *     cp.dstArray      = arrayState.array
 *     cp.dstXInBytes   = wOffset
 *     cp.dstY          = hOffset             # <<<<<<<<<<<<<<
 * 
 *     cp.srcHost       = src
 */
  __pyx_v_cp.dstY = __pyx_v_hOffset;

  /* "cuda/_lib/ccudart/utils.pyx":1256
 *     cp.dstY          = hOffset
 * 
 *     cp.srcHost       = src             # <<<<<<<<<<<<<<
 *     cp.srcPitch      = spitch
 *     cp.srcXInBytes   = 0
 */
  __pyx_v_cp.srcHost = __pyx_v_src;

  /* "cuda/_lib/ccudart/utils.pyx":1257
 * 
 *     cp.srcHost       = src
 *     cp.srcPitch      = spitch             # <<<<<<<<<<<<<<
 *     cp.srcXInBytes   = 0
 *     cp.srcY          = 0
 */
  __pyx_v_cp.srcPitch = __pyx_v_spitch;

  /* "cuda/_lib/ccudart/utils.pyx":1258
 *     cp.srcHost       = src
 *     cp.srcPitch      = spitch
 *     cp.srcXInBytes   = 0             # <<<<<<<<<<<<<<
 *     cp.srcY          = 0
 * 
 */
  __pyx_v_cp.srcXInBytes = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1259
 *     cp.srcPitch      = spitch
 *     cp.srcXInBytes   = 0
 *     cp.srcY          = 0             # <<<<<<<<<<<<<<
 * 
 *     cp.Height        = height
 */
  __pyx_v_cp.srcY = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1261
 *     cp.srcY          = 0
 * 
 *     cp.Height        = height             # <<<<<<<<<<<<<<
 *     cp.WidthInBytes  = width
 * 
 */
  __pyx_v_cp.Height = __pyx_v_height;

  /* "cuda/_lib/ccudart/utils.pyx":1262
 * 
 *     cp.Height        = height
 *     cp.WidthInBytes  = width             # <<<<<<<<<<<<<<
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 */
  __pyx_v_cp.WidthInBytes = __pyx_v_width;

  /* "cuda/_lib/ccudart/utils.pyx":1264
 *     cp.WidthInBytes  = width
 * 
 *     err = driverMemcpy3D(&cp, stream, async)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), __pyx_v_stream, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1264, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1265
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1243
 * 
 * 
 * cdef cudaError_t copyFromHost2D(cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *src, size_t spitch, size_t width, size_t height, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaArrayLocalState arrayState
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1268
 * 
 * 
 * cdef cudaError_t copyFromDevice2D(ccuda.CUmemorytype type, cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *src, size_t srcOffset,             # <<<<<<<<<<<<<<
 *         size_t spitch, size_t width, size_t height, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromDevice2D(CUmemorytype __pyx_v_type, cudaArray_const_t __pyx_v_thisArray, size_t __pyx_v_hOffset, size_t __pyx_v_wOffset, char const *__pyx_v_src, size_t __pyx_v_srcOffset, size_t __pyx_v_spitch, size_t __pyx_v_width, size_t __pyx_v_height, CUstream __pyx_v_stream, bool __pyx_v_async) {
  cudaError_t __pyx_v_err;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaArrayLocalState __pyx_v_arrayState;
  CUDA_MEMCPY3D_v2 __pyx_v_cp;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUarray __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("copyFromDevice2D", __pyx_f[0], 1268, 1, __PYX_ERR(0, 1268, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1270
 * cdef cudaError_t copyFromDevice2D(ccuda.CUmemorytype type, cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *src, size_t srcOffset,
 *         size_t spitch, size_t width, size_t height, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     memset(&arrayState, 0, sizeof(arrayState))
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":1272
 *     cdef cudaError_t err = cudaSuccess
 *     cdef cudaArrayLocalState arrayState
 *     memset(&arrayState, 0, sizeof(arrayState))             # <<<<<<<<<<<<<<
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v_arrayState), 0, (sizeof(__pyx_v_arrayState))));

  /* "cuda/_lib/ccudart/utils.pyx":1273
 *     cdef cudaArrayLocalState arrayState
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getLocalState((&__pyx_v_arrayState), __pyx_v_thisArray); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1273, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1274
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, type)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1275
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, type)
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1274
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, type)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1276
 *     if err != cudaSuccess:
 *         return err
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, type)             # <<<<<<<<<<<<<<
 * 
 *     cp.dstArray      = arrayState.array
 */
  __pyx_v_cp = __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy3DInit(CU_MEMORYTYPE_ARRAY, __pyx_v_type);

  /* "cuda/_lib/ccudart/utils.pyx":1278
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, type)
 * 
 *     cp.dstArray      = arrayState.array             # <<<<<<<<<<<<<<
 *     cp.dstXInBytes   = wOffset
 *     cp.dstY          = hOffset
 */
  __pyx_t_3 = __pyx_v_arrayState.array;
  __pyx_v_cp.dstArray = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":1279
 * 
 *     cp.dstArray      = arrayState.array
 *     cp.dstXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *     cp.dstY          = hOffset
 * 
 */
  __pyx_v_cp.dstXInBytes = __pyx_v_wOffset;

  /* "cuda/_lib/ccudart/utils.pyx":1280
 *     cp.dstArray      = arrayState.array
 *     cp.dstXInBytes   = wOffset
 *     cp.dstY          = hOffset             # <<<<<<<<<<<<<<
 * 
 *     cp.srcDevice     = <ccuda.CUdeviceptr_v2>src
 */
  __pyx_v_cp.dstY = __pyx_v_hOffset;

  /* "cuda/_lib/ccudart/utils.pyx":1282
 *     cp.dstY          = hOffset
 * 
 *     cp.srcDevice     = <ccuda.CUdeviceptr_v2>src             # <<<<<<<<<<<<<<
 *     cp.srcPitch      = spitch
 *     cp.srcXInBytes   = srcOffset % spitch
 */
  __pyx_v_cp.srcDevice = ((CUdeviceptr_v2)__pyx_v_src);

  /* "cuda/_lib/ccudart/utils.pyx":1283
 * 
 *     cp.srcDevice     = <ccuda.CUdeviceptr_v2>src
 *     cp.srcPitch      = spitch             # <<<<<<<<<<<<<<
 *     cp.srcXInBytes   = srcOffset % spitch
 *     cp.srcY          = <size_t>(srcOffset / spitch)
 */
  __pyx_v_cp.srcPitch = __pyx_v_spitch;

  /* "cuda/_lib/ccudart/utils.pyx":1284
 *     cp.srcDevice     = <ccuda.CUdeviceptr_v2>src
 *     cp.srcPitch      = spitch
 *     cp.srcXInBytes   = srcOffset % spitch             # <<<<<<<<<<<<<<
 *     cp.srcY          = <size_t>(srcOffset / spitch)
 * 
 */
  if (unlikely(__pyx_v_spitch == 0)) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 1284, __pyx_L1_error)
  }
  __pyx_v_cp.srcXInBytes = (__pyx_v_srcOffset % __pyx_v_spitch);

  /* "cuda/_lib/ccudart/utils.pyx":1285
 *     cp.srcPitch      = spitch
 *     cp.srcXInBytes   = srcOffset % spitch
 *     cp.srcY          = <size_t>(srcOffset / spitch)             # <<<<<<<<<<<<<<
 * 
 *     cp.Height        = height
 */
  if (unlikely(__pyx_v_spitch == 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, 1285, __pyx_L1_error)
  }
  __pyx_v_cp.srcY = ((size_t)(((double)__pyx_v_srcOffset) / ((double)__pyx_v_spitch)));

  /* "cuda/_lib/ccudart/utils.pyx":1287
 *     cp.srcY          = <size_t>(srcOffset / spitch)
 * 
 *     cp.Height        = height             # <<<<<<<<<<<<<<
 *     cp.WidthInBytes  = width
 * 
 */
  __pyx_v_cp.Height = __pyx_v_height;

  /* "cuda/_lib/ccudart/utils.pyx":1288
 * 
 *     cp.Height        = height
 *     cp.WidthInBytes  = width             # <<<<<<<<<<<<<<
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 */
  __pyx_v_cp.WidthInBytes = __pyx_v_width;

  /* "cuda/_lib/ccudart/utils.pyx":1290
 *     cp.WidthInBytes  = width
 * 
 *     err = driverMemcpy3D(&cp, stream, async)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), __pyx_v_stream, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1290, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1291
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1292
 *     err = driverMemcpy3D(&cp, stream, async)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1291
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1294
 *         return err
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1268
 * 
 * 
 * cdef cudaError_t copyFromDevice2D(ccuda.CUmemorytype type, cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *src, size_t srcOffset,             # <<<<<<<<<<<<<<
 *         size_t spitch, size_t width, size_t height, ccuda.CUstream stream, bool async) 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.utils.copyFromDevice2D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":1297
 * 
 * 
 * cdef cudaError_t copyToHost2D(cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, char *dst, size_t dpitch, size_t width,             # <<<<<<<<<<<<<<
 *         size_t height, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaArrayLocalState arrayState
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToHost2D(cudaArray_const_t __pyx_v_thisArray, size_t __pyx_v_hOffset, size_t __pyx_v_wOffset, char *__pyx_v_dst, size_t __pyx_v_dpitch, size_t __pyx_v_width, size_t __pyx_v_height, CUstream __pyx_v_stream, bool __pyx_v_async) {
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaArrayLocalState __pyx_v_arrayState;
  cudaError_t __pyx_v_err;
  CUDA_MEMCPY3D_v2 __pyx_v_cp;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUarray __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("copyToHost2D", __pyx_f[0], 1297, 1, __PYX_ERR(0, 1297, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1300
 *         size_t height, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":1301
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))             # <<<<<<<<<<<<<<
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v_arrayState), 0, (sizeof(__pyx_v_arrayState))));

  /* "cuda/_lib/ccudart/utils.pyx":1302
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getLocalState((&__pyx_v_arrayState), __pyx_v_thisArray); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1302, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1303
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1304
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1303
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1305
 *     if err != cudaSuccess:
 *         return err
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)             # <<<<<<<<<<<<<<
 * 
 *     cp.dstHost       = dst
 */
  __pyx_v_cp = __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy3DInit(CU_MEMORYTYPE_HOST, CU_MEMORYTYPE_ARRAY);

  /* "cuda/_lib/ccudart/utils.pyx":1307
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 * 
 *     cp.dstHost       = dst             # <<<<<<<<<<<<<<
 *     cp.dstPitch      = dpitch
 *     cp.dstXInBytes   = 0
 */
  __pyx_v_cp.dstHost = __pyx_v_dst;

  /* "cuda/_lib/ccudart/utils.pyx":1308
 * 
 *     cp.dstHost       = dst
 *     cp.dstPitch      = dpitch             # <<<<<<<<<<<<<<
 *     cp.dstXInBytes   = 0
 *     cp.dstY          = 0
 */
  __pyx_v_cp.dstPitch = __pyx_v_dpitch;

  /* "cuda/_lib/ccudart/utils.pyx":1309
 *     cp.dstHost       = dst
 *     cp.dstPitch      = dpitch
 *     cp.dstXInBytes   = 0             # <<<<<<<<<<<<<<
 *     cp.dstY          = 0
 * 
 */
  __pyx_v_cp.dstXInBytes = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1310
 *     cp.dstPitch      = dpitch
 *     cp.dstXInBytes   = 0
 *     cp.dstY          = 0             # <<<<<<<<<<<<<<
 * 
 *     cp.srcArray      = arrayState.array
 */
  __pyx_v_cp.dstY = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1312
 *     cp.dstY          = 0
 * 
 *     cp.srcArray      = arrayState.array             # <<<<<<<<<<<<<<
 *     cp.srcXInBytes   = wOffset
 *     cp.srcY          = hOffset
 */
  __pyx_t_3 = __pyx_v_arrayState.array;
  __pyx_v_cp.srcArray = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":1313
 * 
 *     cp.srcArray      = arrayState.array
 *     cp.srcXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *     cp.srcY          = hOffset
 * 
 */
  __pyx_v_cp.srcXInBytes = __pyx_v_wOffset;

  /* "cuda/_lib/ccudart/utils.pyx":1314
 *     cp.srcArray      = arrayState.array
 *     cp.srcXInBytes   = wOffset
 *     cp.srcY          = hOffset             # <<<<<<<<<<<<<<
 * 
 *     cp.Height        = height
 */
  __pyx_v_cp.srcY = __pyx_v_hOffset;

  /* "cuda/_lib/ccudart/utils.pyx":1316
 *     cp.srcY          = hOffset
 * 
 *     cp.Height        = height             # <<<<<<<<<<<<<<
 *     cp.WidthInBytes  = width
 * 
 */
  __pyx_v_cp.Height = __pyx_v_height;

  /* "cuda/_lib/ccudart/utils.pyx":1317
 * 
 *     cp.Height        = height
 *     cp.WidthInBytes  = width             # <<<<<<<<<<<<<<
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 */
  __pyx_v_cp.WidthInBytes = __pyx_v_width;

  /* "cuda/_lib/ccudart/utils.pyx":1319
 *     cp.WidthInBytes  = width
 * 
 *     err = driverMemcpy3D(&cp, stream, async)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), __pyx_v_stream, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1319, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1320
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1321
 *     err = driverMemcpy3D(&cp, stream, async)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1320
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1323
 *         return err
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1297
 * 
 * 
 * cdef cudaError_t copyToHost2D(cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, char *dst, size_t dpitch, size_t width,             # <<<<<<<<<<<<<<
 *         size_t height, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaArrayLocalState arrayState
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1326
 * 
 * 
 * cdef cudaError_t copyToDevice2D(ccuda.CUmemorytype type, cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *dst, size_t dstOffset, size_t dpitch,             # <<<<<<<<<<<<<<
 *         size_t width, size_t height, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToDevice2D(CUmemorytype __pyx_v_type, cudaArray_const_t __pyx_v_thisArray, size_t __pyx_v_hOffset, size_t __pyx_v_wOffset, char const *__pyx_v_dst, size_t __pyx_v_dstOffset, size_t __pyx_v_dpitch, size_t __pyx_v_width, size_t __pyx_v_height, CUstream __pyx_v_stream, bool __pyx_v_async) {
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaArrayLocalState __pyx_v_arrayState;
  cudaError_t __pyx_v_err;
  CUDA_MEMCPY3D_v2 __pyx_v_cp;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUarray __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("copyToDevice2D", __pyx_f[0], 1326, 1, __PYX_ERR(0, 1326, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1330
 * 
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":1331
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))             # <<<<<<<<<<<<<<
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v_arrayState), 0, (sizeof(__pyx_v_arrayState))));

  /* "cuda/_lib/ccudart/utils.pyx":1332
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getLocalState((&__pyx_v_arrayState), __pyx_v_thisArray); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1332, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1333
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(type, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1334
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(type, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1333
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(type, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1335
 *     if err != cudaSuccess:
 *         return err
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(type, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)             # <<<<<<<<<<<<<<
 * 
 *     cp.dstDevice     = <ccuda.CUdeviceptr_v2>dst
 */
  __pyx_v_cp = __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy3DInit(__pyx_v_type, CU_MEMORYTYPE_ARRAY);

  /* "cuda/_lib/ccudart/utils.pyx":1337
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(type, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 * 
 *     cp.dstDevice     = <ccuda.CUdeviceptr_v2>dst             # <<<<<<<<<<<<<<
 *     cp.dstPitch      = dpitch
 *     cp.dstXInBytes   = dstOffset % dpitch
 */
  __pyx_v_cp.dstDevice = ((CUdeviceptr_v2)__pyx_v_dst);

  /* "cuda/_lib/ccudart/utils.pyx":1338
 * 
 *     cp.dstDevice     = <ccuda.CUdeviceptr_v2>dst
 *     cp.dstPitch      = dpitch             # <<<<<<<<<<<<<<
 *     cp.dstXInBytes   = dstOffset % dpitch
 *     cp.dstY          = <size_t>(dstOffset / dpitch)
 */
  __pyx_v_cp.dstPitch = __pyx_v_dpitch;

  /* "cuda/_lib/ccudart/utils.pyx":1339
 *     cp.dstDevice     = <ccuda.CUdeviceptr_v2>dst
 *     cp.dstPitch      = dpitch
 *     cp.dstXInBytes   = dstOffset % dpitch             # <<<<<<<<<<<<<<
 *     cp.dstY          = <size_t>(dstOffset / dpitch)
 * 
 */
  if (unlikely(__pyx_v_dpitch == 0)) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 1339, __pyx_L1_error)
  }
  __pyx_v_cp.dstXInBytes = (__pyx_v_dstOffset % __pyx_v_dpitch);

  /* "cuda/_lib/ccudart/utils.pyx":1340
 *     cp.dstPitch      = dpitch
 *     cp.dstXInBytes   = dstOffset % dpitch
 *     cp.dstY          = <size_t>(dstOffset / dpitch)             # <<<<<<<<<<<<<<
 * 
 *     cp.srcArray      = arrayState.array
 */
  if (unlikely(__pyx_v_dpitch == 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, 1340, __pyx_L1_error)
  }
  __pyx_v_cp.dstY = ((size_t)(((double)__pyx_v_dstOffset) / ((double)__pyx_v_dpitch)));

  /* "cuda/_lib/ccudart/utils.pyx":1342
 *     cp.dstY          = <size_t>(dstOffset / dpitch)
 * 
 *     cp.srcArray      = arrayState.array             # <<<<<<<<<<<<<<
 *     cp.srcXInBytes   = wOffset
 *     cp.srcY          = hOffset
 */
  __pyx_t_3 = __pyx_v_arrayState.array;
  __pyx_v_cp.srcArray = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":1343
 * 
 *     cp.srcArray      = arrayState.array
 *     cp.srcXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *     cp.srcY          = hOffset
 * 
 */
  __pyx_v_cp.srcXInBytes = __pyx_v_wOffset;

  /* "cuda/_lib/ccudart/utils.pyx":1344
 *     cp.srcArray      = arrayState.array
 *     cp.srcXInBytes   = wOffset
 *     cp.srcY          = hOffset             # <<<<<<<<<<<<<<
 * 
 *     cp.Height        = height
 */
  __pyx_v_cp.srcY = __pyx_v_hOffset;

  /* "cuda/_lib/ccudart/utils.pyx":1346
 *     cp.srcY          = hOffset
 * 
 *     cp.Height        = height             # <<<<<<<<<<<<<<
 *     cp.WidthInBytes  = width
 * 
 */
  __pyx_v_cp.Height = __pyx_v_height;

  /* "cuda/_lib/ccudart/utils.pyx":1347
 * 
 *     cp.Height        = height
 *     cp.WidthInBytes  = width             # <<<<<<<<<<<<<<
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 */
  __pyx_v_cp.WidthInBytes = __pyx_v_width;

  /* "cuda/_lib/ccudart/utils.pyx":1349
 *     cp.WidthInBytes  = width
 * 
 *     err = driverMemcpy3D(&cp, stream, async)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), __pyx_v_stream, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1349, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1350
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1351
 *     err = driverMemcpy3D(&cp, stream, async)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1350
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1353
 *         return err
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1326
 * 
 * 
 * cdef cudaError_t copyToDevice2D(ccuda.CUmemorytype type, cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *dst, size_t dstOffset, size_t dpitch,             # <<<<<<<<<<<<<<
 *         size_t width, size_t height, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 * 
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1356
 * 
 * 
 * cdef cudaError_t copyToArray2D(cudaArray_const_t thisArray, size_t hOffsetSrc, size_t wOffsetSrc, cudaArray_t dst,             # <<<<<<<<<<<<<<
 *         size_t hOffsetDst, size_t wOffsetDst, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaArrayLocalState arrayState
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToArray2D(cudaArray_const_t __pyx_v_thisArray, size_t __pyx_v_hOffsetSrc, size_t __pyx_v_wOffsetSrc, cudaArray_t __pyx_v_dst, size_t __pyx_v_hOffsetDst, size_t __pyx_v_wOffsetDst, size_t __pyx_v_width, size_t __pyx_v_height) {
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaArrayLocalState __pyx_v_arrayState;
  cudaError_t __pyx_v_err;
  CUDA_MEMCPY3D_v2 __pyx_v_cp;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  CUarray __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("copyToArray2D", __pyx_f[0], 1356, 1, __PYX_ERR(0, 1356, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1359
 *         size_t hOffsetDst, size_t wOffsetDst, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":1360
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))             # <<<<<<<<<<<<<<
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v_arrayState), 0, (sizeof(__pyx_v_arrayState))));

  /* "cuda/_lib/ccudart/utils.pyx":1361
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getLocalState((&__pyx_v_arrayState), __pyx_v_thisArray); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1361, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1362
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1363
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1362
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1364
 *     if err != cudaSuccess:
 *         return err
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)             # <<<<<<<<<<<<<<
 * 
 *     cp.dstArray      = <ccuda.CUarray>dst
 */
  __pyx_v_cp = __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy3DInit(CU_MEMORYTYPE_ARRAY, CU_MEMORYTYPE_ARRAY);

  /* "cuda/_lib/ccudart/utils.pyx":1366
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 * 
 *     cp.dstArray      = <ccuda.CUarray>dst             # <<<<<<<<<<<<<<
 *     cp.dstXInBytes   = wOffsetDst
 *     cp.dstY          = hOffsetDst
 */
  __pyx_v_cp.dstArray = ((CUarray)__pyx_v_dst);

  /* "cuda/_lib/ccudart/utils.pyx":1367
 * 
 *     cp.dstArray      = <ccuda.CUarray>dst
 *     cp.dstXInBytes   = wOffsetDst             # <<<<<<<<<<<<<<
 *     cp.dstY          = hOffsetDst
 * 
 */
  __pyx_v_cp.dstXInBytes = __pyx_v_wOffsetDst;

  /* "cuda/_lib/ccudart/utils.pyx":1368
 *     cp.dstArray      = <ccuda.CUarray>dst
 *     cp.dstXInBytes   = wOffsetDst
 *     cp.dstY          = hOffsetDst             # <<<<<<<<<<<<<<
 * 
 *     cp.srcArray      = arrayState.array
 */
  __pyx_v_cp.dstY = __pyx_v_hOffsetDst;

  /* "cuda/_lib/ccudart/utils.pyx":1370
 *     cp.dstY          = hOffsetDst
 * 
 *     cp.srcArray      = arrayState.array             # <<<<<<<<<<<<<<
 *     cp.srcXInBytes   = wOffsetSrc
 *     cp.srcY          = hOffsetSrc
 */
  __pyx_t_3 = __pyx_v_arrayState.array;
  __pyx_v_cp.srcArray = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":1371
 * 
 *     cp.srcArray      = arrayState.array
 *     cp.srcXInBytes   = wOffsetSrc             # <<<<<<<<<<<<<<
 *     cp.srcY          = hOffsetSrc
 * 
 */
  __pyx_v_cp.srcXInBytes = __pyx_v_wOffsetSrc;

  /* "cuda/_lib/ccudart/utils.pyx":1372
 *     cp.srcArray      = arrayState.array
 *     cp.srcXInBytes   = wOffsetSrc
 *     cp.srcY          = hOffsetSrc             # <<<<<<<<<<<<<<
 * 
 *     cp.Height        = height
 */
  __pyx_v_cp.srcY = __pyx_v_hOffsetSrc;

  /* "cuda/_lib/ccudart/utils.pyx":1374
 *     cp.srcY          = hOffsetSrc
 * 
 *     cp.Height        = height             # <<<<<<<<<<<<<<
 *     cp.WidthInBytes  = width
 * 
 */
  __pyx_v_cp.Height = __pyx_v_height;

  /* "cuda/_lib/ccudart/utils.pyx":1375
 * 
 *     cp.Height        = height
 *     cp.WidthInBytes  = width             # <<<<<<<<<<<<<<
 * 
 *     err = driverMemcpy3D(&cp, NULL, False)
 */
  __pyx_v_cp.WidthInBytes = __pyx_v_width;

  /* "cuda/_lib/ccudart/utils.pyx":1377
 *     cp.WidthInBytes  = width
 * 
 *     err = driverMemcpy3D(&cp, NULL, False)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), NULL, 0); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1377, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1378
 * 
 *     err = driverMemcpy3D(&cp, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1379
 *     err = driverMemcpy3D(&cp, NULL, False)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1378
 * 
 *     err = driverMemcpy3D(&cp, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1381
 *         return err
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1356
 * 
 * 
 * cdef cudaError_t copyToArray2D(cudaArray_const_t thisArray, size_t hOffsetSrc, size_t wOffsetSrc, cudaArray_t dst,             # <<<<<<<<<<<<<<
 *         size_t hOffsetDst, size_t wOffsetDst, size_t width, size_t height) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaArrayLocalState arrayState
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1384
 * 
 * 
 * cdef cudaError_t copyToArray(cudaArray_const_t thisArray, size_t hOffsetSrc, size_t wOffsetSrc, cudaArray_t dst, size_t hOffsetDst,             # <<<<<<<<<<<<<<
 *         size_t wOffsetDst, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef void *tmp
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToArray(cudaArray_const_t __pyx_v_thisArray, size_t __pyx_v_hOffsetSrc, size_t __pyx_v_wOffsetSrc, cudaArray_t __pyx_v_dst, size_t __pyx_v_hOffsetDst, size_t __pyx_v_wOffsetDst, size_t __pyx_v_count) {
  void *__pyx_v_tmp;
  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("copyToArray", __pyx_f[0], 1384, 1, __PYX_ERR(0, 1384, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1387
 *         size_t wOffsetDst, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef void *tmp
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = cudaMalloc(&tmp, count)
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":1388
 *     cdef void *tmp
 *     cdef cudaError_t err = cudaSuccess
 *     err = cudaMalloc(&tmp, count)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_7ccudart_cudaMalloc((&__pyx_v_tmp), __pyx_v_count); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1388, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1389
 *     cdef cudaError_t err = cudaSuccess
 *     err = cudaMalloc(&tmp, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1390
 *     err = cudaMalloc(&tmp, count)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     err = cudaMemcpyFromArray(tmp, thisArray, wOffsetSrc, hOffsetSrc, count, cudaMemcpyDeviceToDevice)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1389
 *     cdef cudaError_t err = cudaSuccess
 *     err = cudaMalloc(&tmp, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1392
 *         return err
 * 
 *     err = cudaMemcpyFromArray(tmp, thisArray, wOffsetSrc, hOffsetSrc, count, cudaMemcpyDeviceToDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_7ccudart_cudaMemcpyFromArray(__pyx_v_tmp, __pyx_v_thisArray, __pyx_v_wOffsetSrc, __pyx_v_hOffsetSrc, __pyx_v_count, cudaMemcpyDeviceToDevice); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1392, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1393
 * 
 *     err = cudaMemcpyFromArray(tmp, thisArray, wOffsetSrc, hOffsetSrc, count, cudaMemcpyDeviceToDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = cudaMemcpyToArray(dst, wOffsetDst, hOffsetDst, tmp, count, cudaMemcpyDeviceToDevice)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1394
 *     err = cudaMemcpyFromArray(tmp, thisArray, wOffsetSrc, hOffsetSrc, count, cudaMemcpyDeviceToDevice)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = cudaMemcpyToArray(dst, wOffsetDst, hOffsetDst, tmp, count, cudaMemcpyDeviceToDevice)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1393
 * 
 *     err = cudaMemcpyFromArray(tmp, thisArray, wOffsetSrc, hOffsetSrc, count, cudaMemcpyDeviceToDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = cudaMemcpyToArray(dst, wOffsetDst, hOffsetDst, tmp, count, cudaMemcpyDeviceToDevice)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1395
 *     if err != cudaSuccess:
 *         return err
 *     err = cudaMemcpyToArray(dst, wOffsetDst, hOffsetDst, tmp, count, cudaMemcpyDeviceToDevice)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_7ccudart_cudaMemcpyToArray(__pyx_v_dst, __pyx_v_wOffsetDst, __pyx_v_hOffsetDst, __pyx_v_tmp, __pyx_v_count, cudaMemcpyDeviceToDevice); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1395, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1396
 *         return err
 *     err = cudaMemcpyToArray(dst, wOffsetDst, hOffsetDst, tmp, count, cudaMemcpyDeviceToDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = cudaFree(tmp)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1397
 *     err = cudaMemcpyToArray(dst, wOffsetDst, hOffsetDst, tmp, count, cudaMemcpyDeviceToDevice)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     err = cudaFree(tmp)
 *     if err != cudaSuccess:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1396
 *         return err
 *     err = cudaMemcpyToArray(dst, wOffsetDst, hOffsetDst, tmp, count, cudaMemcpyDeviceToDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = cudaFree(tmp)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1398
 *     if err != cudaSuccess:
 *         return err
 *     err = cudaFree(tmp)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_7ccudart_cudaFree(__pyx_v_tmp); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1398, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1399
 *         return err
 *     err = cudaFree(tmp)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     return cudaSuccess
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

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

    /* "cuda/_lib/ccudart/utils.pyx":1399
 *         return err
 *     err = cudaFree(tmp)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     return cudaSuccess
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1401
 *     if err != cudaSuccess:
 *         return err
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1384
 * 
 * 
 * cdef cudaError_t copyToArray(cudaArray_const_t thisArray, size_t hOffsetSrc, size_t wOffsetSrc, cudaArray_t dst, size_t hOffsetDst,             # <<<<<<<<<<<<<<
 *         size_t wOffsetDst, size_t count) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef void *tmp
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1404
 * 
 * 
 * cdef cudaError_t memcpyArrayToArray(cudaArray_t dst, size_t hOffsetDst, size_t wOffsetDst,             # <<<<<<<<<<<<<<
 *                                     cudaArray_const_t src, size_t hOffsetSrc, size_t wOffsetSrc,
 *                                     size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyArrayToArray(cudaArray_t __pyx_v_dst, size_t __pyx_v_hOffsetDst, size_t __pyx_v_wOffsetDst, cudaArray_const_t __pyx_v_src, size_t __pyx_v_hOffsetSrc, size_t __pyx_v_wOffsetSrc, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind) {
  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("memcpyArrayToArray", __pyx_f[0], 1404, 1, __PYX_ERR(0, 1404, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1407
 *                                     cudaArray_const_t src, size_t hOffsetSrc, size_t wOffsetSrc,
 *                                     size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if count == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if kind != cudaMemcpyDeviceToDevice and kind != cudaMemcpyDefault:
 */
  __pyx_t_1 = (__pyx_v_count == 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1408
 *                                     size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if count == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     if kind != cudaMemcpyDeviceToDevice and kind != cudaMemcpyDefault:
 *         return cudaErrorInvalidMemcpyDirection
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1407
 *                                     cudaArray_const_t src, size_t hOffsetSrc, size_t wOffsetSrc,
 *                                     size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if count == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if kind != cudaMemcpyDeviceToDevice and kind != cudaMemcpyDefault:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1409
 *     if count == 0:
 *         return cudaSuccess
 *     if kind != cudaMemcpyDeviceToDevice and kind != cudaMemcpyDefault:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidMemcpyDirection
 *     return copyToArray(src, hOffsetSrc, wOffsetSrc, dst, hOffsetDst, wOffsetDst, count)
 */
  switch (__pyx_v_kind) {
    case cudaMemcpyDeviceToDevice:
    case cudaMemcpyDefault:
    __pyx_t_1 = 0;
    break;
    default:
    __pyx_t_1 = 1;
    break;
  }
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1410
 *         return cudaSuccess
 *     if kind != cudaMemcpyDeviceToDevice and kind != cudaMemcpyDefault:
 *         return cudaErrorInvalidMemcpyDirection             # <<<<<<<<<<<<<<
 *     return copyToArray(src, hOffsetSrc, wOffsetSrc, dst, hOffsetDst, wOffsetDst, count)
 * 
 */
    __pyx_r = cudaErrorInvalidMemcpyDirection;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1409
 *     if count == 0:
 *         return cudaSuccess
 *     if kind != cudaMemcpyDeviceToDevice and kind != cudaMemcpyDefault:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidMemcpyDirection
 *     return copyToArray(src, hOffsetSrc, wOffsetSrc, dst, hOffsetDst, wOffsetDst, count)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1411
 *     if kind != cudaMemcpyDeviceToDevice and kind != cudaMemcpyDefault:
 *         return cudaErrorInvalidMemcpyDirection
 *     return copyToArray(src, hOffsetSrc, wOffsetSrc, dst, hOffsetDst, wOffsetDst, count)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToArray(__pyx_v_src, __pyx_v_hOffsetSrc, __pyx_v_wOffsetSrc, __pyx_v_dst, __pyx_v_hOffsetDst, __pyx_v_wOffsetDst, __pyx_v_count); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1411, __pyx_L1_error)
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1404
 * 
 * 
 * cdef cudaError_t memcpyArrayToArray(cudaArray_t dst, size_t hOffsetDst, size_t wOffsetDst,             # <<<<<<<<<<<<<<
 *                                     cudaArray_const_t src, size_t hOffsetSrc, size_t wOffsetSrc,
 *                                     size_t count, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1414
 * 
 * 
 * cdef cudaError_t getChannelDesc(cudaArray_const_t thisArray, cudaChannelFormatDesc *outDesc) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelDesc(cudaArray_const_t __pyx_v_thisArray, struct cudaChannelFormatDesc *__pyx_v_outDesc) {
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaArrayLocalState __pyx_v_arrayState;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  struct cudaChannelFormatDesc __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("getChannelDesc", __pyx_f[0], 1414, 1, __PYX_ERR(0, 1414, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1416
 * cdef cudaError_t getChannelDesc(cudaArray_const_t thisArray, cudaChannelFormatDesc *outDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":1417
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))             # <<<<<<<<<<<<<<
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v_arrayState), 0, (sizeof(__pyx_v_arrayState))));

  /* "cuda/_lib/ccudart/utils.pyx":1418
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getLocalState((&__pyx_v_arrayState), __pyx_v_thisArray); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1418, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1419
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     outDesc[0] = arrayState.desc
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1420
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     outDesc[0] = arrayState.desc
 *     return cudaSuccess
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1419
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     outDesc[0] = arrayState.desc
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1421
 *     if err != cudaSuccess:
 *         return err
 *     outDesc[0] = arrayState.desc             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  __pyx_t_3 = __pyx_v_arrayState.desc;
  (__pyx_v_outDesc[0]) = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":1422
 *         return err
 *     outDesc[0] = arrayState.desc
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1414
 * 
 * 
 * cdef cudaError_t getChannelDesc(cudaArray_const_t thisArray, cudaChannelFormatDesc *outDesc) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     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.utils.getChannelDesc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":1425
 * 
 * 
 * cdef cudaError_t getFormat(cudaArray_const_t thisArray, int &numberOfChannels, ccuda.CUarray_format *format) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_getFormat(cudaArray_const_t __pyx_v_thisArray, int &__pyx_v_numberOfChannels, CUarray_format *__pyx_v_format) {
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaArrayLocalState __pyx_v_arrayState;
  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("getFormat", __pyx_f[0], 1425, 1, __PYX_ERR(0, 1425, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1427
 * cdef cudaError_t getFormat(cudaArray_const_t thisArray, int &numberOfChannels, ccuda.CUarray_format *format) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":1428
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))             # <<<<<<<<<<<<<<
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v_arrayState), 0, (sizeof(__pyx_v_arrayState))));

  /* "cuda/_lib/ccudart/utils.pyx":1429
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getLocalState((&__pyx_v_arrayState), __pyx_v_thisArray); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1429, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1430
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     return getDescInfo(&arrayState.desc, <int*>&numberOfChannels, <ccuda.CUarray_format*>format)
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1431
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     return getDescInfo(&arrayState.desc, <int*>&numberOfChannels, <ccuda.CUarray_format*>format)
 * 
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1430
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     return getDescInfo(&arrayState.desc, <int*>&numberOfChannels, <ccuda.CUarray_format*>format)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1432
 *     if err != cudaSuccess:
 *         return err
 *     return getDescInfo(&arrayState.desc, <int*>&numberOfChannels, <ccuda.CUarray_format*>format)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo((&__pyx_v_arrayState.desc), ((int *)(&__pyx_v_numberOfChannels)), ((CUarray_format *)__pyx_v_format)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1432, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1425
 * 
 * 
 * cdef cudaError_t getFormat(cudaArray_const_t thisArray, int &numberOfChannels, ccuda.CUarray_format *format) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     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.utils.getFormat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":1435
 * 
 * 
 * cdef cudaError_t getDriverResDescFromResDesc(ccuda.CUDA_RESOURCE_DESC *rdDst, const cudaResourceDesc *rdSrc,             # <<<<<<<<<<<<<<
 *                                              ccuda.CUDA_TEXTURE_DESC *tdDst, const cudaTextureDesc *tdSrc,
 *                                              ccuda.CUDA_RESOURCE_VIEW_DESC *rvdDst, const cudaResourceViewDesc *rvdSrc) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverResDescFromResDesc(CUDA_RESOURCE_DESC *__pyx_v_rdDst, struct cudaResourceDesc const *__pyx_v_rdSrc, CUDA_TEXTURE_DESC *__pyx_v_tdDst, struct cudaTextureDesc const *__pyx_v_tdSrc, CUDA_RESOURCE_VIEW_DESC *__pyx_v_rvdDst, struct cudaResourceViewDesc const *__pyx_v_rvdSrc) {
  int __pyx_v_i;
  int __pyx_v_numChannels;
  CUarray_format __pyx_v_format;
  CUarray __pyx_v_hArray;
  cudaError_t __pyx_v_err;
  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_t_5;
  float __pyx_t_6;
  unsigned int __pyx_t_7;
  long __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("getDriverResDescFromResDesc", __pyx_f[0], 1435, 1, __PYX_ERR(0, 1435, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1438
 *                                              ccuda.CUDA_TEXTURE_DESC *tdDst, const cudaTextureDesc *tdSrc,
 *                                              ccuda.CUDA_RESOURCE_VIEW_DESC *rvdDst, const cudaResourceViewDesc *rvdSrc) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef int i = 0             # <<<<<<<<<<<<<<
 *     cdef int numChannels = 0
 *     cdef ccuda.CUarray_format format
 */
  __pyx_v_i = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1439
 *                                              ccuda.CUDA_RESOURCE_VIEW_DESC *rvdDst, const cudaResourceViewDesc *rvdSrc) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef int i = 0
 *     cdef int numChannels = 0             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUarray_format format
 *     cdef ccuda.CUarray hArray = NULL
 */
  __pyx_v_numChannels = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1441
 *     cdef int numChannels = 0
 *     cdef ccuda.CUarray_format format
 *     cdef ccuda.CUarray hArray = NULL             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     i = 0
 */
  __pyx_v_hArray = NULL;

  /* "cuda/_lib/ccudart/utils.pyx":1442
 *     cdef ccuda.CUarray_format format
 *     cdef ccuda.CUarray hArray = NULL
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     i = 0
 * 
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":1443
 *     cdef ccuda.CUarray hArray = NULL
 *     cdef cudaError_t err = cudaSuccess
 *     i = 0             # <<<<<<<<<<<<<<
 * 
 *     memset(rdDst, 0, sizeof(rdDst[0]))
 */
  __pyx_v_i = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1445
 *     i = 0
 * 
 *     memset(rdDst, 0, sizeof(rdDst[0]))             # <<<<<<<<<<<<<<
 * 
 *     if rdSrc[0].resType == cudaResourceType.cudaResourceTypeArray:
 */
  (void)(memset(__pyx_v_rdDst, 0, (sizeof((__pyx_v_rdDst[0])))));

  /* "cuda/_lib/ccudart/utils.pyx":1447
 *     memset(rdDst, 0, sizeof(rdDst[0]))
 * 
 *     if rdSrc[0].resType == cudaResourceType.cudaResourceTypeArray:             # <<<<<<<<<<<<<<
 *         rdDst[0].resType          = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY
 *         rdDst[0].res.array.hArray = <ccuda.CUarray>rdSrc[0].res.array.array
 */
  __pyx_t_1 = ((__pyx_v_rdSrc[0]).resType == cudaResourceTypeArray);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1448
 * 
 *     if rdSrc[0].resType == cudaResourceType.cudaResourceTypeArray:
 *         rdDst[0].resType          = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY             # <<<<<<<<<<<<<<
 *         rdDst[0].res.array.hArray = <ccuda.CUarray>rdSrc[0].res.array.array
 *         err = getFormat(rdSrc[0].res.array.array, numChannels, &format)
 */
    (__pyx_v_rdDst[0]).resType = CU_RESOURCE_TYPE_ARRAY;

    /* "cuda/_lib/ccudart/utils.pyx":1449
 *     if rdSrc[0].resType == cudaResourceType.cudaResourceTypeArray:
 *         rdDst[0].resType          = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY
 *         rdDst[0].res.array.hArray = <ccuda.CUarray>rdSrc[0].res.array.array             # <<<<<<<<<<<<<<
 *         err = getFormat(rdSrc[0].res.array.array, numChannels, &format)
 *         if err != cudaSuccess:
 */
    (__pyx_v_rdDst[0]).res.array.hArray = ((CUarray)(__pyx_v_rdSrc[0]).res.array.array);

    /* "cuda/_lib/ccudart/utils.pyx":1450
 *         rdDst[0].resType          = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY
 *         rdDst[0].res.array.hArray = <ccuda.CUarray>rdSrc[0].res.array.array
 *         err = getFormat(rdSrc[0].res.array.array, numChannels, &format)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getFormat((__pyx_v_rdSrc[0]).res.array.array, __pyx_v_numChannels, (&__pyx_v_format)); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1450, __pyx_L1_error)
    __pyx_v_err = __pyx_t_2;

    /* "cuda/_lib/ccudart/utils.pyx":1451
 *         rdDst[0].res.array.hArray = <ccuda.CUarray>rdSrc[0].res.array.array
 *         err = getFormat(rdSrc[0].res.array.array, numChannels, &format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypeMipmappedArray:
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1452
 *         err = getFormat(rdSrc[0].res.array.array, numChannels, &format)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypeMipmappedArray:
 *         rdDst[0].resType                    = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1451
 *         rdDst[0].res.array.hArray = <ccuda.CUarray>rdSrc[0].res.array.array
 *         err = getFormat(rdSrc[0].res.array.array, numChannels, &format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypeMipmappedArray:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1447
 *     memset(rdDst, 0, sizeof(rdDst[0]))
 * 
 *     if rdSrc[0].resType == cudaResourceType.cudaResourceTypeArray:             # <<<<<<<<<<<<<<
 *         rdDst[0].resType          = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY
 *         rdDst[0].res.array.hArray = <ccuda.CUarray>rdSrc[0].res.array.array
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1453
 *         if err != cudaSuccess:
 *             return err
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypeMipmappedArray:             # <<<<<<<<<<<<<<
 *         rdDst[0].resType                    = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY
 *         rdDst[0].res.mipmap.hMipmappedArray = <ccuda.CUmipmappedArray>rdSrc[0].res.mipmap.mipmap
 */
  __pyx_t_1 = ((__pyx_v_rdSrc[0]).resType == cudaResourceTypeMipmappedArray);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1454
 *             return err
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypeMipmappedArray:
 *         rdDst[0].resType                    = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY             # <<<<<<<<<<<<<<
 *         rdDst[0].res.mipmap.hMipmappedArray = <ccuda.CUmipmappedArray>rdSrc[0].res.mipmap.mipmap
 *         err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(&hArray, rdDst[0].res.mipmap.hMipmappedArray, 0)
 */
    (__pyx_v_rdDst[0]).resType = CU_RESOURCE_TYPE_MIPMAPPED_ARRAY;

    /* "cuda/_lib/ccudart/utils.pyx":1455
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypeMipmappedArray:
 *         rdDst[0].resType                    = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY
 *         rdDst[0].res.mipmap.hMipmappedArray = <ccuda.CUmipmappedArray>rdSrc[0].res.mipmap.mipmap             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(&hArray, rdDst[0].res.mipmap.hMipmappedArray, 0)
 *         if err != cudaSuccess:
 */
    (__pyx_v_rdDst[0]).res.mipmap.hMipmappedArray = ((CUmipmappedArray)(__pyx_v_rdSrc[0]).res.mipmap.mipmap);

    /* "cuda/_lib/ccudart/utils.pyx":1456
 *         rdDst[0].resType                    = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY
 *         rdDst[0].res.mipmap.hMipmappedArray = <ccuda.CUmipmappedArray>rdSrc[0].res.mipmap.mipmap
 *         err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(&hArray, rdDst[0].res.mipmap.hMipmappedArray, 0)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetLevel((&__pyx_v_hArray), (__pyx_v_rdDst[0]).res.mipmap.hMipmappedArray, 0); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1456, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":1457
 *         rdDst[0].res.mipmap.hMipmappedArray = <ccuda.CUmipmappedArray>rdSrc[0].res.mipmap.mipmap
 *         err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(&hArray, rdDst[0].res.mipmap.hMipmappedArray, 0)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getFormat(<cudaArray_t>hArray, numChannels, &format)
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1458
 *         err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(&hArray, rdDst[0].res.mipmap.hMipmappedArray, 0)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         err = getFormat(<cudaArray_t>hArray, numChannels, &format)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1457
 *         rdDst[0].res.mipmap.hMipmappedArray = <ccuda.CUmipmappedArray>rdSrc[0].res.mipmap.mipmap
 *         err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(&hArray, rdDst[0].res.mipmap.hMipmappedArray, 0)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getFormat(<cudaArray_t>hArray, numChannels, &format)
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1459
 *         if err != cudaSuccess:
 *             return err
 *         err = getFormat(<cudaArray_t>hArray, numChannels, &format)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getFormat(((cudaArray_t)__pyx_v_hArray), __pyx_v_numChannels, (&__pyx_v_format)); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1459, __pyx_L1_error)
    __pyx_v_err = __pyx_t_2;

    /* "cuda/_lib/ccudart/utils.pyx":1460
 *             return err
 *         err = getFormat(<cudaArray_t>hArray, numChannels, &format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypeLinear:
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1461
 *         err = getFormat(<cudaArray_t>hArray, numChannels, &format)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypeLinear:
 *         rdDst[0].resType                = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1460
 *             return err
 *         err = getFormat(<cudaArray_t>hArray, numChannels, &format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypeLinear:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1453
 *         if err != cudaSuccess:
 *             return err
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypeMipmappedArray:             # <<<<<<<<<<<<<<
 *         rdDst[0].resType                    = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY
 *         rdDst[0].res.mipmap.hMipmappedArray = <ccuda.CUmipmappedArray>rdSrc[0].res.mipmap.mipmap
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1462
 *         if err != cudaSuccess:
 *             return err
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypeLinear:             # <<<<<<<<<<<<<<
 *         rdDst[0].resType                = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR
 *         rdDst[0].res.linear.devPtr      = <ccuda.CUdeviceptr_v2>rdSrc[0].res.linear.devPtr
 */
  __pyx_t_1 = ((__pyx_v_rdSrc[0]).resType == cudaResourceTypeLinear);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1463
 *             return err
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypeLinear:
 *         rdDst[0].resType                = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR             # <<<<<<<<<<<<<<
 *         rdDst[0].res.linear.devPtr      = <ccuda.CUdeviceptr_v2>rdSrc[0].res.linear.devPtr
 *         rdDst[0].res.linear.sizeInBytes = rdSrc[0].res.linear.sizeInBytes
 */
    (__pyx_v_rdDst[0]).resType = CU_RESOURCE_TYPE_LINEAR;

    /* "cuda/_lib/ccudart/utils.pyx":1464
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypeLinear:
 *         rdDst[0].resType                = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR
 *         rdDst[0].res.linear.devPtr      = <ccuda.CUdeviceptr_v2>rdSrc[0].res.linear.devPtr             # <<<<<<<<<<<<<<
 *         rdDst[0].res.linear.sizeInBytes = rdSrc[0].res.linear.sizeInBytes
 *         err = getDescInfo(&rdSrc[0].res.linear.desc, <int*>&numChannels, <ccuda.CUarray_format*>&format)
 */
    (__pyx_v_rdDst[0]).res.linear.devPtr = ((CUdeviceptr_v2)(__pyx_v_rdSrc[0]).res.linear.devPtr);

    /* "cuda/_lib/ccudart/utils.pyx":1465
 *         rdDst[0].resType                = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR
 *         rdDst[0].res.linear.devPtr      = <ccuda.CUdeviceptr_v2>rdSrc[0].res.linear.devPtr
 *         rdDst[0].res.linear.sizeInBytes = rdSrc[0].res.linear.sizeInBytes             # <<<<<<<<<<<<<<
 *         err = getDescInfo(&rdSrc[0].res.linear.desc, <int*>&numChannels, <ccuda.CUarray_format*>&format)
 *         if err != cudaSuccess:
 */
    __pyx_t_4 = (__pyx_v_rdSrc[0]).res.linear.sizeInBytes;
    (__pyx_v_rdDst[0]).res.linear.sizeInBytes = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1466
 *         rdDst[0].res.linear.devPtr      = <ccuda.CUdeviceptr_v2>rdSrc[0].res.linear.devPtr
 *         rdDst[0].res.linear.sizeInBytes = rdSrc[0].res.linear.sizeInBytes
 *         err = getDescInfo(&rdSrc[0].res.linear.desc, <int*>&numChannels, <ccuda.CUarray_format*>&format)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo((&(__pyx_v_rdSrc[0]).res.linear.desc), ((int *)(&__pyx_v_numChannels)), ((CUarray_format *)(&__pyx_v_format))); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1466, __pyx_L1_error)
    __pyx_v_err = __pyx_t_2;

    /* "cuda/_lib/ccudart/utils.pyx":1467
 *         rdDst[0].res.linear.sizeInBytes = rdSrc[0].res.linear.sizeInBytes
 *         err = getDescInfo(&rdSrc[0].res.linear.desc, <int*>&numChannels, <ccuda.CUarray_format*>&format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         rdDst[0].res.linear.format      = format
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1468
 *         err = getDescInfo(&rdSrc[0].res.linear.desc, <int*>&numChannels, <ccuda.CUarray_format*>&format)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         rdDst[0].res.linear.format      = format
 *         rdDst[0].res.linear.numChannels = numChannels
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1467
 *         rdDst[0].res.linear.sizeInBytes = rdSrc[0].res.linear.sizeInBytes
 *         err = getDescInfo(&rdSrc[0].res.linear.desc, <int*>&numChannels, <ccuda.CUarray_format*>&format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         rdDst[0].res.linear.format      = format
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1469
 *         if err != cudaSuccess:
 *             return err
 *         rdDst[0].res.linear.format      = format             # <<<<<<<<<<<<<<
 *         rdDst[0].res.linear.numChannels = numChannels
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypePitch2D:
 */
    (__pyx_v_rdDst[0]).res.linear.format = __pyx_v_format;

    /* "cuda/_lib/ccudart/utils.pyx":1470
 *             return err
 *         rdDst[0].res.linear.format      = format
 *         rdDst[0].res.linear.numChannels = numChannels             # <<<<<<<<<<<<<<
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypePitch2D:
 *         rdDst[0].resType                  = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D
 */
    (__pyx_v_rdDst[0]).res.linear.numChannels = __pyx_v_numChannels;

    /* "cuda/_lib/ccudart/utils.pyx":1462
 *         if err != cudaSuccess:
 *             return err
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypeLinear:             # <<<<<<<<<<<<<<
 *         rdDst[0].resType                = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR
 *         rdDst[0].res.linear.devPtr      = <ccuda.CUdeviceptr_v2>rdSrc[0].res.linear.devPtr
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1471
 *         rdDst[0].res.linear.format      = format
 *         rdDst[0].res.linear.numChannels = numChannels
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypePitch2D:             # <<<<<<<<<<<<<<
 *         rdDst[0].resType                  = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D
 *         rdDst[0].res.pitch2D.devPtr       = <ccuda.CUdeviceptr_v2>rdSrc[0].res.pitch2D.devPtr
 */
  __pyx_t_1 = ((__pyx_v_rdSrc[0]).resType == cudaResourceTypePitch2D);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1472
 *         rdDst[0].res.linear.numChannels = numChannels
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypePitch2D:
 *         rdDst[0].resType                  = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D             # <<<<<<<<<<<<<<
 *         rdDst[0].res.pitch2D.devPtr       = <ccuda.CUdeviceptr_v2>rdSrc[0].res.pitch2D.devPtr
 *         rdDst[0].res.pitch2D.pitchInBytes = rdSrc[0].res.pitch2D.pitchInBytes
 */
    (__pyx_v_rdDst[0]).resType = CU_RESOURCE_TYPE_PITCH2D;

    /* "cuda/_lib/ccudart/utils.pyx":1473
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypePitch2D:
 *         rdDst[0].resType                  = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D
 *         rdDst[0].res.pitch2D.devPtr       = <ccuda.CUdeviceptr_v2>rdSrc[0].res.pitch2D.devPtr             # <<<<<<<<<<<<<<
 *         rdDst[0].res.pitch2D.pitchInBytes = rdSrc[0].res.pitch2D.pitchInBytes
 *         rdDst[0].res.pitch2D.width        = rdSrc[0].res.pitch2D.width
 */
    (__pyx_v_rdDst[0]).res.pitch2D.devPtr = ((CUdeviceptr_v2)(__pyx_v_rdSrc[0]).res.pitch2D.devPtr);

    /* "cuda/_lib/ccudart/utils.pyx":1474
 *         rdDst[0].resType                  = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D
 *         rdDst[0].res.pitch2D.devPtr       = <ccuda.CUdeviceptr_v2>rdSrc[0].res.pitch2D.devPtr
 *         rdDst[0].res.pitch2D.pitchInBytes = rdSrc[0].res.pitch2D.pitchInBytes             # <<<<<<<<<<<<<<
 *         rdDst[0].res.pitch2D.width        = rdSrc[0].res.pitch2D.width
 *         rdDst[0].res.pitch2D.height       = rdSrc[0].res.pitch2D.height
 */
    __pyx_t_4 = (__pyx_v_rdSrc[0]).res.pitch2D.pitchInBytes;
    (__pyx_v_rdDst[0]).res.pitch2D.pitchInBytes = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1475
 *         rdDst[0].res.pitch2D.devPtr       = <ccuda.CUdeviceptr_v2>rdSrc[0].res.pitch2D.devPtr
 *         rdDst[0].res.pitch2D.pitchInBytes = rdSrc[0].res.pitch2D.pitchInBytes
 *         rdDst[0].res.pitch2D.width        = rdSrc[0].res.pitch2D.width             # <<<<<<<<<<<<<<
 *         rdDst[0].res.pitch2D.height       = rdSrc[0].res.pitch2D.height
 *         err = getDescInfo(&rdSrc[0].res.linear.desc, <int*>&numChannels, <ccuda.CUarray_format*>&format)
 */
    __pyx_t_4 = (__pyx_v_rdSrc[0]).res.pitch2D.width;
    (__pyx_v_rdDst[0]).res.pitch2D.width = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1476
 *         rdDst[0].res.pitch2D.pitchInBytes = rdSrc[0].res.pitch2D.pitchInBytes
 *         rdDst[0].res.pitch2D.width        = rdSrc[0].res.pitch2D.width
 *         rdDst[0].res.pitch2D.height       = rdSrc[0].res.pitch2D.height             # <<<<<<<<<<<<<<
 *         err = getDescInfo(&rdSrc[0].res.linear.desc, <int*>&numChannels, <ccuda.CUarray_format*>&format)
 *         if err != cudaSuccess:
 */
    __pyx_t_4 = (__pyx_v_rdSrc[0]).res.pitch2D.height;
    (__pyx_v_rdDst[0]).res.pitch2D.height = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1477
 *         rdDst[0].res.pitch2D.width        = rdSrc[0].res.pitch2D.width
 *         rdDst[0].res.pitch2D.height       = rdSrc[0].res.pitch2D.height
 *         err = getDescInfo(&rdSrc[0].res.linear.desc, <int*>&numChannels, <ccuda.CUarray_format*>&format)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo((&(__pyx_v_rdSrc[0]).res.linear.desc), ((int *)(&__pyx_v_numChannels)), ((CUarray_format *)(&__pyx_v_format))); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1477, __pyx_L1_error)
    __pyx_v_err = __pyx_t_2;

    /* "cuda/_lib/ccudart/utils.pyx":1478
 *         rdDst[0].res.pitch2D.height       = rdSrc[0].res.pitch2D.height
 *         err = getDescInfo(&rdSrc[0].res.linear.desc, <int*>&numChannels, <ccuda.CUarray_format*>&format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         rdDst[0].res.pitch2D.format       = format
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1479
 *         err = getDescInfo(&rdSrc[0].res.linear.desc, <int*>&numChannels, <ccuda.CUarray_format*>&format)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         rdDst[0].res.pitch2D.format       = format
 *         rdDst[0].res.pitch2D.numChannels  = numChannels
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1478
 *         rdDst[0].res.pitch2D.height       = rdSrc[0].res.pitch2D.height
 *         err = getDescInfo(&rdSrc[0].res.linear.desc, <int*>&numChannels, <ccuda.CUarray_format*>&format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         rdDst[0].res.pitch2D.format       = format
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1480
 *         if err != cudaSuccess:
 *             return err
 *         rdDst[0].res.pitch2D.format       = format             # <<<<<<<<<<<<<<
 *         rdDst[0].res.pitch2D.numChannels  = numChannels
 *     else:
 */
    (__pyx_v_rdDst[0]).res.pitch2D.format = __pyx_v_format;

    /* "cuda/_lib/ccudart/utils.pyx":1481
 *             return err
 *         rdDst[0].res.pitch2D.format       = format
 *         rdDst[0].res.pitch2D.numChannels  = numChannels             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorInvalidValue
 */
    (__pyx_v_rdDst[0]).res.pitch2D.numChannels = __pyx_v_numChannels;

    /* "cuda/_lib/ccudart/utils.pyx":1471
 *         rdDst[0].res.linear.format      = format
 *         rdDst[0].res.linear.numChannels = numChannels
 *     elif rdSrc[0].resType == cudaResourceType.cudaResourceTypePitch2D:             # <<<<<<<<<<<<<<
 *         rdDst[0].resType                  = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D
 *         rdDst[0].res.pitch2D.devPtr       = <ccuda.CUdeviceptr_v2>rdSrc[0].res.pitch2D.devPtr
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1483
 *         rdDst[0].res.pitch2D.numChannels  = numChannels
 *     else:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "cuda/_lib/ccudart/utils.pyx":1486
 * 
 * 
 *     rdDst[0].flags = 0             # <<<<<<<<<<<<<<
 * 
 *     if tdDst and tdSrc:
 */
  (__pyx_v_rdDst[0]).flags = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1488
 *     rdDst[0].flags = 0
 * 
 *     if tdDst and tdSrc:             # <<<<<<<<<<<<<<
 *         memset(tdDst, 0, sizeof(tdDst[0]))
 * 
 */
  __pyx_t_5 = (__pyx_v_tdDst != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_t_5 = (__pyx_v_tdSrc != 0);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L10_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1489
 * 
 *     if tdDst and tdSrc:
 *         memset(tdDst, 0, sizeof(tdDst[0]))             # <<<<<<<<<<<<<<
 * 
 *         while (i < 3):
 */
    (void)(memset(__pyx_v_tdDst, 0, (sizeof((__pyx_v_tdDst[0])))));

    /* "cuda/_lib/ccudart/utils.pyx":1491
 *         memset(tdDst, 0, sizeof(tdDst[0]))
 * 
 *         while (i < 3):             # <<<<<<<<<<<<<<
 *             tdDst[0].addressMode[i] = <ccuda.CUaddress_mode>tdSrc[0].addressMode[i]
 *             i += 1
 */
    while (1) {
      __pyx_t_1 = (__pyx_v_i < 3);
      if (!__pyx_t_1) break;

      /* "cuda/_lib/ccudart/utils.pyx":1492
 * 
 *         while (i < 3):
 *             tdDst[0].addressMode[i] = <ccuda.CUaddress_mode>tdSrc[0].addressMode[i]             # <<<<<<<<<<<<<<
 *             i += 1
 * 
 */
      ((__pyx_v_tdDst[0]).addressMode[__pyx_v_i]) = ((CUaddress_mode)((__pyx_v_tdSrc[0]).addressMode[__pyx_v_i]));

      /* "cuda/_lib/ccudart/utils.pyx":1493
 *         while (i < 3):
 *             tdDst[0].addressMode[i] = <ccuda.CUaddress_mode>tdSrc[0].addressMode[i]
 *             i += 1             # <<<<<<<<<<<<<<
 * 
 *         tdDst[0].filterMode          = <ccuda.CUfilter_mode>tdSrc[0].filterMode
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }

    /* "cuda/_lib/ccudart/utils.pyx":1495
 *             i += 1
 * 
 *         tdDst[0].filterMode          = <ccuda.CUfilter_mode>tdSrc[0].filterMode             # <<<<<<<<<<<<<<
 *         tdDst[0].mipmapFilterMode    = <ccuda.CUfilter_mode>tdSrc[0].mipmapFilterMode
 *         tdDst[0].mipmapLevelBias     = tdSrc[0].mipmapLevelBias
 */
    (__pyx_v_tdDst[0]).filterMode = ((CUfilter_mode)(__pyx_v_tdSrc[0]).filterMode);

    /* "cuda/_lib/ccudart/utils.pyx":1496
 * 
 *         tdDst[0].filterMode          = <ccuda.CUfilter_mode>tdSrc[0].filterMode
 *         tdDst[0].mipmapFilterMode    = <ccuda.CUfilter_mode>tdSrc[0].mipmapFilterMode             # <<<<<<<<<<<<<<
 *         tdDst[0].mipmapLevelBias     = tdSrc[0].mipmapLevelBias
 *         tdDst[0].minMipmapLevelClamp = tdSrc[0].minMipmapLevelClamp
 */
    (__pyx_v_tdDst[0]).mipmapFilterMode = ((CUfilter_mode)(__pyx_v_tdSrc[0]).mipmapFilterMode);

    /* "cuda/_lib/ccudart/utils.pyx":1497
 *         tdDst[0].filterMode          = <ccuda.CUfilter_mode>tdSrc[0].filterMode
 *         tdDst[0].mipmapFilterMode    = <ccuda.CUfilter_mode>tdSrc[0].mipmapFilterMode
 *         tdDst[0].mipmapLevelBias     = tdSrc[0].mipmapLevelBias             # <<<<<<<<<<<<<<
 *         tdDst[0].minMipmapLevelClamp = tdSrc[0].minMipmapLevelClamp
 *         tdDst[0].maxMipmapLevelClamp = tdSrc[0].maxMipmapLevelClamp
 */
    __pyx_t_6 = (__pyx_v_tdSrc[0]).mipmapLevelBias;
    (__pyx_v_tdDst[0]).mipmapLevelBias = __pyx_t_6;

    /* "cuda/_lib/ccudart/utils.pyx":1498
 *         tdDst[0].mipmapFilterMode    = <ccuda.CUfilter_mode>tdSrc[0].mipmapFilterMode
 *         tdDst[0].mipmapLevelBias     = tdSrc[0].mipmapLevelBias
 *         tdDst[0].minMipmapLevelClamp = tdSrc[0].minMipmapLevelClamp             # <<<<<<<<<<<<<<
 *         tdDst[0].maxMipmapLevelClamp = tdSrc[0].maxMipmapLevelClamp
 *         tdDst[0].maxAnisotropy       = tdSrc[0].maxAnisotropy
 */
    __pyx_t_6 = (__pyx_v_tdSrc[0]).minMipmapLevelClamp;
    (__pyx_v_tdDst[0]).minMipmapLevelClamp = __pyx_t_6;

    /* "cuda/_lib/ccudart/utils.pyx":1499
 *         tdDst[0].mipmapLevelBias     = tdSrc[0].mipmapLevelBias
 *         tdDst[0].minMipmapLevelClamp = tdSrc[0].minMipmapLevelClamp
 *         tdDst[0].maxMipmapLevelClamp = tdSrc[0].maxMipmapLevelClamp             # <<<<<<<<<<<<<<
 *         tdDst[0].maxAnisotropy       = tdSrc[0].maxAnisotropy
 *         i = 0
 */
    __pyx_t_6 = (__pyx_v_tdSrc[0]).maxMipmapLevelClamp;
    (__pyx_v_tdDst[0]).maxMipmapLevelClamp = __pyx_t_6;

    /* "cuda/_lib/ccudart/utils.pyx":1500
 *         tdDst[0].minMipmapLevelClamp = tdSrc[0].minMipmapLevelClamp
 *         tdDst[0].maxMipmapLevelClamp = tdSrc[0].maxMipmapLevelClamp
 *         tdDst[0].maxAnisotropy       = tdSrc[0].maxAnisotropy             # <<<<<<<<<<<<<<
 *         i = 0
 *         while (i < 4):
 */
    __pyx_t_7 = (__pyx_v_tdSrc[0]).maxAnisotropy;
    (__pyx_v_tdDst[0]).maxAnisotropy = __pyx_t_7;

    /* "cuda/_lib/ccudart/utils.pyx":1501
 *         tdDst[0].maxMipmapLevelClamp = tdSrc[0].maxMipmapLevelClamp
 *         tdDst[0].maxAnisotropy       = tdSrc[0].maxAnisotropy
 *         i = 0             # <<<<<<<<<<<<<<
 *         while (i < 4):
 *             tdDst[0].borderColor[i] = tdSrc[0].borderColor[i]
 */
    __pyx_v_i = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1502
 *         tdDst[0].maxAnisotropy       = tdSrc[0].maxAnisotropy
 *         i = 0
 *         while (i < 4):             # <<<<<<<<<<<<<<
 *             tdDst[0].borderColor[i] = tdSrc[0].borderColor[i]
 *             i += 1
 */
    while (1) {
      __pyx_t_1 = (__pyx_v_i < 4);
      if (!__pyx_t_1) break;

      /* "cuda/_lib/ccudart/utils.pyx":1503
 *         i = 0
 *         while (i < 4):
 *             tdDst[0].borderColor[i] = tdSrc[0].borderColor[i]             # <<<<<<<<<<<<<<
 *             i += 1
 * 
 */
      ((__pyx_v_tdDst[0]).borderColor[__pyx_v_i]) = ((__pyx_v_tdSrc[0]).borderColor[__pyx_v_i]);

      /* "cuda/_lib/ccudart/utils.pyx":1504
 *         while (i < 4):
 *             tdDst[0].borderColor[i] = tdSrc[0].borderColor[i]
 *             i += 1             # <<<<<<<<<<<<<<
 * 
 *         if tdSrc[0].sRGB:
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }

    /* "cuda/_lib/ccudart/utils.pyx":1506
 *             i += 1
 * 
 *         if tdSrc[0].sRGB:             # <<<<<<<<<<<<<<
 *             tdDst[0].flags |= ccuda.CU_TRSF_SRGB
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_tdSrc[0]).sRGB != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1507
 * 
 *         if tdSrc[0].sRGB:
 *             tdDst[0].flags |= ccuda.CU_TRSF_SRGB             # <<<<<<<<<<<<<<
 *         else:
 *             tdDst[0].flags |= 0
 */
      __pyx_t_8 = 0;
      (__pyx_v_tdDst[__pyx_t_8]).flags = ((__pyx_v_tdDst[__pyx_t_8]).flags | __pyx_e_4cuda_5ccuda_CU_TRSF_SRGB);

      /* "cuda/_lib/ccudart/utils.pyx":1506
 *             i += 1
 * 
 *         if tdSrc[0].sRGB:             # <<<<<<<<<<<<<<
 *             tdDst[0].flags |= ccuda.CU_TRSF_SRGB
 *         else:
 */
      goto __pyx_L16;
    }

    /* "cuda/_lib/ccudart/utils.pyx":1509
 *             tdDst[0].flags |= ccuda.CU_TRSF_SRGB
 *         else:
 *             tdDst[0].flags |= 0             # <<<<<<<<<<<<<<
 * 
 *         if tdSrc[0].normalizedCoords:
 */
    /*else*/ {
      __pyx_t_8 = 0;
      (__pyx_v_tdDst[__pyx_t_8]).flags = ((__pyx_v_tdDst[__pyx_t_8]).flags | 0);
    }
    __pyx_L16:;

    /* "cuda/_lib/ccudart/utils.pyx":1511
 *             tdDst[0].flags |= 0
 * 
 *         if tdSrc[0].normalizedCoords:             # <<<<<<<<<<<<<<
 *             tdDst[0].flags |= ccuda.CU_TRSF_NORMALIZED_COORDINATES
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_tdSrc[0]).normalizedCoords != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1512
 * 
 *         if tdSrc[0].normalizedCoords:
 *             tdDst[0].flags |= ccuda.CU_TRSF_NORMALIZED_COORDINATES             # <<<<<<<<<<<<<<
 *         else:
 *             tdDst[0].flags |= 0
 */
      __pyx_t_8 = 0;
      (__pyx_v_tdDst[__pyx_t_8]).flags = ((__pyx_v_tdDst[__pyx_t_8]).flags | __pyx_e_4cuda_5ccuda_CU_TRSF_NORMALIZED_COORDINATES);

      /* "cuda/_lib/ccudart/utils.pyx":1511
 *             tdDst[0].flags |= 0
 * 
 *         if tdSrc[0].normalizedCoords:             # <<<<<<<<<<<<<<
 *             tdDst[0].flags |= ccuda.CU_TRSF_NORMALIZED_COORDINATES
 *         else:
 */
      goto __pyx_L17;
    }

    /* "cuda/_lib/ccudart/utils.pyx":1514
 *             tdDst[0].flags |= ccuda.CU_TRSF_NORMALIZED_COORDINATES
 *         else:
 *             tdDst[0].flags |= 0             # <<<<<<<<<<<<<<
 * 
 *         if tdSrc[0].disableTrilinearOptimization:
 */
    /*else*/ {
      __pyx_t_8 = 0;
      (__pyx_v_tdDst[__pyx_t_8]).flags = ((__pyx_v_tdDst[__pyx_t_8]).flags | 0);
    }
    __pyx_L17:;

    /* "cuda/_lib/ccudart/utils.pyx":1516
 *             tdDst[0].flags |= 0
 * 
 *         if tdSrc[0].disableTrilinearOptimization:             # <<<<<<<<<<<<<<
 *             tdDst[0].flags |= ccuda.CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_tdSrc[0]).disableTrilinearOptimization != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1517
 * 
 *         if tdSrc[0].disableTrilinearOptimization:
 *             tdDst[0].flags |= ccuda.CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION             # <<<<<<<<<<<<<<
 *         else:
 *             tdDst[0].flags |= 0
 */
      __pyx_t_8 = 0;
      (__pyx_v_tdDst[__pyx_t_8]).flags = ((__pyx_v_tdDst[__pyx_t_8]).flags | __pyx_e_4cuda_5ccuda_CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION);

      /* "cuda/_lib/ccudart/utils.pyx":1516
 *             tdDst[0].flags |= 0
 * 
 *         if tdSrc[0].disableTrilinearOptimization:             # <<<<<<<<<<<<<<
 *             tdDst[0].flags |= ccuda.CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION
 *         else:
 */
      goto __pyx_L18;
    }

    /* "cuda/_lib/ccudart/utils.pyx":1519
 *             tdDst[0].flags |= ccuda.CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION
 *         else:
 *             tdDst[0].flags |= 0             # <<<<<<<<<<<<<<
 * 
 *         if tdSrc[0].seamlessCubemap:
 */
    /*else*/ {
      __pyx_t_8 = 0;
      (__pyx_v_tdDst[__pyx_t_8]).flags = ((__pyx_v_tdDst[__pyx_t_8]).flags | 0);
    }
    __pyx_L18:;

    /* "cuda/_lib/ccudart/utils.pyx":1521
 *             tdDst[0].flags |= 0
 * 
 *         if tdSrc[0].seamlessCubemap:             # <<<<<<<<<<<<<<
 *             tdDst[0].flags |= ccuda.CU_TRSF_SEAMLESS_CUBEMAP
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_tdSrc[0]).seamlessCubemap != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1522
 * 
 *         if tdSrc[0].seamlessCubemap:
 *             tdDst[0].flags |= ccuda.CU_TRSF_SEAMLESS_CUBEMAP             # <<<<<<<<<<<<<<
 *         else:
 *             tdDst[0].flags |= 0
 */
      __pyx_t_8 = 0;
      (__pyx_v_tdDst[__pyx_t_8]).flags = ((__pyx_v_tdDst[__pyx_t_8]).flags | __pyx_e_4cuda_5ccuda_CU_TRSF_SEAMLESS_CUBEMAP);

      /* "cuda/_lib/ccudart/utils.pyx":1521
 *             tdDst[0].flags |= 0
 * 
 *         if tdSrc[0].seamlessCubemap:             # <<<<<<<<<<<<<<
 *             tdDst[0].flags |= ccuda.CU_TRSF_SEAMLESS_CUBEMAP
 *         else:
 */
      goto __pyx_L19;
    }

    /* "cuda/_lib/ccudart/utils.pyx":1524
 *             tdDst[0].flags |= ccuda.CU_TRSF_SEAMLESS_CUBEMAP
 *         else:
 *             tdDst[0].flags |= 0             # <<<<<<<<<<<<<<
 * 
 *         if format in (ccuda.CU_AD_FORMAT_SNORM_INT8X1,
 */
    /*else*/ {
      __pyx_t_8 = 0;
      (__pyx_v_tdDst[__pyx_t_8]).flags = ((__pyx_v_tdDst[__pyx_t_8]).flags | 0);
    }
    __pyx_L19:;

    /* "cuda/_lib/ccudart/utils.pyx":1526
 *             tdDst[0].flags |= 0
 * 
 *         if format in (ccuda.CU_AD_FORMAT_SNORM_INT8X1,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_SNORM_INT8X2,
 *                       ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 */
    switch (__pyx_v_format) {
      case CU_AD_FORMAT_SNORM_INT8X1:
      case CU_AD_FORMAT_SNORM_INT8X2:

      /* "cuda/_lib/ccudart/utils.pyx":1527
 * 
 *         if format in (ccuda.CU_AD_FORMAT_SNORM_INT8X1,
 *                       ccuda.CU_AD_FORMAT_SNORM_INT8X2,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT8X1,
 */
      case CU_AD_FORMAT_SNORM_INT8X4:

      /* "cuda/_lib/ccudart/utils.pyx":1528
 *         if format in (ccuda.CU_AD_FORMAT_SNORM_INT8X1,
 *                       ccuda.CU_AD_FORMAT_SNORM_INT8X2,
 *                       ccuda.CU_AD_FORMAT_SNORM_INT8X4,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_UNORM_INT8X1,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT8X2,
 */
      case CU_AD_FORMAT_UNORM_INT8X1:

      /* "cuda/_lib/ccudart/utils.pyx":1529
 *                       ccuda.CU_AD_FORMAT_SNORM_INT8X2,
 *                       ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT8X1,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_UNORM_INT8X2,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT8X4,
 */
      case CU_AD_FORMAT_UNORM_INT8X2:

      /* "cuda/_lib/ccudart/utils.pyx":1530
 *                       ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT8X1,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT8X2,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_UNORM_INT8X4,
 *                       ccuda.CU_AD_FORMAT_SNORM_INT16X1,
 */
      case CU_AD_FORMAT_UNORM_INT8X4:

      /* "cuda/_lib/ccudart/utils.pyx":1531
 *                       ccuda.CU_AD_FORMAT_UNORM_INT8X1,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT8X2,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT8X4,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_SNORM_INT16X1,
 *                       ccuda.CU_AD_FORMAT_SNORM_INT16X2,
 */
      case CU_AD_FORMAT_SNORM_INT16X1:

      /* "cuda/_lib/ccudart/utils.pyx":1532
 *                       ccuda.CU_AD_FORMAT_UNORM_INT8X2,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT8X4,
 *                       ccuda.CU_AD_FORMAT_SNORM_INT16X1,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_SNORM_INT16X2,
 *                       ccuda.CU_AD_FORMAT_SNORM_INT16X4,
 */
      case CU_AD_FORMAT_SNORM_INT16X2:

      /* "cuda/_lib/ccudart/utils.pyx":1533
 *                       ccuda.CU_AD_FORMAT_UNORM_INT8X4,
 *                       ccuda.CU_AD_FORMAT_SNORM_INT16X1,
 *                       ccuda.CU_AD_FORMAT_SNORM_INT16X2,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_SNORM_INT16X4,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT16X1,
 */
      case CU_AD_FORMAT_SNORM_INT16X4:

      /* "cuda/_lib/ccudart/utils.pyx":1534
 *                       ccuda.CU_AD_FORMAT_SNORM_INT16X1,
 *                       ccuda.CU_AD_FORMAT_SNORM_INT16X2,
 *                       ccuda.CU_AD_FORMAT_SNORM_INT16X4,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_UNORM_INT16X1,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT16X2,
 */
      case CU_AD_FORMAT_UNORM_INT16X1:

      /* "cuda/_lib/ccudart/utils.pyx":1535
 *                       ccuda.CU_AD_FORMAT_SNORM_INT16X2,
 *                       ccuda.CU_AD_FORMAT_SNORM_INT16X4,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT16X1,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_UNORM_INT16X2,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT16X4,
 */
      case CU_AD_FORMAT_UNORM_INT16X2:

      /* "cuda/_lib/ccudart/utils.pyx":1536
 *                       ccuda.CU_AD_FORMAT_SNORM_INT16X4,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT16X1,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT16X2,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_UNORM_INT16X4,
 *                       ccuda.CU_AD_FORMAT_BC1_UNORM,
 */
      case CU_AD_FORMAT_UNORM_INT16X4:

      /* "cuda/_lib/ccudart/utils.pyx":1537
 *                       ccuda.CU_AD_FORMAT_UNORM_INT16X1,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT16X2,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT16X4,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_BC1_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB,
 */
      case CU_AD_FORMAT_BC1_UNORM:

      /* "cuda/_lib/ccudart/utils.pyx":1538
 *                       ccuda.CU_AD_FORMAT_UNORM_INT16X2,
 *                       ccuda.CU_AD_FORMAT_UNORM_INT16X4,
 *                       ccuda.CU_AD_FORMAT_BC1_UNORM,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB,
 *                       ccuda.CU_AD_FORMAT_BC2_UNORM,
 */
      case CU_AD_FORMAT_BC1_UNORM_SRGB:

      /* "cuda/_lib/ccudart/utils.pyx":1539
 *                       ccuda.CU_AD_FORMAT_UNORM_INT16X4,
 *                       ccuda.CU_AD_FORMAT_BC1_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_BC2_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 */
      case CU_AD_FORMAT_BC2_UNORM:

      /* "cuda/_lib/ccudart/utils.pyx":1540
 *                       ccuda.CU_AD_FORMAT_BC1_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB,
 *                       ccuda.CU_AD_FORMAT_BC2_UNORM,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 *                       ccuda.CU_AD_FORMAT_BC3_UNORM,
 */
      case CU_AD_FORMAT_BC2_UNORM_SRGB:

      /* "cuda/_lib/ccudart/utils.pyx":1541
 *                       ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB,
 *                       ccuda.CU_AD_FORMAT_BC2_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_BC3_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,
 */
      case CU_AD_FORMAT_BC3_UNORM:

      /* "cuda/_lib/ccudart/utils.pyx":1542
 *                       ccuda.CU_AD_FORMAT_BC2_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 *                       ccuda.CU_AD_FORMAT_BC3_UNORM,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,
 *                       ccuda.CU_AD_FORMAT_BC4_UNORM,
 */
      case CU_AD_FORMAT_BC3_UNORM_SRGB:

      /* "cuda/_lib/ccudart/utils.pyx":1543
 *                       ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 *                       ccuda.CU_AD_FORMAT_BC3_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_BC4_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC4_SNORM,
 */
      case CU_AD_FORMAT_BC4_UNORM:

      /* "cuda/_lib/ccudart/utils.pyx":1544
 *                       ccuda.CU_AD_FORMAT_BC3_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,
 *                       ccuda.CU_AD_FORMAT_BC4_UNORM,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_BC4_SNORM,
 *                       ccuda.CU_AD_FORMAT_BC5_UNORM,
 */
      case CU_AD_FORMAT_BC4_SNORM:

      /* "cuda/_lib/ccudart/utils.pyx":1545
 *                       ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,
 *                       ccuda.CU_AD_FORMAT_BC4_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC4_SNORM,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_BC5_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC5_SNORM,
 */
      case CU_AD_FORMAT_BC5_UNORM:

      /* "cuda/_lib/ccudart/utils.pyx":1546
 *                       ccuda.CU_AD_FORMAT_BC4_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC4_SNORM,
 *                       ccuda.CU_AD_FORMAT_BC5_UNORM,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_BC5_SNORM,
 *                       ccuda.CU_AD_FORMAT_BC7_UNORM,
 */
      case CU_AD_FORMAT_BC5_SNORM:

      /* "cuda/_lib/ccudart/utils.pyx":1547
 *                       ccuda.CU_AD_FORMAT_BC4_SNORM,
 *                       ccuda.CU_AD_FORMAT_BC5_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC5_SNORM,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_BC7_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 */
      case CU_AD_FORMAT_BC7_UNORM:

      /* "cuda/_lib/ccudart/utils.pyx":1548
 *                       ccuda.CU_AD_FORMAT_BC5_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC5_SNORM,
 *                       ccuda.CU_AD_FORMAT_BC7_UNORM,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 *             if tdSrc[0].readMode != cudaTextureReadMode.cudaReadModeNormalizedFloat:
 */
      case CU_AD_FORMAT_BC7_UNORM_SRGB:

      /* "cuda/_lib/ccudart/utils.pyx":1550
 *                       ccuda.CU_AD_FORMAT_BC7_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 *             if tdSrc[0].readMode != cudaTextureReadMode.cudaReadModeNormalizedFloat:             # <<<<<<<<<<<<<<
 *                 return cudaErrorInvalidNormSetting
 *         elif format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,
 */
      __pyx_t_1 = ((__pyx_v_tdSrc[0]).readMode != cudaReadModeNormalizedFloat);
      if (__pyx_t_1) {

        /* "cuda/_lib/ccudart/utils.pyx":1551
 *                       ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 *             if tdSrc[0].readMode != cudaTextureReadMode.cudaReadModeNormalizedFloat:
 *                 return cudaErrorInvalidNormSetting             # <<<<<<<<<<<<<<
 *         elif format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,
 *                         ccuda.CU_AD_FORMAT_SIGNED_INT16,
 */
        __pyx_r = cudaErrorInvalidNormSetting;
        goto __pyx_L0;

        /* "cuda/_lib/ccudart/utils.pyx":1550
 *                       ccuda.CU_AD_FORMAT_BC7_UNORM,
 *                       ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 *             if tdSrc[0].readMode != cudaTextureReadMode.cudaReadModeNormalizedFloat:             # <<<<<<<<<<<<<<
 *                 return cudaErrorInvalidNormSetting
 *         elif format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,
 */
      }

      /* "cuda/_lib/ccudart/utils.pyx":1526
 *             tdDst[0].flags |= 0
 * 
 *         if format in (ccuda.CU_AD_FORMAT_SNORM_INT8X1,             # <<<<<<<<<<<<<<
 *                       ccuda.CU_AD_FORMAT_SNORM_INT8X2,
 *                       ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 */
      break;
      case CU_AD_FORMAT_SIGNED_INT8:

      /* "cuda/_lib/ccudart/utils.pyx":1552
 *             if tdSrc[0].readMode != cudaTextureReadMode.cudaReadModeNormalizedFloat:
 *                 return cudaErrorInvalidNormSetting
 *         elif format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,             # <<<<<<<<<<<<<<
 *                         ccuda.CU_AD_FORMAT_SIGNED_INT16,
 *                         ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 */
      case CU_AD_FORMAT_SIGNED_INT16:

      /* "cuda/_lib/ccudart/utils.pyx":1553
 *                 return cudaErrorInvalidNormSetting
 *         elif format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,
 *                         ccuda.CU_AD_FORMAT_SIGNED_INT16,             # <<<<<<<<<<<<<<
 *                         ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 *                         ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 */
      case CU_AD_FORMAT_UNSIGNED_INT8:

      /* "cuda/_lib/ccudart/utils.pyx":1554
 *         elif format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,
 *                         ccuda.CU_AD_FORMAT_SIGNED_INT16,
 *                         ccuda.CU_AD_FORMAT_UNSIGNED_INT8,             # <<<<<<<<<<<<<<
 *                         ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 *             if tdSrc[0].readMode == cudaReadModeElementType:
 */
      case CU_AD_FORMAT_UNSIGNED_INT16:

      /* "cuda/_lib/ccudart/utils.pyx":1556
 *                         ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 *                         ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 *             if tdSrc[0].readMode == cudaReadModeElementType:             # <<<<<<<<<<<<<<
 *                 if tdSrc[0].filterMode == cudaTextureFilterMode.cudaFilterModeLinear:
 *                     return cudaErrorInvalidFilterSetting
 */
      __pyx_t_1 = ((__pyx_v_tdSrc[0]).readMode == cudaReadModeElementType);
      if (__pyx_t_1) {

        /* "cuda/_lib/ccudart/utils.pyx":1557
 *                         ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 *             if tdSrc[0].readMode == cudaReadModeElementType:
 *                 if tdSrc[0].filterMode == cudaTextureFilterMode.cudaFilterModeLinear:             # <<<<<<<<<<<<<<
 *                     return cudaErrorInvalidFilterSetting
 *                 tdDst[0].flags |= ccuda.CU_TRSF_READ_AS_INTEGER
 */
        __pyx_t_1 = ((__pyx_v_tdSrc[0]).filterMode == cudaFilterModeLinear);
        if (__pyx_t_1) {

          /* "cuda/_lib/ccudart/utils.pyx":1558
 *             if tdSrc[0].readMode == cudaReadModeElementType:
 *                 if tdSrc[0].filterMode == cudaTextureFilterMode.cudaFilterModeLinear:
 *                     return cudaErrorInvalidFilterSetting             # <<<<<<<<<<<<<<
 *                 tdDst[0].flags |= ccuda.CU_TRSF_READ_AS_INTEGER
 *         elif format == ccuda.CU_AD_FORMAT_NV12:
 */
          __pyx_r = cudaErrorInvalidFilterSetting;
          goto __pyx_L0;

          /* "cuda/_lib/ccudart/utils.pyx":1557
 *                         ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 *             if tdSrc[0].readMode == cudaReadModeElementType:
 *                 if tdSrc[0].filterMode == cudaTextureFilterMode.cudaFilterModeLinear:             # <<<<<<<<<<<<<<
 *                     return cudaErrorInvalidFilterSetting
 *                 tdDst[0].flags |= ccuda.CU_TRSF_READ_AS_INTEGER
 */
        }

        /* "cuda/_lib/ccudart/utils.pyx":1559
 *                 if tdSrc[0].filterMode == cudaTextureFilterMode.cudaFilterModeLinear:
 *                     return cudaErrorInvalidFilterSetting
 *                 tdDst[0].flags |= ccuda.CU_TRSF_READ_AS_INTEGER             # <<<<<<<<<<<<<<
 *         elif format == ccuda.CU_AD_FORMAT_NV12:
 *             return cudaErrorInvalidValue
 */
        __pyx_t_8 = 0;
        (__pyx_v_tdDst[__pyx_t_8]).flags = ((__pyx_v_tdDst[__pyx_t_8]).flags | __pyx_e_4cuda_5ccuda_CU_TRSF_READ_AS_INTEGER);

        /* "cuda/_lib/ccudart/utils.pyx":1556
 *                         ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 *                         ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 *             if tdSrc[0].readMode == cudaReadModeElementType:             # <<<<<<<<<<<<<<
 *                 if tdSrc[0].filterMode == cudaTextureFilterMode.cudaFilterModeLinear:
 *                     return cudaErrorInvalidFilterSetting
 */
      }

      /* "cuda/_lib/ccudart/utils.pyx":1552
 *             if tdSrc[0].readMode != cudaTextureReadMode.cudaReadModeNormalizedFloat:
 *                 return cudaErrorInvalidNormSetting
 *         elif format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,             # <<<<<<<<<<<<<<
 *                         ccuda.CU_AD_FORMAT_SIGNED_INT16,
 *                         ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 */
      break;
      case CU_AD_FORMAT_NV12:

      /* "cuda/_lib/ccudart/utils.pyx":1561
 *                 tdDst[0].flags |= ccuda.CU_TRSF_READ_AS_INTEGER
 *         elif format == ccuda.CU_AD_FORMAT_NV12:
 *             return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *         elif format == ccuda.CU_AD_FORMAT_SIGNED_INT32 or format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:
 *             if tdSrc[0].filterMode == cudaTextureFilterMode.cudaFilterModeLinear:
 */
      __pyx_r = cudaErrorInvalidValue;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1560
 *                     return cudaErrorInvalidFilterSetting
 *                 tdDst[0].flags |= ccuda.CU_TRSF_READ_AS_INTEGER
 *         elif format == ccuda.CU_AD_FORMAT_NV12:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         elif format == ccuda.CU_AD_FORMAT_SIGNED_INT32 or format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:
 */
      break;
      case CU_AD_FORMAT_SIGNED_INT32:

      /* "cuda/_lib/ccudart/utils.pyx":1562
 *         elif format == ccuda.CU_AD_FORMAT_NV12:
 *             return cudaErrorInvalidValue
 *         elif format == ccuda.CU_AD_FORMAT_SIGNED_INT32 or format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:             # <<<<<<<<<<<<<<
 *             if tdSrc[0].filterMode == cudaTextureFilterMode.cudaFilterModeLinear:
 *                 return cudaErrorInvalidFilterSetting
 */
      case CU_AD_FORMAT_UNSIGNED_INT32:

      /* "cuda/_lib/ccudart/utils.pyx":1563
 *             return cudaErrorInvalidValue
 *         elif format == ccuda.CU_AD_FORMAT_SIGNED_INT32 or format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:
 *             if tdSrc[0].filterMode == cudaTextureFilterMode.cudaFilterModeLinear:             # <<<<<<<<<<<<<<
 *                 return cudaErrorInvalidFilterSetting
 *             if tdSrc[0].readMode == cudaTextureReadMode.cudaReadModeNormalizedFloat:
 */
      __pyx_t_1 = ((__pyx_v_tdSrc[0]).filterMode == cudaFilterModeLinear);
      if (__pyx_t_1) {

        /* "cuda/_lib/ccudart/utils.pyx":1564
 *         elif format == ccuda.CU_AD_FORMAT_SIGNED_INT32 or format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:
 *             if tdSrc[0].filterMode == cudaTextureFilterMode.cudaFilterModeLinear:
 *                 return cudaErrorInvalidFilterSetting             # <<<<<<<<<<<<<<
 *             if tdSrc[0].readMode == cudaTextureReadMode.cudaReadModeNormalizedFloat:
 *                 return cudaErrorInvalidNormSetting
 */
        __pyx_r = cudaErrorInvalidFilterSetting;
        goto __pyx_L0;

        /* "cuda/_lib/ccudart/utils.pyx":1563
 *             return cudaErrorInvalidValue
 *         elif format == ccuda.CU_AD_FORMAT_SIGNED_INT32 or format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:
 *             if tdSrc[0].filterMode == cudaTextureFilterMode.cudaFilterModeLinear:             # <<<<<<<<<<<<<<
 *                 return cudaErrorInvalidFilterSetting
 *             if tdSrc[0].readMode == cudaTextureReadMode.cudaReadModeNormalizedFloat:
 */
      }

      /* "cuda/_lib/ccudart/utils.pyx":1565
 *             if tdSrc[0].filterMode == cudaTextureFilterMode.cudaFilterModeLinear:
 *                 return cudaErrorInvalidFilterSetting
 *             if tdSrc[0].readMode == cudaTextureReadMode.cudaReadModeNormalizedFloat:             # <<<<<<<<<<<<<<
 *                 return cudaErrorInvalidNormSetting
 *         else:
 */
      __pyx_t_1 = ((__pyx_v_tdSrc[0]).readMode == cudaReadModeNormalizedFloat);
      if (__pyx_t_1) {

        /* "cuda/_lib/ccudart/utils.pyx":1566
 *                 return cudaErrorInvalidFilterSetting
 *             if tdSrc[0].readMode == cudaTextureReadMode.cudaReadModeNormalizedFloat:
 *                 return cudaErrorInvalidNormSetting             # <<<<<<<<<<<<<<
 *         else:
 *             if tdSrc[0].readMode == cudaTextureReadMode.cudaReadModeNormalizedFloat:
 */
        __pyx_r = cudaErrorInvalidNormSetting;
        goto __pyx_L0;

        /* "cuda/_lib/ccudart/utils.pyx":1565
 *             if tdSrc[0].filterMode == cudaTextureFilterMode.cudaFilterModeLinear:
 *                 return cudaErrorInvalidFilterSetting
 *             if tdSrc[0].readMode == cudaTextureReadMode.cudaReadModeNormalizedFloat:             # <<<<<<<<<<<<<<
 *                 return cudaErrorInvalidNormSetting
 *         else:
 */
      }

      /* "cuda/_lib/ccudart/utils.pyx":1562
 *         elif format == ccuda.CU_AD_FORMAT_NV12:
 *             return cudaErrorInvalidValue
 *         elif format == ccuda.CU_AD_FORMAT_SIGNED_INT32 or format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32:             # <<<<<<<<<<<<<<
 *             if tdSrc[0].filterMode == cudaTextureFilterMode.cudaFilterModeLinear:
 *                 return cudaErrorInvalidFilterSetting
 */
      break;
      default:

      /* "cuda/_lib/ccudart/utils.pyx":1568
 *                 return cudaErrorInvalidNormSetting
 *         else:
 *             if tdSrc[0].readMode == cudaTextureReadMode.cudaReadModeNormalizedFloat:             # <<<<<<<<<<<<<<
 *                 return cudaErrorInvalidNormSetting
 * 
 */
      __pyx_t_1 = ((__pyx_v_tdSrc[0]).readMode == cudaReadModeNormalizedFloat);
      if (__pyx_t_1) {

        /* "cuda/_lib/ccudart/utils.pyx":1569
 *         else:
 *             if tdSrc[0].readMode == cudaTextureReadMode.cudaReadModeNormalizedFloat:
 *                 return cudaErrorInvalidNormSetting             # <<<<<<<<<<<<<<
 * 
 *     if rvdDst and rvdSrc:
 */
        __pyx_r = cudaErrorInvalidNormSetting;
        goto __pyx_L0;

        /* "cuda/_lib/ccudart/utils.pyx":1568
 *                 return cudaErrorInvalidNormSetting
 *         else:
 *             if tdSrc[0].readMode == cudaTextureReadMode.cudaReadModeNormalizedFloat:             # <<<<<<<<<<<<<<
 *                 return cudaErrorInvalidNormSetting
 * 
 */
      }
      break;
    }

    /* "cuda/_lib/ccudart/utils.pyx":1488
 *     rdDst[0].flags = 0
 * 
 *     if tdDst and tdSrc:             # <<<<<<<<<<<<<<
 *         memset(tdDst, 0, sizeof(tdDst[0]))
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1571
 *                 return cudaErrorInvalidNormSetting
 * 
 *     if rvdDst and rvdSrc:             # <<<<<<<<<<<<<<
 *         memset(rvdDst, 0, sizeof(rvdDst[0]))
 * 
 */
  __pyx_t_5 = (__pyx_v_rvdDst != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L27_bool_binop_done;
  }
  __pyx_t_5 = (__pyx_v_rvdSrc != 0);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L27_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1572
 * 
 *     if rvdDst and rvdSrc:
 *         memset(rvdDst, 0, sizeof(rvdDst[0]))             # <<<<<<<<<<<<<<
 * 
 *         rvdDst[0].format           = <ccuda.CUresourceViewFormat>rvdSrc[0].format
 */
    (void)(memset(__pyx_v_rvdDst, 0, (sizeof((__pyx_v_rvdDst[0])))));

    /* "cuda/_lib/ccudart/utils.pyx":1574
 *         memset(rvdDst, 0, sizeof(rvdDst[0]))
 * 
 *         rvdDst[0].format           = <ccuda.CUresourceViewFormat>rvdSrc[0].format             # <<<<<<<<<<<<<<
 *         rvdDst[0].width            = rvdSrc[0].width
 *         rvdDst[0].height           = rvdSrc[0].height
 */
    (__pyx_v_rvdDst[0]).format = ((CUresourceViewFormat)(__pyx_v_rvdSrc[0]).format);

    /* "cuda/_lib/ccudart/utils.pyx":1575
 * 
 *         rvdDst[0].format           = <ccuda.CUresourceViewFormat>rvdSrc[0].format
 *         rvdDst[0].width            = rvdSrc[0].width             # <<<<<<<<<<<<<<
 *         rvdDst[0].height           = rvdSrc[0].height
 *         rvdDst[0].depth            = rvdSrc[0].depth
 */
    __pyx_t_4 = (__pyx_v_rvdSrc[0]).width;
    (__pyx_v_rvdDst[0]).width = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1576
 *         rvdDst[0].format           = <ccuda.CUresourceViewFormat>rvdSrc[0].format
 *         rvdDst[0].width            = rvdSrc[0].width
 *         rvdDst[0].height           = rvdSrc[0].height             # <<<<<<<<<<<<<<
 *         rvdDst[0].depth            = rvdSrc[0].depth
 *         rvdDst[0].firstMipmapLevel = rvdSrc[0].firstMipmapLevel
 */
    __pyx_t_4 = (__pyx_v_rvdSrc[0]).height;
    (__pyx_v_rvdDst[0]).height = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1577
 *         rvdDst[0].width            = rvdSrc[0].width
 *         rvdDst[0].height           = rvdSrc[0].height
 *         rvdDst[0].depth            = rvdSrc[0].depth             # <<<<<<<<<<<<<<
 *         rvdDst[0].firstMipmapLevel = rvdSrc[0].firstMipmapLevel
 *         rvdDst[0].lastMipmapLevel  = rvdSrc[0].lastMipmapLevel
 */
    __pyx_t_4 = (__pyx_v_rvdSrc[0]).depth;
    (__pyx_v_rvdDst[0]).depth = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1578
 *         rvdDst[0].height           = rvdSrc[0].height
 *         rvdDst[0].depth            = rvdSrc[0].depth
 *         rvdDst[0].firstMipmapLevel = rvdSrc[0].firstMipmapLevel             # <<<<<<<<<<<<<<
 *         rvdDst[0].lastMipmapLevel  = rvdSrc[0].lastMipmapLevel
 *         rvdDst[0].firstLayer       = rvdSrc[0].firstLayer
 */
    __pyx_t_7 = (__pyx_v_rvdSrc[0]).firstMipmapLevel;
    (__pyx_v_rvdDst[0]).firstMipmapLevel = __pyx_t_7;

    /* "cuda/_lib/ccudart/utils.pyx":1579
 *         rvdDst[0].depth            = rvdSrc[0].depth
 *         rvdDst[0].firstMipmapLevel = rvdSrc[0].firstMipmapLevel
 *         rvdDst[0].lastMipmapLevel  = rvdSrc[0].lastMipmapLevel             # <<<<<<<<<<<<<<
 *         rvdDst[0].firstLayer       = rvdSrc[0].firstLayer
 *         rvdDst[0].lastLayer        = rvdSrc[0].lastLayer
 */
    __pyx_t_7 = (__pyx_v_rvdSrc[0]).lastMipmapLevel;
    (__pyx_v_rvdDst[0]).lastMipmapLevel = __pyx_t_7;

    /* "cuda/_lib/ccudart/utils.pyx":1580
 *         rvdDst[0].firstMipmapLevel = rvdSrc[0].firstMipmapLevel
 *         rvdDst[0].lastMipmapLevel  = rvdSrc[0].lastMipmapLevel
 *         rvdDst[0].firstLayer       = rvdSrc[0].firstLayer             # <<<<<<<<<<<<<<
 *         rvdDst[0].lastLayer        = rvdSrc[0].lastLayer
 * 
 */
    __pyx_t_7 = (__pyx_v_rvdSrc[0]).firstLayer;
    (__pyx_v_rvdDst[0]).firstLayer = __pyx_t_7;

    /* "cuda/_lib/ccudart/utils.pyx":1581
 *         rvdDst[0].lastMipmapLevel  = rvdSrc[0].lastMipmapLevel
 *         rvdDst[0].firstLayer       = rvdSrc[0].firstLayer
 *         rvdDst[0].lastLayer        = rvdSrc[0].lastLayer             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
    __pyx_t_7 = (__pyx_v_rvdSrc[0]).lastLayer;
    (__pyx_v_rvdDst[0]).lastLayer = __pyx_t_7;

    /* "cuda/_lib/ccudart/utils.pyx":1571
 *                 return cudaErrorInvalidNormSetting
 * 
 *     if rvdDst and rvdSrc:             # <<<<<<<<<<<<<<
 *         memset(rvdDst, 0, sizeof(rvdDst[0]))
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1583
 *         rvdDst[0].lastLayer        = rvdSrc[0].lastLayer
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1435
 * 
 * 
 * cdef cudaError_t getDriverResDescFromResDesc(ccuda.CUDA_RESOURCE_DESC *rdDst, const cudaResourceDesc *rdSrc,             # <<<<<<<<<<<<<<
 *                                              ccuda.CUDA_TEXTURE_DESC *tdDst, const cudaTextureDesc *tdSrc,
 *                                              ccuda.CUDA_RESOURCE_VIEW_DESC *rvdDst, const cudaResourceViewDesc *rvdSrc) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1586
 * 
 * 
 * cdef cudaError_t getResDescFromDriverResDesc(cudaResourceDesc *rdDst, const ccuda.CUDA_RESOURCE_DESC *rdSrc,             # <<<<<<<<<<<<<<
 *                                              cudaTextureDesc *tdDst, const ccuda.CUDA_TEXTURE_DESC *tdSrc,
 *                                              cudaResourceViewDesc *rvdDst, const ccuda.CUDA_RESOURCE_VIEW_DESC *rvdSrc) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_getResDescFromDriverResDesc(struct cudaResourceDesc *__pyx_v_rdDst, CUDA_RESOURCE_DESC const *__pyx_v_rdSrc, struct cudaTextureDesc *__pyx_v_tdDst, CUDA_TEXTURE_DESC const *__pyx_v_tdSrc, struct cudaResourceViewDesc *__pyx_v_rvdDst, CUDA_RESOURCE_VIEW_DESC const *__pyx_v_rvdSrc) {
  int __pyx_v_i;
  int __pyx_v_numChannels;
  CUDA_ARRAY3D_DESCRIPTOR_v2 __pyx_v_ad;
  CUarray __pyx_v_hArray;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  size_t __pyx_t_4;
  CUarray_format __pyx_t_5;
  unsigned int __pyx_t_6;
  int __pyx_t_7;
  float __pyx_t_8;
  long __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("getResDescFromDriverResDesc", __pyx_f[0], 1586, 1, __PYX_ERR(0, 1586, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1589
 *                                              cudaTextureDesc *tdDst, const ccuda.CUDA_TEXTURE_DESC *tdSrc,
 *                                              cudaResourceViewDesc *rvdDst, const ccuda.CUDA_RESOURCE_VIEW_DESC *rvdSrc) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef int i = 0             # <<<<<<<<<<<<<<
 *     cdef int numChannels = 0
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 ad
 */
  __pyx_v_i = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1590
 *                                              cudaResourceViewDesc *rvdDst, const ccuda.CUDA_RESOURCE_VIEW_DESC *rvdSrc) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef int i = 0
 *     cdef int numChannels = 0             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 ad
 *     cdef ccuda.CUarray hArray
 */
  __pyx_v_numChannels = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1594
 *     cdef ccuda.CUarray hArray
 * 
 *     memset(rdDst, 0, sizeof(rdDst[0]))             # <<<<<<<<<<<<<<
 *     memset(&ad, 0, sizeof(ad))
 *     memset(&hArray, 0, sizeof(hArray))
 */
  (void)(memset(__pyx_v_rdDst, 0, (sizeof((__pyx_v_rdDst[0])))));

  /* "cuda/_lib/ccudart/utils.pyx":1595
 * 
 *     memset(rdDst, 0, sizeof(rdDst[0]))
 *     memset(&ad, 0, sizeof(ad))             # <<<<<<<<<<<<<<
 *     memset(&hArray, 0, sizeof(hArray))
 * 
 */
  (void)(memset((&__pyx_v_ad), 0, (sizeof(__pyx_v_ad))));

  /* "cuda/_lib/ccudart/utils.pyx":1596
 *     memset(rdDst, 0, sizeof(rdDst[0]))
 *     memset(&ad, 0, sizeof(ad))
 *     memset(&hArray, 0, sizeof(hArray))             # <<<<<<<<<<<<<<
 * 
 *     if rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY:
 */
  (void)(memset((&__pyx_v_hArray), 0, (sizeof(__pyx_v_hArray))));

  /* "cuda/_lib/ccudart/utils.pyx":1598
 *     memset(&hArray, 0, sizeof(hArray))
 * 
 *     if rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY:             # <<<<<<<<<<<<<<
 *         rdDst[0].resType         = cudaResourceType.cudaResourceTypeArray
 *         rdDst[0].res.array.array = <cudaArray_t>rdSrc[0].res.array.hArray
 */
  __pyx_t_1 = ((__pyx_v_rdSrc[0]).resType == CU_RESOURCE_TYPE_ARRAY);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1599
 * 
 *     if rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY:
 *         rdDst[0].resType         = cudaResourceType.cudaResourceTypeArray             # <<<<<<<<<<<<<<
 *         rdDst[0].res.array.array = <cudaArray_t>rdSrc[0].res.array.hArray
 *         err = getFormat(rdDst[0].res.array.array, numChannels, &ad.Format)
 */
    (__pyx_v_rdDst[0]).resType = cudaResourceTypeArray;

    /* "cuda/_lib/ccudart/utils.pyx":1600
 *     if rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY:
 *         rdDst[0].resType         = cudaResourceType.cudaResourceTypeArray
 *         rdDst[0].res.array.array = <cudaArray_t>rdSrc[0].res.array.hArray             # <<<<<<<<<<<<<<
 *         err = getFormat(rdDst[0].res.array.array, numChannels, &ad.Format)
 *         if err != cudaSuccess:
 */
    (__pyx_v_rdDst[0]).res.array.array = ((cudaArray_t)(__pyx_v_rdSrc[0]).res.array.hArray);

    /* "cuda/_lib/ccudart/utils.pyx":1601
 *         rdDst[0].resType         = cudaResourceType.cudaResourceTypeArray
 *         rdDst[0].res.array.array = <cudaArray_t>rdSrc[0].res.array.hArray
 *         err = getFormat(rdDst[0].res.array.array, numChannels, &ad.Format)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getFormat((__pyx_v_rdDst[0]).res.array.array, __pyx_v_numChannels, (&__pyx_v_ad.Format)); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1601, __pyx_L1_error)
    __pyx_v_err = __pyx_t_2;

    /* "cuda/_lib/ccudart/utils.pyx":1602
 *         rdDst[0].res.array.array = <cudaArray_t>rdSrc[0].res.array.hArray
 *         err = getFormat(rdDst[0].res.array.array, numChannels, &ad.Format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1603
 *         err = getFormat(rdDst[0].res.array.array, numChannels, &ad.Format)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:
 *         rdDst[0].resType = cudaResourceType.cudaResourceTypeMipmappedArray
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1602
 *         rdDst[0].res.array.array = <cudaArray_t>rdSrc[0].res.array.hArray
 *         err = getFormat(rdDst[0].res.array.array, numChannels, &ad.Format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1598
 *     memset(&hArray, 0, sizeof(hArray))
 * 
 *     if rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY:             # <<<<<<<<<<<<<<
 *         rdDst[0].resType         = cudaResourceType.cudaResourceTypeArray
 *         rdDst[0].res.array.array = <cudaArray_t>rdSrc[0].res.array.hArray
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1604
 *         if err != cudaSuccess:
 *             return err
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:             # <<<<<<<<<<<<<<
 *         rdDst[0].resType = cudaResourceType.cudaResourceTypeMipmappedArray
 *         rdDst[0].res.mipmap.mipmap = <cudaMipmappedArray_t>rdSrc[0].res.mipmap.hMipmappedArray
 */
  __pyx_t_1 = ((__pyx_v_rdSrc[0]).resType == CU_RESOURCE_TYPE_MIPMAPPED_ARRAY);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1605
 *             return err
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:
 *         rdDst[0].resType = cudaResourceType.cudaResourceTypeMipmappedArray             # <<<<<<<<<<<<<<
 *         rdDst[0].res.mipmap.mipmap = <cudaMipmappedArray_t>rdSrc[0].res.mipmap.hMipmappedArray
 *         err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(&hArray, rdSrc[0].res.mipmap.hMipmappedArray, 0)
 */
    (__pyx_v_rdDst[0]).resType = cudaResourceTypeMipmappedArray;

    /* "cuda/_lib/ccudart/utils.pyx":1606
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:
 *         rdDst[0].resType = cudaResourceType.cudaResourceTypeMipmappedArray
 *         rdDst[0].res.mipmap.mipmap = <cudaMipmappedArray_t>rdSrc[0].res.mipmap.hMipmappedArray             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(&hArray, rdSrc[0].res.mipmap.hMipmappedArray, 0)
 *         if err != cudaSuccess:
 */
    (__pyx_v_rdDst[0]).res.mipmap.mipmap = ((cudaMipmappedArray_t)(__pyx_v_rdSrc[0]).res.mipmap.hMipmappedArray);

    /* "cuda/_lib/ccudart/utils.pyx":1607
 *         rdDst[0].resType = cudaResourceType.cudaResourceTypeMipmappedArray
 *         rdDst[0].res.mipmap.mipmap = <cudaMipmappedArray_t>rdSrc[0].res.mipmap.hMipmappedArray
 *         err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(&hArray, rdSrc[0].res.mipmap.hMipmappedArray, 0)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayGetLevel((&__pyx_v_hArray), (__pyx_v_rdSrc[0]).res.mipmap.hMipmappedArray, 0); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1607, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":1608
 *         rdDst[0].res.mipmap.mipmap = <cudaMipmappedArray_t>rdSrc[0].res.mipmap.hMipmappedArray
 *         err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(&hArray, rdSrc[0].res.mipmap.hMipmappedArray, 0)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getFormat(<cudaArray_t>hArray, numChannels, &ad.Format)
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1609
 *         err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(&hArray, rdSrc[0].res.mipmap.hMipmappedArray, 0)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         err = getFormat(<cudaArray_t>hArray, numChannels, &ad.Format)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1608
 *         rdDst[0].res.mipmap.mipmap = <cudaMipmappedArray_t>rdSrc[0].res.mipmap.hMipmappedArray
 *         err = <cudaError_t>ccuda._cuMipmappedArrayGetLevel(&hArray, rdSrc[0].res.mipmap.hMipmappedArray, 0)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getFormat(<cudaArray_t>hArray, numChannels, &ad.Format)
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1610
 *         if err != cudaSuccess:
 *             return err
 *         err = getFormat(<cudaArray_t>hArray, numChannels, &ad.Format)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getFormat(((cudaArray_t)__pyx_v_hArray), __pyx_v_numChannels, (&__pyx_v_ad.Format)); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1610, __pyx_L1_error)
    __pyx_v_err = __pyx_t_2;

    /* "cuda/_lib/ccudart/utils.pyx":1611
 *             return err
 *         err = getFormat(<cudaArray_t>hArray, numChannels, &ad.Format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR:
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1612
 *         err = getFormat(<cudaArray_t>hArray, numChannels, &ad.Format)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR:
 *         rdDst[0].resType                = cudaResourceType.cudaResourceTypeLinear
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1611
 *             return err
 *         err = getFormat(<cudaArray_t>hArray, numChannels, &ad.Format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1604
 *         if err != cudaSuccess:
 *             return err
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY:             # <<<<<<<<<<<<<<
 *         rdDst[0].resType = cudaResourceType.cudaResourceTypeMipmappedArray
 *         rdDst[0].res.mipmap.mipmap = <cudaMipmappedArray_t>rdSrc[0].res.mipmap.hMipmappedArray
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1613
 *         if err != cudaSuccess:
 *             return err
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR:             # <<<<<<<<<<<<<<
 *         rdDst[0].resType                = cudaResourceType.cudaResourceTypeLinear
 *         rdDst[0].res.linear.devPtr      = <void *>rdSrc[0].res.linear.devPtr
 */
  __pyx_t_1 = ((__pyx_v_rdSrc[0]).resType == CU_RESOURCE_TYPE_LINEAR);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1614
 *             return err
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR:
 *         rdDst[0].resType                = cudaResourceType.cudaResourceTypeLinear             # <<<<<<<<<<<<<<
 *         rdDst[0].res.linear.devPtr      = <void *>rdSrc[0].res.linear.devPtr
 *         rdDst[0].res.linear.sizeInBytes = rdSrc[0].res.linear.sizeInBytes
 */
    (__pyx_v_rdDst[0]).resType = cudaResourceTypeLinear;

    /* "cuda/_lib/ccudart/utils.pyx":1615
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR:
 *         rdDst[0].resType                = cudaResourceType.cudaResourceTypeLinear
 *         rdDst[0].res.linear.devPtr      = <void *>rdSrc[0].res.linear.devPtr             # <<<<<<<<<<<<<<
 *         rdDst[0].res.linear.sizeInBytes = rdSrc[0].res.linear.sizeInBytes
 *         ad.Format      = rdSrc[0].res.linear.format
 */
    (__pyx_v_rdDst[0]).res.linear.devPtr = ((void *)(__pyx_v_rdSrc[0]).res.linear.devPtr);

    /* "cuda/_lib/ccudart/utils.pyx":1616
 *         rdDst[0].resType                = cudaResourceType.cudaResourceTypeLinear
 *         rdDst[0].res.linear.devPtr      = <void *>rdSrc[0].res.linear.devPtr
 *         rdDst[0].res.linear.sizeInBytes = rdSrc[0].res.linear.sizeInBytes             # <<<<<<<<<<<<<<
 *         ad.Format      = rdSrc[0].res.linear.format
 *         ad.NumChannels = rdSrc[0].res.linear.numChannels
 */
    __pyx_t_4 = (__pyx_v_rdSrc[0]).res.linear.sizeInBytes;
    (__pyx_v_rdDst[0]).res.linear.sizeInBytes = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1617
 *         rdDst[0].res.linear.devPtr      = <void *>rdSrc[0].res.linear.devPtr
 *         rdDst[0].res.linear.sizeInBytes = rdSrc[0].res.linear.sizeInBytes
 *         ad.Format      = rdSrc[0].res.linear.format             # <<<<<<<<<<<<<<
 *         ad.NumChannels = rdSrc[0].res.linear.numChannels
 *         err = getChannelFormatDescFromDriverDesc(&rdDst[0].res.linear.desc,
 */
    __pyx_t_5 = (__pyx_v_rdSrc[0]).res.linear.format;
    __pyx_v_ad.Format = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":1618
 *         rdDst[0].res.linear.sizeInBytes = rdSrc[0].res.linear.sizeInBytes
 *         ad.Format      = rdSrc[0].res.linear.format
 *         ad.NumChannels = rdSrc[0].res.linear.numChannels             # <<<<<<<<<<<<<<
 *         err = getChannelFormatDescFromDriverDesc(&rdDst[0].res.linear.desc,
 *                                                  NULL, NULL, NULL,
 */
    __pyx_t_6 = (__pyx_v_rdSrc[0]).res.linear.numChannels;
    __pyx_v_ad.NumChannels = __pyx_t_6;

    /* "cuda/_lib/ccudart/utils.pyx":1619
 *         ad.Format      = rdSrc[0].res.linear.format
 *         ad.NumChannels = rdSrc[0].res.linear.numChannels
 *         err = getChannelFormatDescFromDriverDesc(&rdDst[0].res.linear.desc,             # <<<<<<<<<<<<<<
 *                                                  NULL, NULL, NULL,
 *                                                  &ad)
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelFormatDescFromDriverDesc((&(__pyx_v_rdDst[0]).res.linear.desc), NULL, NULL, NULL, (&__pyx_v_ad)); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1619, __pyx_L1_error)
    __pyx_v_err = __pyx_t_2;

    /* "cuda/_lib/ccudart/utils.pyx":1622
 *                                                  NULL, NULL, NULL,
 *                                                  &ad)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D:
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1623
 *                                                  &ad)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D:
 *         rdDst[0].resType                  = cudaResourceType.cudaResourceTypePitch2D
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1622
 *                                                  NULL, NULL, NULL,
 *                                                  &ad)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1613
 *         if err != cudaSuccess:
 *             return err
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR:             # <<<<<<<<<<<<<<
 *         rdDst[0].resType                = cudaResourceType.cudaResourceTypeLinear
 *         rdDst[0].res.linear.devPtr      = <void *>rdSrc[0].res.linear.devPtr
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1624
 *         if err != cudaSuccess:
 *             return err
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D:             # <<<<<<<<<<<<<<
 *         rdDst[0].resType                  = cudaResourceType.cudaResourceTypePitch2D
 *         rdDst[0].res.pitch2D.devPtr       = <void *>rdSrc[0].res.pitch2D.devPtr
 */
  __pyx_t_1 = ((__pyx_v_rdSrc[0]).resType == CU_RESOURCE_TYPE_PITCH2D);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1625
 *             return err
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D:
 *         rdDst[0].resType                  = cudaResourceType.cudaResourceTypePitch2D             # <<<<<<<<<<<<<<
 *         rdDst[0].res.pitch2D.devPtr       = <void *>rdSrc[0].res.pitch2D.devPtr
 *         rdDst[0].res.pitch2D.pitchInBytes = rdSrc[0].res.pitch2D.pitchInBytes
 */
    (__pyx_v_rdDst[0]).resType = cudaResourceTypePitch2D;

    /* "cuda/_lib/ccudart/utils.pyx":1626
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D:
 *         rdDst[0].resType                  = cudaResourceType.cudaResourceTypePitch2D
 *         rdDst[0].res.pitch2D.devPtr       = <void *>rdSrc[0].res.pitch2D.devPtr             # <<<<<<<<<<<<<<
 *         rdDst[0].res.pitch2D.pitchInBytes = rdSrc[0].res.pitch2D.pitchInBytes
 *         rdDst[0].res.pitch2D.width        = rdSrc[0].res.pitch2D.width
 */
    (__pyx_v_rdDst[0]).res.pitch2D.devPtr = ((void *)(__pyx_v_rdSrc[0]).res.pitch2D.devPtr);

    /* "cuda/_lib/ccudart/utils.pyx":1627
 *         rdDst[0].resType                  = cudaResourceType.cudaResourceTypePitch2D
 *         rdDst[0].res.pitch2D.devPtr       = <void *>rdSrc[0].res.pitch2D.devPtr
 *         rdDst[0].res.pitch2D.pitchInBytes = rdSrc[0].res.pitch2D.pitchInBytes             # <<<<<<<<<<<<<<
 *         rdDst[0].res.pitch2D.width        = rdSrc[0].res.pitch2D.width
 *         rdDst[0].res.pitch2D.height       = rdSrc[0].res.pitch2D.height
 */
    __pyx_t_4 = (__pyx_v_rdSrc[0]).res.pitch2D.pitchInBytes;
    (__pyx_v_rdDst[0]).res.pitch2D.pitchInBytes = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1628
 *         rdDst[0].res.pitch2D.devPtr       = <void *>rdSrc[0].res.pitch2D.devPtr
 *         rdDst[0].res.pitch2D.pitchInBytes = rdSrc[0].res.pitch2D.pitchInBytes
 *         rdDst[0].res.pitch2D.width        = rdSrc[0].res.pitch2D.width             # <<<<<<<<<<<<<<
 *         rdDst[0].res.pitch2D.height       = rdSrc[0].res.pitch2D.height
 *         ad.Format      = rdSrc[0].res.linear.format
 */
    __pyx_t_4 = (__pyx_v_rdSrc[0]).res.pitch2D.width;
    (__pyx_v_rdDst[0]).res.pitch2D.width = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1629
 *         rdDst[0].res.pitch2D.pitchInBytes = rdSrc[0].res.pitch2D.pitchInBytes
 *         rdDst[0].res.pitch2D.width        = rdSrc[0].res.pitch2D.width
 *         rdDst[0].res.pitch2D.height       = rdSrc[0].res.pitch2D.height             # <<<<<<<<<<<<<<
 *         ad.Format      = rdSrc[0].res.linear.format
 *         ad.NumChannels = rdSrc[0].res.linear.numChannels
 */
    __pyx_t_4 = (__pyx_v_rdSrc[0]).res.pitch2D.height;
    (__pyx_v_rdDst[0]).res.pitch2D.height = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1630
 *         rdDst[0].res.pitch2D.width        = rdSrc[0].res.pitch2D.width
 *         rdDst[0].res.pitch2D.height       = rdSrc[0].res.pitch2D.height
 *         ad.Format      = rdSrc[0].res.linear.format             # <<<<<<<<<<<<<<
 *         ad.NumChannels = rdSrc[0].res.linear.numChannels
 *         err = getChannelFormatDescFromDriverDesc(&rdDst[0].res.linear.desc,
 */
    __pyx_t_5 = (__pyx_v_rdSrc[0]).res.linear.format;
    __pyx_v_ad.Format = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":1631
 *         rdDst[0].res.pitch2D.height       = rdSrc[0].res.pitch2D.height
 *         ad.Format      = rdSrc[0].res.linear.format
 *         ad.NumChannels = rdSrc[0].res.linear.numChannels             # <<<<<<<<<<<<<<
 *         err = getChannelFormatDescFromDriverDesc(&rdDst[0].res.linear.desc,
 *                                                 NULL, NULL, NULL,
 */
    __pyx_t_6 = (__pyx_v_rdSrc[0]).res.linear.numChannels;
    __pyx_v_ad.NumChannels = __pyx_t_6;

    /* "cuda/_lib/ccudart/utils.pyx":1632
 *         ad.Format      = rdSrc[0].res.linear.format
 *         ad.NumChannels = rdSrc[0].res.linear.numChannels
 *         err = getChannelFormatDescFromDriverDesc(&rdDst[0].res.linear.desc,             # <<<<<<<<<<<<<<
 *                                                 NULL, NULL, NULL,
 *                                                 &ad)
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelFormatDescFromDriverDesc((&(__pyx_v_rdDst[0]).res.linear.desc), NULL, NULL, NULL, (&__pyx_v_ad)); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1632, __pyx_L1_error)
    __pyx_v_err = __pyx_t_2;

    /* "cuda/_lib/ccudart/utils.pyx":1635
 *                                                 NULL, NULL, NULL,
 *                                                 &ad)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     else:
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1636
 *                                                 &ad)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorInvalidValue
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1635
 *                                                 NULL, NULL, NULL,
 *                                                 &ad)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     else:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1624
 *         if err != cudaSuccess:
 *             return err
 *     elif rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D:             # <<<<<<<<<<<<<<
 *         rdDst[0].resType                  = cudaResourceType.cudaResourceTypePitch2D
 *         rdDst[0].res.pitch2D.devPtr       = <void *>rdSrc[0].res.pitch2D.devPtr
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1638
 *             return err
 *     else:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     if tdDst and tdSrc:
 */
  /*else*/ {
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "cuda/_lib/ccudart/utils.pyx":1640
 *         return cudaErrorInvalidValue
 * 
 *     if tdDst and tdSrc:             # <<<<<<<<<<<<<<
 *         memset(tdDst, 0, sizeof(tdDst[0]))
 *         i = 0
 */
  __pyx_t_7 = (__pyx_v_tdDst != 0);
  if (__pyx_t_7) {
  } else {
    __pyx_t_1 = __pyx_t_7;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_tdSrc != 0);
  __pyx_t_1 = __pyx_t_7;
  __pyx_L10_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1641
 * 
 *     if tdDst and tdSrc:
 *         memset(tdDst, 0, sizeof(tdDst[0]))             # <<<<<<<<<<<<<<
 *         i = 0
 *         while i < 3:
 */
    (void)(memset(__pyx_v_tdDst, 0, (sizeof((__pyx_v_tdDst[0])))));

    /* "cuda/_lib/ccudart/utils.pyx":1642
 *     if tdDst and tdSrc:
 *         memset(tdDst, 0, sizeof(tdDst[0]))
 *         i = 0             # <<<<<<<<<<<<<<
 *         while i < 3:
 *             tdDst[0].addressMode[i] = <cudaTextureAddressMode>tdSrc[0].addressMode[i]
 */
    __pyx_v_i = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1643
 *         memset(tdDst, 0, sizeof(tdDst[0]))
 *         i = 0
 *         while i < 3:             # <<<<<<<<<<<<<<
 *             tdDst[0].addressMode[i] = <cudaTextureAddressMode>tdSrc[0].addressMode[i]
 *             i += 1
 */
    while (1) {
      __pyx_t_1 = (__pyx_v_i < 3);
      if (!__pyx_t_1) break;

      /* "cuda/_lib/ccudart/utils.pyx":1644
 *         i = 0
 *         while i < 3:
 *             tdDst[0].addressMode[i] = <cudaTextureAddressMode>tdSrc[0].addressMode[i]             # <<<<<<<<<<<<<<
 *             i += 1
 * 
 */
      ((__pyx_v_tdDst[0]).addressMode[__pyx_v_i]) = ((enum cudaTextureAddressMode)((__pyx_v_tdSrc[0]).addressMode[__pyx_v_i]));

      /* "cuda/_lib/ccudart/utils.pyx":1645
 *         while i < 3:
 *             tdDst[0].addressMode[i] = <cudaTextureAddressMode>tdSrc[0].addressMode[i]
 *             i += 1             # <<<<<<<<<<<<<<
 * 
 *         tdDst[0].filterMode          = <cudaTextureFilterMode>tdSrc[0].filterMode
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }

    /* "cuda/_lib/ccudart/utils.pyx":1647
 *             i += 1
 * 
 *         tdDst[0].filterMode          = <cudaTextureFilterMode>tdSrc[0].filterMode             # <<<<<<<<<<<<<<
 *         tdDst[0].mipmapFilterMode    = <cudaTextureFilterMode>tdSrc[0].mipmapFilterMode
 *         tdDst[0].mipmapLevelBias     = tdSrc[0].mipmapLevelBias
 */
    (__pyx_v_tdDst[0]).filterMode = ((enum cudaTextureFilterMode)(__pyx_v_tdSrc[0]).filterMode);

    /* "cuda/_lib/ccudart/utils.pyx":1648
 * 
 *         tdDst[0].filterMode          = <cudaTextureFilterMode>tdSrc[0].filterMode
 *         tdDst[0].mipmapFilterMode    = <cudaTextureFilterMode>tdSrc[0].mipmapFilterMode             # <<<<<<<<<<<<<<
 *         tdDst[0].mipmapLevelBias     = tdSrc[0].mipmapLevelBias
 *         tdDst[0].minMipmapLevelClamp = tdSrc[0].minMipmapLevelClamp
 */
    (__pyx_v_tdDst[0]).mipmapFilterMode = ((enum cudaTextureFilterMode)(__pyx_v_tdSrc[0]).mipmapFilterMode);

    /* "cuda/_lib/ccudart/utils.pyx":1649
 *         tdDst[0].filterMode          = <cudaTextureFilterMode>tdSrc[0].filterMode
 *         tdDst[0].mipmapFilterMode    = <cudaTextureFilterMode>tdSrc[0].mipmapFilterMode
 *         tdDst[0].mipmapLevelBias     = tdSrc[0].mipmapLevelBias             # <<<<<<<<<<<<<<
 *         tdDst[0].minMipmapLevelClamp = tdSrc[0].minMipmapLevelClamp
 *         tdDst[0].maxMipmapLevelClamp = tdSrc[0].maxMipmapLevelClamp
 */
    __pyx_t_8 = (__pyx_v_tdSrc[0]).mipmapLevelBias;
    (__pyx_v_tdDst[0]).mipmapLevelBias = __pyx_t_8;

    /* "cuda/_lib/ccudart/utils.pyx":1650
 *         tdDst[0].mipmapFilterMode    = <cudaTextureFilterMode>tdSrc[0].mipmapFilterMode
 *         tdDst[0].mipmapLevelBias     = tdSrc[0].mipmapLevelBias
 *         tdDst[0].minMipmapLevelClamp = tdSrc[0].minMipmapLevelClamp             # <<<<<<<<<<<<<<
 *         tdDst[0].maxMipmapLevelClamp = tdSrc[0].maxMipmapLevelClamp
 *         tdDst[0].maxAnisotropy       = tdSrc[0].maxAnisotropy
 */
    __pyx_t_8 = (__pyx_v_tdSrc[0]).minMipmapLevelClamp;
    (__pyx_v_tdDst[0]).minMipmapLevelClamp = __pyx_t_8;

    /* "cuda/_lib/ccudart/utils.pyx":1651
 *         tdDst[0].mipmapLevelBias     = tdSrc[0].mipmapLevelBias
 *         tdDst[0].minMipmapLevelClamp = tdSrc[0].minMipmapLevelClamp
 *         tdDst[0].maxMipmapLevelClamp = tdSrc[0].maxMipmapLevelClamp             # <<<<<<<<<<<<<<
 *         tdDst[0].maxAnisotropy       = tdSrc[0].maxAnisotropy
 *         i = 0
 */
    __pyx_t_8 = (__pyx_v_tdSrc[0]).maxMipmapLevelClamp;
    (__pyx_v_tdDst[0]).maxMipmapLevelClamp = __pyx_t_8;

    /* "cuda/_lib/ccudart/utils.pyx":1652
 *         tdDst[0].minMipmapLevelClamp = tdSrc[0].minMipmapLevelClamp
 *         tdDst[0].maxMipmapLevelClamp = tdSrc[0].maxMipmapLevelClamp
 *         tdDst[0].maxAnisotropy       = tdSrc[0].maxAnisotropy             # <<<<<<<<<<<<<<
 *         i = 0
 *         while i < 4:
 */
    __pyx_t_6 = (__pyx_v_tdSrc[0]).maxAnisotropy;
    (__pyx_v_tdDst[0]).maxAnisotropy = __pyx_t_6;

    /* "cuda/_lib/ccudart/utils.pyx":1653
 *         tdDst[0].maxMipmapLevelClamp = tdSrc[0].maxMipmapLevelClamp
 *         tdDst[0].maxAnisotropy       = tdSrc[0].maxAnisotropy
 *         i = 0             # <<<<<<<<<<<<<<
 *         while i < 4:
 *             tdDst[0].borderColor[i] = tdSrc[0].borderColor[i]
 */
    __pyx_v_i = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1654
 *         tdDst[0].maxAnisotropy       = tdSrc[0].maxAnisotropy
 *         i = 0
 *         while i < 4:             # <<<<<<<<<<<<<<
 *             tdDst[0].borderColor[i] = tdSrc[0].borderColor[i]
 *             i += 1
 */
    while (1) {
      __pyx_t_1 = (__pyx_v_i < 4);
      if (!__pyx_t_1) break;

      /* "cuda/_lib/ccudart/utils.pyx":1655
 *         i = 0
 *         while i < 4:
 *             tdDst[0].borderColor[i] = tdSrc[0].borderColor[i]             # <<<<<<<<<<<<<<
 *             i += 1
 * 
 */
      ((__pyx_v_tdDst[0]).borderColor[__pyx_v_i]) = ((__pyx_v_tdSrc[0]).borderColor[__pyx_v_i]);

      /* "cuda/_lib/ccudart/utils.pyx":1656
 *         while i < 4:
 *             tdDst[0].borderColor[i] = tdSrc[0].borderColor[i]
 *             i += 1             # <<<<<<<<<<<<<<
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_SRGB:
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }

    /* "cuda/_lib/ccudart/utils.pyx":1658
 *             i += 1
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_SRGB:             # <<<<<<<<<<<<<<
 *             tdDst[0].sRGB                         = 1
 *         else:
 */
    __pyx_t_1 = (((__pyx_v_tdSrc[0]).flags & __pyx_e_4cuda_5ccuda_CU_TRSF_SRGB) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1659
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_SRGB:
 *             tdDst[0].sRGB                         = 1             # <<<<<<<<<<<<<<
 *         else:
 *             tdDst[0].sRGB                         = 0
 */
      (__pyx_v_tdDst[0]).sRGB = 1;

      /* "cuda/_lib/ccudart/utils.pyx":1658
 *             i += 1
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_SRGB:             # <<<<<<<<<<<<<<
 *             tdDst[0].sRGB                         = 1
 *         else:
 */
      goto __pyx_L16;
    }

    /* "cuda/_lib/ccudart/utils.pyx":1661
 *             tdDst[0].sRGB                         = 1
 *         else:
 *             tdDst[0].sRGB                         = 0             # <<<<<<<<<<<<<<
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_NORMALIZED_COORDINATES:
 */
    /*else*/ {
      (__pyx_v_tdDst[0]).sRGB = 0;
    }
    __pyx_L16:;

    /* "cuda/_lib/ccudart/utils.pyx":1663
 *             tdDst[0].sRGB                         = 0
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_NORMALIZED_COORDINATES:             # <<<<<<<<<<<<<<
 *             tdDst[0].normalizedCoords             = 1
 *         else:
 */
    __pyx_t_1 = (((__pyx_v_tdSrc[0]).flags & __pyx_e_4cuda_5ccuda_CU_TRSF_NORMALIZED_COORDINATES) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1664
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_NORMALIZED_COORDINATES:
 *             tdDst[0].normalizedCoords             = 1             # <<<<<<<<<<<<<<
 *         else:
 *             tdDst[0].normalizedCoords             = 0
 */
      (__pyx_v_tdDst[0]).normalizedCoords = 1;

      /* "cuda/_lib/ccudart/utils.pyx":1663
 *             tdDst[0].sRGB                         = 0
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_NORMALIZED_COORDINATES:             # <<<<<<<<<<<<<<
 *             tdDst[0].normalizedCoords             = 1
 *         else:
 */
      goto __pyx_L17;
    }

    /* "cuda/_lib/ccudart/utils.pyx":1666
 *             tdDst[0].normalizedCoords             = 1
 *         else:
 *             tdDst[0].normalizedCoords             = 0             # <<<<<<<<<<<<<<
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION:
 */
    /*else*/ {
      (__pyx_v_tdDst[0]).normalizedCoords = 0;
    }
    __pyx_L17:;

    /* "cuda/_lib/ccudart/utils.pyx":1668
 *             tdDst[0].normalizedCoords             = 0
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION:             # <<<<<<<<<<<<<<
 *             tdDst[0].disableTrilinearOptimization = 1
 *         else:
 */
    __pyx_t_1 = (((__pyx_v_tdSrc[0]).flags & __pyx_e_4cuda_5ccuda_CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1669
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION:
 *             tdDst[0].disableTrilinearOptimization = 1             # <<<<<<<<<<<<<<
 *         else:
 *             tdDst[0].disableTrilinearOptimization = 0
 */
      (__pyx_v_tdDst[0]).disableTrilinearOptimization = 1;

      /* "cuda/_lib/ccudart/utils.pyx":1668
 *             tdDst[0].normalizedCoords             = 0
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION:             # <<<<<<<<<<<<<<
 *             tdDst[0].disableTrilinearOptimization = 1
 *         else:
 */
      goto __pyx_L18;
    }

    /* "cuda/_lib/ccudart/utils.pyx":1671
 *             tdDst[0].disableTrilinearOptimization = 1
 *         else:
 *             tdDst[0].disableTrilinearOptimization = 0             # <<<<<<<<<<<<<<
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_SEAMLESS_CUBEMAP:
 */
    /*else*/ {
      (__pyx_v_tdDst[0]).disableTrilinearOptimization = 0;
    }
    __pyx_L18:;

    /* "cuda/_lib/ccudart/utils.pyx":1673
 *             tdDst[0].disableTrilinearOptimization = 0
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_SEAMLESS_CUBEMAP:             # <<<<<<<<<<<<<<
 *             tdDst[0].seamlessCubemap |= 1
 *         else:
 */
    __pyx_t_1 = (((__pyx_v_tdSrc[0]).flags & __pyx_e_4cuda_5ccuda_CU_TRSF_SEAMLESS_CUBEMAP) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1674
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_SEAMLESS_CUBEMAP:
 *             tdDst[0].seamlessCubemap |= 1             # <<<<<<<<<<<<<<
 *         else:
 *             tdDst[0].seamlessCubemap |= 0
 */
      __pyx_t_9 = 0;
      (__pyx_v_tdDst[__pyx_t_9]).seamlessCubemap = ((__pyx_v_tdDst[__pyx_t_9]).seamlessCubemap | 1);

      /* "cuda/_lib/ccudart/utils.pyx":1673
 *             tdDst[0].disableTrilinearOptimization = 0
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_SEAMLESS_CUBEMAP:             # <<<<<<<<<<<<<<
 *             tdDst[0].seamlessCubemap |= 1
 *         else:
 */
      goto __pyx_L19;
    }

    /* "cuda/_lib/ccudart/utils.pyx":1676
 *             tdDst[0].seamlessCubemap |= 1
 *         else:
 *             tdDst[0].seamlessCubemap |= 0             # <<<<<<<<<<<<<<
 * 
 *         if ad.Format in (ccuda.CU_AD_FORMAT_SNORM_INT8X1,
 */
    /*else*/ {
      __pyx_t_9 = 0;
      (__pyx_v_tdDst[__pyx_t_9]).seamlessCubemap = ((__pyx_v_tdDst[__pyx_t_9]).seamlessCubemap | 0);
    }
    __pyx_L19:;

    /* "cuda/_lib/ccudart/utils.pyx":1678
 *             tdDst[0].seamlessCubemap |= 0
 * 
 *         if ad.Format in (ccuda.CU_AD_FORMAT_SNORM_INT8X1,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_SNORM_INT8X2,
 *                          ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 */
    switch (__pyx_v_ad.Format) {
      case CU_AD_FORMAT_SNORM_INT8X1:
      case CU_AD_FORMAT_SNORM_INT8X2:

      /* "cuda/_lib/ccudart/utils.pyx":1679
 * 
 *         if ad.Format in (ccuda.CU_AD_FORMAT_SNORM_INT8X1,
 *                          ccuda.CU_AD_FORMAT_SNORM_INT8X2,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT8X1,
 */
      case CU_AD_FORMAT_SNORM_INT8X4:

      /* "cuda/_lib/ccudart/utils.pyx":1680
 *         if ad.Format in (ccuda.CU_AD_FORMAT_SNORM_INT8X1,
 *                          ccuda.CU_AD_FORMAT_SNORM_INT8X2,
 *                          ccuda.CU_AD_FORMAT_SNORM_INT8X4,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_UNORM_INT8X1,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT8X2,
 */
      case CU_AD_FORMAT_UNORM_INT8X1:

      /* "cuda/_lib/ccudart/utils.pyx":1681
 *                          ccuda.CU_AD_FORMAT_SNORM_INT8X2,
 *                          ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT8X1,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_UNORM_INT8X2,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT8X4,
 */
      case CU_AD_FORMAT_UNORM_INT8X2:

      /* "cuda/_lib/ccudart/utils.pyx":1682
 *                          ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT8X1,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT8X2,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_UNORM_INT8X4,
 *                          ccuda.CU_AD_FORMAT_SNORM_INT16X1,
 */
      case CU_AD_FORMAT_UNORM_INT8X4:

      /* "cuda/_lib/ccudart/utils.pyx":1683
 *                          ccuda.CU_AD_FORMAT_UNORM_INT8X1,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT8X2,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT8X4,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_SNORM_INT16X1,
 *                          ccuda.CU_AD_FORMAT_SNORM_INT16X2,
 */
      case CU_AD_FORMAT_SNORM_INT16X1:

      /* "cuda/_lib/ccudart/utils.pyx":1684
 *                          ccuda.CU_AD_FORMAT_UNORM_INT8X2,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT8X4,
 *                          ccuda.CU_AD_FORMAT_SNORM_INT16X1,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_SNORM_INT16X2,
 *                          ccuda.CU_AD_FORMAT_SNORM_INT16X4,
 */
      case CU_AD_FORMAT_SNORM_INT16X2:

      /* "cuda/_lib/ccudart/utils.pyx":1685
 *                          ccuda.CU_AD_FORMAT_UNORM_INT8X4,
 *                          ccuda.CU_AD_FORMAT_SNORM_INT16X1,
 *                          ccuda.CU_AD_FORMAT_SNORM_INT16X2,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_SNORM_INT16X4,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT16X1,
 */
      case CU_AD_FORMAT_SNORM_INT16X4:

      /* "cuda/_lib/ccudart/utils.pyx":1686
 *                          ccuda.CU_AD_FORMAT_SNORM_INT16X1,
 *                          ccuda.CU_AD_FORMAT_SNORM_INT16X2,
 *                          ccuda.CU_AD_FORMAT_SNORM_INT16X4,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_UNORM_INT16X1,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT16X2,
 */
      case CU_AD_FORMAT_UNORM_INT16X1:

      /* "cuda/_lib/ccudart/utils.pyx":1687
 *                          ccuda.CU_AD_FORMAT_SNORM_INT16X2,
 *                          ccuda.CU_AD_FORMAT_SNORM_INT16X4,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT16X1,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_UNORM_INT16X2,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT16X4,
 */
      case CU_AD_FORMAT_UNORM_INT16X2:

      /* "cuda/_lib/ccudart/utils.pyx":1688
 *                          ccuda.CU_AD_FORMAT_SNORM_INT16X4,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT16X1,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT16X2,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_UNORM_INT16X4,
 *                          ccuda.CU_AD_FORMAT_BC1_UNORM,
 */
      case CU_AD_FORMAT_UNORM_INT16X4:

      /* "cuda/_lib/ccudart/utils.pyx":1689
 *                          ccuda.CU_AD_FORMAT_UNORM_INT16X1,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT16X2,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT16X4,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_BC1_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB,
 */
      case CU_AD_FORMAT_BC1_UNORM:

      /* "cuda/_lib/ccudart/utils.pyx":1690
 *                          ccuda.CU_AD_FORMAT_UNORM_INT16X2,
 *                          ccuda.CU_AD_FORMAT_UNORM_INT16X4,
 *                          ccuda.CU_AD_FORMAT_BC1_UNORM,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB,
 *                          ccuda.CU_AD_FORMAT_BC2_UNORM,
 */
      case CU_AD_FORMAT_BC1_UNORM_SRGB:

      /* "cuda/_lib/ccudart/utils.pyx":1691
 *                          ccuda.CU_AD_FORMAT_UNORM_INT16X4,
 *                          ccuda.CU_AD_FORMAT_BC1_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_BC2_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 */
      case CU_AD_FORMAT_BC2_UNORM:

      /* "cuda/_lib/ccudart/utils.pyx":1692
 *                          ccuda.CU_AD_FORMAT_BC1_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB,
 *                          ccuda.CU_AD_FORMAT_BC2_UNORM,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 *                          ccuda.CU_AD_FORMAT_BC3_UNORM,
 */
      case CU_AD_FORMAT_BC2_UNORM_SRGB:

      /* "cuda/_lib/ccudart/utils.pyx":1693
 *                          ccuda.CU_AD_FORMAT_BC1_UNORM_SRGB,
 *                          ccuda.CU_AD_FORMAT_BC2_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_BC3_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,
 */
      case CU_AD_FORMAT_BC3_UNORM:

      /* "cuda/_lib/ccudart/utils.pyx":1694
 *                          ccuda.CU_AD_FORMAT_BC2_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 *                          ccuda.CU_AD_FORMAT_BC3_UNORM,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,
 *                          ccuda.CU_AD_FORMAT_BC4_UNORM,
 */
      case CU_AD_FORMAT_BC3_UNORM_SRGB:

      /* "cuda/_lib/ccudart/utils.pyx":1695
 *                          ccuda.CU_AD_FORMAT_BC2_UNORM_SRGB,
 *                          ccuda.CU_AD_FORMAT_BC3_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_BC4_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC4_SNORM,
 */
      case CU_AD_FORMAT_BC4_UNORM:

      /* "cuda/_lib/ccudart/utils.pyx":1696
 *                          ccuda.CU_AD_FORMAT_BC3_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,
 *                          ccuda.CU_AD_FORMAT_BC4_UNORM,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_BC4_SNORM,
 *                          ccuda.CU_AD_FORMAT_BC5_UNORM,
 */
      case CU_AD_FORMAT_BC4_SNORM:

      /* "cuda/_lib/ccudart/utils.pyx":1697
 *                          ccuda.CU_AD_FORMAT_BC3_UNORM_SRGB,
 *                          ccuda.CU_AD_FORMAT_BC4_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC4_SNORM,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_BC5_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC5_SNORM,
 */
      case CU_AD_FORMAT_BC5_UNORM:

      /* "cuda/_lib/ccudart/utils.pyx":1698
 *                          ccuda.CU_AD_FORMAT_BC4_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC4_SNORM,
 *                          ccuda.CU_AD_FORMAT_BC5_UNORM,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_BC5_SNORM,
 *                          ccuda.CU_AD_FORMAT_BC7_UNORM,
 */
      case CU_AD_FORMAT_BC5_SNORM:

      /* "cuda/_lib/ccudart/utils.pyx":1699
 *                          ccuda.CU_AD_FORMAT_BC4_SNORM,
 *                          ccuda.CU_AD_FORMAT_BC5_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC5_SNORM,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_BC7_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 */
      case CU_AD_FORMAT_BC7_UNORM:

      /* "cuda/_lib/ccudart/utils.pyx":1700
 *                          ccuda.CU_AD_FORMAT_BC5_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC5_SNORM,
 *                          ccuda.CU_AD_FORMAT_BC7_UNORM,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 *             tdDst[0].readMode = cudaTextureReadMode.cudaReadModeNormalizedFloat
 */
      case CU_AD_FORMAT_BC7_UNORM_SRGB:

      /* "cuda/_lib/ccudart/utils.pyx":1702
 *                          ccuda.CU_AD_FORMAT_BC7_UNORM,
 *                          ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 *             tdDst[0].readMode = cudaTextureReadMode.cudaReadModeNormalizedFloat             # <<<<<<<<<<<<<<
 *         elif ad.Format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,
 *                            ccuda.CU_AD_FORMAT_SIGNED_INT16,
 */
      (__pyx_v_tdDst[0]).readMode = cudaReadModeNormalizedFloat;

      /* "cuda/_lib/ccudart/utils.pyx":1678
 *             tdDst[0].seamlessCubemap |= 0
 * 
 *         if ad.Format in (ccuda.CU_AD_FORMAT_SNORM_INT8X1,             # <<<<<<<<<<<<<<
 *                          ccuda.CU_AD_FORMAT_SNORM_INT8X2,
 *                          ccuda.CU_AD_FORMAT_SNORM_INT8X4,
 */
      break;
      case CU_AD_FORMAT_SIGNED_INT8:

      /* "cuda/_lib/ccudart/utils.pyx":1703
 *                          ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 *             tdDst[0].readMode = cudaTextureReadMode.cudaReadModeNormalizedFloat
 *         elif ad.Format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,             # <<<<<<<<<<<<<<
 *                            ccuda.CU_AD_FORMAT_SIGNED_INT16,
 *                            ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 */
      case CU_AD_FORMAT_SIGNED_INT16:

      /* "cuda/_lib/ccudart/utils.pyx":1704
 *             tdDst[0].readMode = cudaTextureReadMode.cudaReadModeNormalizedFloat
 *         elif ad.Format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,
 *                            ccuda.CU_AD_FORMAT_SIGNED_INT16,             # <<<<<<<<<<<<<<
 *                            ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 *                            ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 */
      case CU_AD_FORMAT_UNSIGNED_INT8:

      /* "cuda/_lib/ccudart/utils.pyx":1705
 *         elif ad.Format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,
 *                            ccuda.CU_AD_FORMAT_SIGNED_INT16,
 *                            ccuda.CU_AD_FORMAT_UNSIGNED_INT8,             # <<<<<<<<<<<<<<
 *                            ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 *             with gil:
 */
      case CU_AD_FORMAT_UNSIGNED_INT16:

      /* "cuda/_lib/ccudart/utils.pyx":1707
 *                            ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 *                            ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 *             with gil:             # <<<<<<<<<<<<<<
 *                 if (tdSrc[0].flags & ccuda.CU_TRSF_READ_AS_INTEGER):
 *                     tdDst[0].readMode = cudaTextureReadMode.cudaReadModeElementType
 */
      {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          #endif
          /*try:*/ {

            /* "cuda/_lib/ccudart/utils.pyx":1708
 *                            ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 *             with gil:
 *                 if (tdSrc[0].flags & ccuda.CU_TRSF_READ_AS_INTEGER):             # <<<<<<<<<<<<<<
 *                     tdDst[0].readMode = cudaTextureReadMode.cudaReadModeElementType
 *                 else:
 */
            __pyx_t_1 = (((__pyx_v_tdSrc[0]).flags & __pyx_e_4cuda_5ccuda_CU_TRSF_READ_AS_INTEGER) != 0);
            if (__pyx_t_1) {

              /* "cuda/_lib/ccudart/utils.pyx":1709
 *             with gil:
 *                 if (tdSrc[0].flags & ccuda.CU_TRSF_READ_AS_INTEGER):
 *                     tdDst[0].readMode = cudaTextureReadMode.cudaReadModeElementType             # <<<<<<<<<<<<<<
 *                 else:
 *                     tdDst[0].readMode = cudaTextureReadMode.cudaReadModeNormalizedFloat
 */
              (__pyx_v_tdDst[0]).readMode = cudaReadModeElementType;

              /* "cuda/_lib/ccudart/utils.pyx":1708
 *                            ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 *             with gil:
 *                 if (tdSrc[0].flags & ccuda.CU_TRSF_READ_AS_INTEGER):             # <<<<<<<<<<<<<<
 *                     tdDst[0].readMode = cudaTextureReadMode.cudaReadModeElementType
 *                 else:
 */
              goto __pyx_L23;
            }

            /* "cuda/_lib/ccudart/utils.pyx":1711
 *                     tdDst[0].readMode = cudaTextureReadMode.cudaReadModeElementType
 *                 else:
 *                     tdDst[0].readMode = cudaTextureReadMode.cudaReadModeNormalizedFloat             # <<<<<<<<<<<<<<
 *         else:
 *             tdDst[0].readMode = cudaTextureReadMode.cudaReadModeElementType
 */
            /*else*/ {
              (__pyx_v_tdDst[0]).readMode = cudaReadModeNormalizedFloat;
            }
            __pyx_L23:;
          }

          /* "cuda/_lib/ccudart/utils.pyx":1707
 *                            ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 *                            ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 *             with gil:             # <<<<<<<<<<<<<<
 *                 if (tdSrc[0].flags & ccuda.CU_TRSF_READ_AS_INTEGER):
 *                     tdDst[0].readMode = cudaTextureReadMode.cudaReadModeElementType
 */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_PyGILState_Release(__pyx_gilstate_save);
              #endif
              goto __pyx_L22;
            }
            __pyx_L22:;
          }
      }

      /* "cuda/_lib/ccudart/utils.pyx":1703
 *                          ccuda.CU_AD_FORMAT_BC7_UNORM_SRGB):
 *             tdDst[0].readMode = cudaTextureReadMode.cudaReadModeNormalizedFloat
 *         elif ad.Format in (ccuda.CU_AD_FORMAT_SIGNED_INT8,             # <<<<<<<<<<<<<<
 *                            ccuda.CU_AD_FORMAT_SIGNED_INT16,
 *                            ccuda.CU_AD_FORMAT_UNSIGNED_INT8,
 */
      break;
      default:

      /* "cuda/_lib/ccudart/utils.pyx":1713
 *                     tdDst[0].readMode = cudaTextureReadMode.cudaReadModeNormalizedFloat
 *         else:
 *             tdDst[0].readMode = cudaTextureReadMode.cudaReadModeElementType             # <<<<<<<<<<<<<<
 * 
 *     if rvdDst and rvdSrc:
 */
      (__pyx_v_tdDst[0]).readMode = cudaReadModeElementType;
      break;
    }

    /* "cuda/_lib/ccudart/utils.pyx":1640
 *         return cudaErrorInvalidValue
 * 
 *     if tdDst and tdSrc:             # <<<<<<<<<<<<<<
 *         memset(tdDst, 0, sizeof(tdDst[0]))
 *         i = 0
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1715
 *             tdDst[0].readMode = cudaTextureReadMode.cudaReadModeElementType
 * 
 *     if rvdDst and rvdSrc:             # <<<<<<<<<<<<<<
 *         memset(rvdDst, 0, sizeof(rvdDst[0]))
 * 
 */
  __pyx_t_7 = (__pyx_v_rvdDst != 0);
  if (__pyx_t_7) {
  } else {
    __pyx_t_1 = __pyx_t_7;
    goto __pyx_L25_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_rvdSrc != 0);
  __pyx_t_1 = __pyx_t_7;
  __pyx_L25_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1716
 * 
 *     if rvdDst and rvdSrc:
 *         memset(rvdDst, 0, sizeof(rvdDst[0]))             # <<<<<<<<<<<<<<
 * 
 *         rvdDst[0].format           = <cudaResourceViewFormat>rvdSrc[0].format
 */
    (void)(memset(__pyx_v_rvdDst, 0, (sizeof((__pyx_v_rvdDst[0])))));

    /* "cuda/_lib/ccudart/utils.pyx":1718
 *         memset(rvdDst, 0, sizeof(rvdDst[0]))
 * 
 *         rvdDst[0].format           = <cudaResourceViewFormat>rvdSrc[0].format             # <<<<<<<<<<<<<<
 *         rvdDst[0].width            = rvdSrc[0].width
 *         rvdDst[0].height           = rvdSrc[0].height
 */
    (__pyx_v_rvdDst[0]).format = ((enum cudaResourceViewFormat)(__pyx_v_rvdSrc[0]).format);

    /* "cuda/_lib/ccudart/utils.pyx":1719
 * 
 *         rvdDst[0].format           = <cudaResourceViewFormat>rvdSrc[0].format
 *         rvdDst[0].width            = rvdSrc[0].width             # <<<<<<<<<<<<<<
 *         rvdDst[0].height           = rvdSrc[0].height
 *         rvdDst[0].depth            = rvdSrc[0].depth
 */
    __pyx_t_4 = (__pyx_v_rvdSrc[0]).width;
    (__pyx_v_rvdDst[0]).width = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1720
 *         rvdDst[0].format           = <cudaResourceViewFormat>rvdSrc[0].format
 *         rvdDst[0].width            = rvdSrc[0].width
 *         rvdDst[0].height           = rvdSrc[0].height             # <<<<<<<<<<<<<<
 *         rvdDst[0].depth            = rvdSrc[0].depth
 *         rvdDst[0].firstMipmapLevel = rvdSrc[0].firstMipmapLevel
 */
    __pyx_t_4 = (__pyx_v_rvdSrc[0]).height;
    (__pyx_v_rvdDst[0]).height = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1721
 *         rvdDst[0].width            = rvdSrc[0].width
 *         rvdDst[0].height           = rvdSrc[0].height
 *         rvdDst[0].depth            = rvdSrc[0].depth             # <<<<<<<<<<<<<<
 *         rvdDst[0].firstMipmapLevel = rvdSrc[0].firstMipmapLevel
 *         rvdDst[0].lastMipmapLevel  = rvdSrc[0].lastMipmapLevel
 */
    __pyx_t_4 = (__pyx_v_rvdSrc[0]).depth;
    (__pyx_v_rvdDst[0]).depth = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1722
 *         rvdDst[0].height           = rvdSrc[0].height
 *         rvdDst[0].depth            = rvdSrc[0].depth
 *         rvdDst[0].firstMipmapLevel = rvdSrc[0].firstMipmapLevel             # <<<<<<<<<<<<<<
 *         rvdDst[0].lastMipmapLevel  = rvdSrc[0].lastMipmapLevel
 *         rvdDst[0].firstLayer       = rvdSrc[0].firstLayer
 */
    __pyx_t_6 = (__pyx_v_rvdSrc[0]).firstMipmapLevel;
    (__pyx_v_rvdDst[0]).firstMipmapLevel = __pyx_t_6;

    /* "cuda/_lib/ccudart/utils.pyx":1723
 *         rvdDst[0].depth            = rvdSrc[0].depth
 *         rvdDst[0].firstMipmapLevel = rvdSrc[0].firstMipmapLevel
 *         rvdDst[0].lastMipmapLevel  = rvdSrc[0].lastMipmapLevel             # <<<<<<<<<<<<<<
 *         rvdDst[0].firstLayer       = rvdSrc[0].firstLayer
 *         rvdDst[0].lastLayer        = rvdSrc[0].lastLayer
 */
    __pyx_t_6 = (__pyx_v_rvdSrc[0]).lastMipmapLevel;
    (__pyx_v_rvdDst[0]).lastMipmapLevel = __pyx_t_6;

    /* "cuda/_lib/ccudart/utils.pyx":1724
 *         rvdDst[0].firstMipmapLevel = rvdSrc[0].firstMipmapLevel
 *         rvdDst[0].lastMipmapLevel  = rvdSrc[0].lastMipmapLevel
 *         rvdDst[0].firstLayer       = rvdSrc[0].firstLayer             # <<<<<<<<<<<<<<
 *         rvdDst[0].lastLayer        = rvdSrc[0].lastLayer
 * 
 */
    __pyx_t_6 = (__pyx_v_rvdSrc[0]).firstLayer;
    (__pyx_v_rvdDst[0]).firstLayer = __pyx_t_6;

    /* "cuda/_lib/ccudart/utils.pyx":1725
 *         rvdDst[0].lastMipmapLevel  = rvdSrc[0].lastMipmapLevel
 *         rvdDst[0].firstLayer       = rvdSrc[0].firstLayer
 *         rvdDst[0].lastLayer        = rvdSrc[0].lastLayer             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
    __pyx_t_6 = (__pyx_v_rvdSrc[0]).lastLayer;
    (__pyx_v_rvdDst[0]).lastLayer = __pyx_t_6;

    /* "cuda/_lib/ccudart/utils.pyx":1715
 *             tdDst[0].readMode = cudaTextureReadMode.cudaReadModeElementType
 * 
 *     if rvdDst and rvdSrc:             # <<<<<<<<<<<<<<
 *         memset(rvdDst, 0, sizeof(rvdDst[0]))
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1727
 *         rvdDst[0].lastLayer        = rvdSrc[0].lastLayer
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1586
 * 
 * 
 * cdef cudaError_t getResDescFromDriverResDesc(cudaResourceDesc *rdDst, const ccuda.CUDA_RESOURCE_DESC *rdSrc,             # <<<<<<<<<<<<<<
 *                                              cudaTextureDesc *tdDst, const ccuda.CUDA_TEXTURE_DESC *tdSrc,
 *                                              cudaResourceViewDesc *rvdDst, const ccuda.CUDA_RESOURCE_VIEW_DESC *rvdSrc) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1730
 * 
 * 
 * cdef cudaError_t memsetPtr(char *mem, int c, size_t count, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if count == 0:
 *         return cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_memsetPtr(char *__pyx_v_mem, int __pyx_v_c, size_t __pyx_v_count, cudaStream_t __pyx_v_sid, bool __pyx_v_async) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  CUresult __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("memsetPtr", __pyx_f[0], 1730, 1, __PYX_ERR(0, 1730, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1731
 * 
 * cdef cudaError_t memsetPtr(char *mem, int c, size_t count, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if count == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  __pyx_t_1 = (__pyx_v_count == 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1732
 * cdef cudaError_t memsetPtr(char *mem, int c, size_t count, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if count == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if not async:
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1731
 * 
 * cdef cudaError_t memsetPtr(char *mem, int c, size_t count, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if count == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1734
 *         return cudaSuccess
 * 
 *     if not async:             # <<<<<<<<<<<<<<
 *         return <cudaError_t>ccuda._cuMemsetD8_v2(<ccuda.CUdeviceptr_v2>mem, <unsigned char>c, count)
 *     else:
 */
  __pyx_t_1 = (!(__pyx_v_async != 0));
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1735
 * 
 *     if not async:
 *         return <cudaError_t>ccuda._cuMemsetD8_v2(<ccuda.CUdeviceptr_v2>mem, <unsigned char>c, count)             # <<<<<<<<<<<<<<
 *     else:
 *         return <cudaError_t>ccuda._cuMemsetD8Async(<ccuda.CUdeviceptr_v2>mem, <unsigned char>c, count, sid)
 */
    __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemsetD8_v2(((CUdeviceptr_v2)__pyx_v_mem), ((unsigned char)__pyx_v_c), __pyx_v_count); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1735, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_2);
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1734
 *         return cudaSuccess
 * 
 *     if not async:             # <<<<<<<<<<<<<<
 *         return <cudaError_t>ccuda._cuMemsetD8_v2(<ccuda.CUdeviceptr_v2>mem, <unsigned char>c, count)
 *     else:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1737
 *         return <cudaError_t>ccuda._cuMemsetD8_v2(<ccuda.CUdeviceptr_v2>mem, <unsigned char>c, count)
 *     else:
 *         return <cudaError_t>ccuda._cuMemsetD8Async(<ccuda.CUdeviceptr_v2>mem, <unsigned char>c, count, sid)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemsetD8Async(((CUdeviceptr_v2)__pyx_v_mem), ((unsigned char)__pyx_v_c), __pyx_v_count, __pyx_v_sid); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1737, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_2);
    goto __pyx_L0;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1730
 * 
 * 
 * cdef cudaError_t memsetPtr(char *mem, int c, size_t count, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if count == 0:
 *         return cudaSuccess
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1740
 * 
 * 
 * cdef cudaError_t memset2DPtr(char *mem, size_t pitch, int c, size_t width, size_t height, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if width == 0 or height == 0:
 *         return cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_memset2DPtr(char *__pyx_v_mem, size_t __pyx_v_pitch, int __pyx_v_c, size_t __pyx_v_width, size_t __pyx_v_height, cudaStream_t __pyx_v_sid, bool __pyx_v_async) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __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("memset2DPtr", __pyx_f[0], 1740, 1, __PYX_ERR(0, 1740, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1741
 * 
 * cdef cudaError_t memset2DPtr(char *mem, size_t pitch, int c, size_t width, size_t height, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  __pyx_t_2 = (__pyx_v_width == 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_height == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1742
 * cdef cudaError_t memset2DPtr(char *mem, size_t pitch, int c, size_t width, size_t height, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if width == 0 or height == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if not async:
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1741
 * 
 * cdef cudaError_t memset2DPtr(char *mem, size_t pitch, int c, size_t width, size_t height, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1744
 *         return cudaSuccess
 * 
 *     if not async:             # <<<<<<<<<<<<<<
 *         return <cudaError_t>ccuda._cuMemsetD2D8_v2(<ccuda.CUdeviceptr_v2>mem, pitch, <unsigned char>c, width, height)
 *     else:
 */
  __pyx_t_1 = (!(__pyx_v_async != 0));
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1745
 * 
 *     if not async:
 *         return <cudaError_t>ccuda._cuMemsetD2D8_v2(<ccuda.CUdeviceptr_v2>mem, pitch, <unsigned char>c, width, height)             # <<<<<<<<<<<<<<
 *     else:
 *         return <cudaError_t>ccuda._cuMemsetD2D8Async(<ccuda.CUdeviceptr_v2>mem, pitch, <unsigned char>c, width, height, sid)
 */
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemsetD2D8_v2(((CUdeviceptr_v2)__pyx_v_mem), __pyx_v_pitch, ((unsigned char)__pyx_v_c), __pyx_v_width, __pyx_v_height); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1745, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_3);
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1744
 *         return cudaSuccess
 * 
 *     if not async:             # <<<<<<<<<<<<<<
 *         return <cudaError_t>ccuda._cuMemsetD2D8_v2(<ccuda.CUdeviceptr_v2>mem, pitch, <unsigned char>c, width, height)
 *     else:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1747
 *         return <cudaError_t>ccuda._cuMemsetD2D8_v2(<ccuda.CUdeviceptr_v2>mem, pitch, <unsigned char>c, width, height)
 *     else:
 *         return <cudaError_t>ccuda._cuMemsetD2D8Async(<ccuda.CUdeviceptr_v2>mem, pitch, <unsigned char>c, width, height, sid)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemsetD2D8Async(((CUdeviceptr_v2)__pyx_v_mem), __pyx_v_pitch, ((unsigned char)__pyx_v_c), __pyx_v_width, __pyx_v_height, __pyx_v_sid); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1747, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_3);
    goto __pyx_L0;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1740
 * 
 * 
 * cdef cudaError_t memset2DPtr(char *mem, size_t pitch, int c, size_t width, size_t height, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if width == 0 or height == 0:
 *         return cudaSuccess
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1750
 * 
 * 
 * cdef cudaError_t copyFromHost(cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *src, size_t count, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromHost(cudaArray_const_t __pyx_v_thisArray, size_t __pyx_v_hOffset, size_t __pyx_v_wOffset, char const *__pyx_v_src, size_t __pyx_v_count, CUstream __pyx_v_stream, bool __pyx_v_async) {
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaArrayLocalState __pyx_v_arrayState;
  cudaError_t __pyx_v_err;
  size_t __pyx_v_copied;
  CUDA_MEMCPY3D_v2 __pyx_v_cp;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  CUarray __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("copyFromHost", __pyx_f[0], 1750, 1, __PYX_ERR(0, 1750, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1752
 * cdef cudaError_t copyFromHost(cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *src, size_t count, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":1753
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))             # <<<<<<<<<<<<<<
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v_arrayState), 0, (sizeof(__pyx_v_arrayState))));

  /* "cuda/_lib/ccudart/utils.pyx":1754
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getLocalState((&__pyx_v_arrayState), __pyx_v_thisArray); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1754, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1755
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t copied = 0
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1756
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef size_t copied = 0
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1755
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t copied = 0
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1757
 *     if err != cudaSuccess:
 *         return err
 *     cdef size_t copied = 0             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)
 * 
 */
  __pyx_v_copied = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1758
 *         return err
 *     cdef size_t copied = 0
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)             # <<<<<<<<<<<<<<
 * 
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):
 */
  __pyx_v_cp = __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy3DInit(CU_MEMORYTYPE_ARRAY, CU_MEMORYTYPE_HOST);

  /* "cuda/_lib/ccudart/utils.pyx":1760
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)
 * 
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  __pyx_t_3 = (__pyx_v_wOffset > 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_count >= (__pyx_v_arrayState.widthInBytes - __pyx_v_wOffset));
  __pyx_t_2 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1761
 * 
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):
 *         cp.dstArray      = arrayState.array             # <<<<<<<<<<<<<<
 *         cp.dstXInBytes   = wOffset
 *         cp.dstY          = hOffset
 */
    __pyx_t_4 = __pyx_v_arrayState.array;
    __pyx_v_cp.dstArray = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1762
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.dstY          = hOffset
 * 
 */
    __pyx_v_cp.dstXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1763
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 *         cp.dstY          = hOffset             # <<<<<<<<<<<<<<
 * 
 *         cp.srcHost       = src
 */
    __pyx_v_cp.dstY = __pyx_v_hOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1765
 *         cp.dstY          = hOffset
 * 
 *         cp.srcHost       = src             # <<<<<<<<<<<<<<
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = 0
 */
    __pyx_v_cp.srcHost = __pyx_v_src;

    /* "cuda/_lib/ccudart/utils.pyx":1766
 * 
 *         cp.srcHost       = src
 *         cp.srcPitch      = arrayState.widthInBytes             # <<<<<<<<<<<<<<
 *         cp.srcXInBytes   = 0
 *         cp.srcY          = 0
 */
    __pyx_t_5 = __pyx_v_arrayState.widthInBytes;
    __pyx_v_cp.srcPitch = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":1767
 *         cp.srcHost       = src
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = 0             # <<<<<<<<<<<<<<
 *         cp.srcY          = 0
 * 
 */
    __pyx_v_cp.srcXInBytes = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1768
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = 0
 *         cp.srcY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.Height        = 1
 */
    __pyx_v_cp.srcY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1770
 *         cp.srcY          = 0
 * 
 *         cp.Height        = 1             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = arrayState.widthInBytes - wOffset
 * 
 */
    __pyx_v_cp.Height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1771
 * 
 *         cp.Height        = 1
 *         cp.WidthInBytes  = arrayState.widthInBytes - wOffset             # <<<<<<<<<<<<<<
 * 
 *         copied  += cp.Height * cp.WidthInBytes
 */
    __pyx_v_cp.WidthInBytes = (__pyx_v_arrayState.widthInBytes - __pyx_v_wOffset);

    /* "cuda/_lib/ccudart/utils.pyx":1773
 *         cp.WidthInBytes  = arrayState.widthInBytes - wOffset
 * 
 *         copied  += cp.Height * cp.WidthInBytes             # <<<<<<<<<<<<<<
 *         hOffset += cp.Height
 *         wOffset  = 0
 */
    __pyx_v_copied = (__pyx_v_copied + (__pyx_v_cp.Height * __pyx_v_cp.WidthInBytes));

    /* "cuda/_lib/ccudart/utils.pyx":1774
 * 
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height             # <<<<<<<<<<<<<<
 *         wOffset  = 0
 * 
 */
    __pyx_v_hOffset = (__pyx_v_hOffset + __pyx_v_cp.Height);

    /* "cuda/_lib/ccudart/utils.pyx":1775
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height
 *         wOffset  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_wOffset = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1777
 *         wOffset  = 0
 * 
 *         err = driverMemcpy3D(&cp, stream, async)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), __pyx_v_stream, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1777, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1778
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1779
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *     if (count - copied >= arrayState.widthInBytes):
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1778
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1760
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)
 * 
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1781
 *             return err
 * 
 *     if (count - copied >= arrayState.widthInBytes):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  __pyx_t_2 = ((__pyx_v_count - __pyx_v_copied) >= __pyx_v_arrayState.widthInBytes);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1782
 * 
 *     if (count - copied >= arrayState.widthInBytes):
 *         cp.dstArray      = arrayState.array             # <<<<<<<<<<<<<<
 *         cp.dstXInBytes   = wOffset
 *         cp.dstY          = hOffset
 */
    __pyx_t_4 = __pyx_v_arrayState.array;
    __pyx_v_cp.dstArray = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1783
 *     if (count - copied >= arrayState.widthInBytes):
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.dstY          = hOffset
 * 
 */
    __pyx_v_cp.dstXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1784
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 *         cp.dstY          = hOffset             # <<<<<<<<<<<<<<
 * 
 *         cp.srcHost       = src + copied
 */
    __pyx_v_cp.dstY = __pyx_v_hOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1786
 *         cp.dstY          = hOffset
 * 
 *         cp.srcHost       = src + copied             # <<<<<<<<<<<<<<
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = 0
 */
    __pyx_v_cp.srcHost = (__pyx_v_src + __pyx_v_copied);

    /* "cuda/_lib/ccudart/utils.pyx":1787
 * 
 *         cp.srcHost       = src + copied
 *         cp.srcPitch      = arrayState.widthInBytes             # <<<<<<<<<<<<<<
 *         cp.srcXInBytes   = 0
 *         cp.srcY          = 0
 */
    __pyx_t_5 = __pyx_v_arrayState.widthInBytes;
    __pyx_v_cp.srcPitch = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":1788
 *         cp.srcHost       = src + copied
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = 0             # <<<<<<<<<<<<<<
 *         cp.srcY          = 0
 * 
 */
    __pyx_v_cp.srcXInBytes = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1789
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = 0
 *         cp.srcY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.Height        = <size_t>((count - copied) / arrayState.widthInBytes)
 */
    __pyx_v_cp.srcY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1791
 *         cp.srcY          = 0
 * 
 *         cp.Height        = <size_t>((count - copied) / arrayState.widthInBytes)             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = arrayState.widthInBytes
 * 
 */
    __pyx_t_5 = (__pyx_v_count - __pyx_v_copied);
    if (unlikely(__pyx_v_arrayState.widthInBytes == 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, 1791, __pyx_L1_error)
    }
    __pyx_v_cp.Height = ((size_t)(((double)__pyx_t_5) / ((double)__pyx_v_arrayState.widthInBytes)));

    /* "cuda/_lib/ccudart/utils.pyx":1792
 * 
 *         cp.Height        = <size_t>((count - copied) / arrayState.widthInBytes)
 *         cp.WidthInBytes  = arrayState.widthInBytes             # <<<<<<<<<<<<<<
 * 
 *         copied  += cp.Height * cp.WidthInBytes
 */
    __pyx_t_5 = __pyx_v_arrayState.widthInBytes;
    __pyx_v_cp.WidthInBytes = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":1794
 *         cp.WidthInBytes  = arrayState.widthInBytes
 * 
 *         copied  += cp.Height * cp.WidthInBytes             # <<<<<<<<<<<<<<
 *         hOffset += cp.Height
 *         wOffset  = 0
 */
    __pyx_v_copied = (__pyx_v_copied + (__pyx_v_cp.Height * __pyx_v_cp.WidthInBytes));

    /* "cuda/_lib/ccudart/utils.pyx":1795
 * 
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height             # <<<<<<<<<<<<<<
 *         wOffset  = 0
 * 
 */
    __pyx_v_hOffset = (__pyx_v_hOffset + __pyx_v_cp.Height);

    /* "cuda/_lib/ccudart/utils.pyx":1796
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height
 *         wOffset  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_wOffset = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1798
 *         wOffset  = 0
 * 
 *         err = driverMemcpy3D(&cp, stream, async)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), __pyx_v_stream, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1798, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1799
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1800
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *     if (count - copied > 0):
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1799
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1781
 *             return err
 * 
 *     if (count - copied >= arrayState.widthInBytes):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1802
 *             return err
 * 
 *     if (count - copied > 0):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  __pyx_t_2 = ((__pyx_v_count - __pyx_v_copied) > 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1803
 * 
 *     if (count - copied > 0):
 *         cp.dstArray      = arrayState.array             # <<<<<<<<<<<<<<
 *         cp.dstXInBytes   = wOffset
 *         cp.dstY          = hOffset
 */
    __pyx_t_4 = __pyx_v_arrayState.array;
    __pyx_v_cp.dstArray = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1804
 *     if (count - copied > 0):
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.dstY          = hOffset
 * 
 */
    __pyx_v_cp.dstXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1805
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 *         cp.dstY          = hOffset             # <<<<<<<<<<<<<<
 * 
 *         cp.srcHost       = src + copied
 */
    __pyx_v_cp.dstY = __pyx_v_hOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1807
 *         cp.dstY          = hOffset
 * 
 *         cp.srcHost       = src + copied             # <<<<<<<<<<<<<<
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = 0
 */
    __pyx_v_cp.srcHost = (__pyx_v_src + __pyx_v_copied);

    /* "cuda/_lib/ccudart/utils.pyx":1808
 * 
 *         cp.srcHost       = src + copied
 *         cp.srcPitch      = arrayState.widthInBytes             # <<<<<<<<<<<<<<
 *         cp.srcXInBytes   = 0
 *         cp.srcY          = 0
 */
    __pyx_t_5 = __pyx_v_arrayState.widthInBytes;
    __pyx_v_cp.srcPitch = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":1809
 *         cp.srcHost       = src + copied
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = 0             # <<<<<<<<<<<<<<
 *         cp.srcY          = 0
 * 
 */
    __pyx_v_cp.srcXInBytes = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1810
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = 0
 *         cp.srcY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.Height        = 1
 */
    __pyx_v_cp.srcY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1812
 *         cp.srcY          = 0
 * 
 *         cp.Height        = 1             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = count - copied
 * 
 */
    __pyx_v_cp.Height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1813
 * 
 *         cp.Height        = 1
 *         cp.WidthInBytes  = count - copied             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_cp.WidthInBytes = (__pyx_v_count - __pyx_v_copied);

    /* "cuda/_lib/ccudart/utils.pyx":1815
 *         cp.WidthInBytes  = count - copied
 * 
 *         err = driverMemcpy3D(&cp, stream, async)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), __pyx_v_stream, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1815, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1816
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1817
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1816
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1802
 *             return err
 * 
 *     if (count - copied > 0):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1819
 *             return err
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1750
 * 
 * 
 * cdef cudaError_t copyFromHost(cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *src, size_t count, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     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.utils.copyFromHost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":1822
 * 
 * 
 * cdef cudaError_t copyFromDevice(ccuda.CUmemorytype type, cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *src, size_t srcOffset, size_t count, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromDevice(CUmemorytype __pyx_v_type, cudaArray_const_t __pyx_v_thisArray, size_t __pyx_v_hOffset, size_t __pyx_v_wOffset, char const *__pyx_v_src, size_t __pyx_v_srcOffset, size_t __pyx_v_count, CUstream __pyx_v_stream, bool __pyx_v_async) {
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaArrayLocalState __pyx_v_arrayState;
  cudaError_t __pyx_v_err;
  size_t __pyx_v_copied;
  CUDA_MEMCPY3D_v2 __pyx_v_cp;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  CUarray __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("copyFromDevice", __pyx_f[0], 1822, 1, __PYX_ERR(0, 1822, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1824
 * cdef cudaError_t copyFromDevice(ccuda.CUmemorytype type, cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *src, size_t srcOffset, size_t count, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":1825
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))             # <<<<<<<<<<<<<<
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v_arrayState), 0, (sizeof(__pyx_v_arrayState))));

  /* "cuda/_lib/ccudart/utils.pyx":1826
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getLocalState((&__pyx_v_arrayState), __pyx_v_thisArray); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1826, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1827
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t copied = 0
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1828
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef size_t copied = 0
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, type)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1827
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t copied = 0
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1829
 *     if err != cudaSuccess:
 *         return err
 *     cdef size_t copied = 0             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, type)
 * 
 */
  __pyx_v_copied = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1830
 *         return err
 *     cdef size_t copied = 0
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, type)             # <<<<<<<<<<<<<<
 * 
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):
 */
  __pyx_v_cp = __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy3DInit(CU_MEMORYTYPE_ARRAY, __pyx_v_type);

  /* "cuda/_lib/ccudart/utils.pyx":1832
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, type)
 * 
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  __pyx_t_3 = (__pyx_v_wOffset > 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_count >= (__pyx_v_arrayState.widthInBytes - __pyx_v_wOffset));
  __pyx_t_2 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1833
 * 
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):
 *         cp.dstArray      = arrayState.array             # <<<<<<<<<<<<<<
 *         cp.dstXInBytes   = wOffset
 *         cp.dstY          = hOffset
 */
    __pyx_t_4 = __pyx_v_arrayState.array;
    __pyx_v_cp.dstArray = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1834
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.dstY          = hOffset
 * 
 */
    __pyx_v_cp.dstXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1835
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 *         cp.dstY          = hOffset             # <<<<<<<<<<<<<<
 * 
 *         cp.srcDevice     = <ccuda.CUdeviceptr_v2>src
 */
    __pyx_v_cp.dstY = __pyx_v_hOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1837
 *         cp.dstY          = hOffset
 * 
 *         cp.srcDevice     = <ccuda.CUdeviceptr_v2>src             # <<<<<<<<<<<<<<
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = srcOffset
 */
    __pyx_v_cp.srcDevice = ((CUdeviceptr_v2)__pyx_v_src);

    /* "cuda/_lib/ccudart/utils.pyx":1838
 * 
 *         cp.srcDevice     = <ccuda.CUdeviceptr_v2>src
 *         cp.srcPitch      = arrayState.widthInBytes             # <<<<<<<<<<<<<<
 *         cp.srcXInBytes   = srcOffset
 *         cp.srcY          = 0
 */
    __pyx_t_5 = __pyx_v_arrayState.widthInBytes;
    __pyx_v_cp.srcPitch = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":1839
 *         cp.srcDevice     = <ccuda.CUdeviceptr_v2>src
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = srcOffset             # <<<<<<<<<<<<<<
 *         cp.srcY          = 0
 * 
 */
    __pyx_v_cp.srcXInBytes = __pyx_v_srcOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1840
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = srcOffset
 *         cp.srcY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.Height        = 1
 */
    __pyx_v_cp.srcY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1842
 *         cp.srcY          = 0
 * 
 *         cp.Height        = 1             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = arrayState.widthInBytes - wOffset
 * 
 */
    __pyx_v_cp.Height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1843
 * 
 *         cp.Height        = 1
 *         cp.WidthInBytes  = arrayState.widthInBytes - wOffset             # <<<<<<<<<<<<<<
 * 
 *         copied  += cp.Height * cp.WidthInBytes
 */
    __pyx_v_cp.WidthInBytes = (__pyx_v_arrayState.widthInBytes - __pyx_v_wOffset);

    /* "cuda/_lib/ccudart/utils.pyx":1845
 *         cp.WidthInBytes  = arrayState.widthInBytes - wOffset
 * 
 *         copied  += cp.Height * cp.WidthInBytes             # <<<<<<<<<<<<<<
 *         hOffset += cp.Height
 *         wOffset  = 0
 */
    __pyx_v_copied = (__pyx_v_copied + (__pyx_v_cp.Height * __pyx_v_cp.WidthInBytes));

    /* "cuda/_lib/ccudart/utils.pyx":1846
 * 
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height             # <<<<<<<<<<<<<<
 *         wOffset  = 0
 * 
 */
    __pyx_v_hOffset = (__pyx_v_hOffset + __pyx_v_cp.Height);

    /* "cuda/_lib/ccudart/utils.pyx":1847
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height
 *         wOffset  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_wOffset = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1849
 *         wOffset  = 0
 * 
 *         err = driverMemcpy3D(&cp, stream, async)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), __pyx_v_stream, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1849, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1850
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1851
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *     if (count - copied >= arrayState.widthInBytes):
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1850
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1832
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, type)
 * 
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1853
 *             return err
 * 
 *     if (count - copied >= arrayState.widthInBytes):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  __pyx_t_2 = ((__pyx_v_count - __pyx_v_copied) >= __pyx_v_arrayState.widthInBytes);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1854
 * 
 *     if (count - copied >= arrayState.widthInBytes):
 *         cp.dstArray      = arrayState.array             # <<<<<<<<<<<<<<
 *         cp.dstXInBytes   = wOffset
 *         cp.dstY          = hOffset
 */
    __pyx_t_4 = __pyx_v_arrayState.array;
    __pyx_v_cp.dstArray = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1855
 *     if (count - copied >= arrayState.widthInBytes):
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.dstY          = hOffset
 * 
 */
    __pyx_v_cp.dstXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1856
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 *         cp.dstY          = hOffset             # <<<<<<<<<<<<<<
 * 
 *         cp.srcDevice     = <ccuda.CUdeviceptr_v2>(src + copied)
 */
    __pyx_v_cp.dstY = __pyx_v_hOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1858
 *         cp.dstY          = hOffset
 * 
 *         cp.srcDevice     = <ccuda.CUdeviceptr_v2>(src + copied)             # <<<<<<<<<<<<<<
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = srcOffset
 */
    __pyx_v_cp.srcDevice = ((CUdeviceptr_v2)(__pyx_v_src + __pyx_v_copied));

    /* "cuda/_lib/ccudart/utils.pyx":1859
 * 
 *         cp.srcDevice     = <ccuda.CUdeviceptr_v2>(src + copied)
 *         cp.srcPitch      = arrayState.widthInBytes             # <<<<<<<<<<<<<<
 *         cp.srcXInBytes   = srcOffset
 *         cp.srcY          = 0
 */
    __pyx_t_5 = __pyx_v_arrayState.widthInBytes;
    __pyx_v_cp.srcPitch = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":1860
 *         cp.srcDevice     = <ccuda.CUdeviceptr_v2>(src + copied)
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = srcOffset             # <<<<<<<<<<<<<<
 *         cp.srcY          = 0
 * 
 */
    __pyx_v_cp.srcXInBytes = __pyx_v_srcOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1861
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = srcOffset
 *         cp.srcY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.Height        = <size_t>((count - copied) / arrayState.widthInBytes)
 */
    __pyx_v_cp.srcY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1863
 *         cp.srcY          = 0
 * 
 *         cp.Height        = <size_t>((count - copied) / arrayState.widthInBytes)             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = arrayState.widthInBytes
 * 
 */
    __pyx_t_5 = (__pyx_v_count - __pyx_v_copied);
    if (unlikely(__pyx_v_arrayState.widthInBytes == 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, 1863, __pyx_L1_error)
    }
    __pyx_v_cp.Height = ((size_t)(((double)__pyx_t_5) / ((double)__pyx_v_arrayState.widthInBytes)));

    /* "cuda/_lib/ccudart/utils.pyx":1864
 * 
 *         cp.Height        = <size_t>((count - copied) / arrayState.widthInBytes)
 *         cp.WidthInBytes  = arrayState.widthInBytes             # <<<<<<<<<<<<<<
 * 
 *         copied  += cp.Height * cp.WidthInBytes
 */
    __pyx_t_5 = __pyx_v_arrayState.widthInBytes;
    __pyx_v_cp.WidthInBytes = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":1866
 *         cp.WidthInBytes  = arrayState.widthInBytes
 * 
 *         copied  += cp.Height * cp.WidthInBytes             # <<<<<<<<<<<<<<
 *         hOffset += cp.Height
 *         wOffset  = 0
 */
    __pyx_v_copied = (__pyx_v_copied + (__pyx_v_cp.Height * __pyx_v_cp.WidthInBytes));

    /* "cuda/_lib/ccudart/utils.pyx":1867
 * 
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height             # <<<<<<<<<<<<<<
 *         wOffset  = 0
 * 
 */
    __pyx_v_hOffset = (__pyx_v_hOffset + __pyx_v_cp.Height);

    /* "cuda/_lib/ccudart/utils.pyx":1868
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height
 *         wOffset  = 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_wOffset = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1871
 * 
 * 
 *         err = driverMemcpy3D(&cp, stream, async)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), __pyx_v_stream, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1871, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1872
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1873
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *     if (count - copied > 0):
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1872
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1853
 *             return err
 * 
 *     if (count - copied >= arrayState.widthInBytes):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1875
 *             return err
 * 
 *     if (count - copied > 0):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  __pyx_t_2 = ((__pyx_v_count - __pyx_v_copied) > 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1876
 * 
 *     if (count - copied > 0):
 *         cp.dstArray      = arrayState.array             # <<<<<<<<<<<<<<
 *         cp.dstXInBytes   = wOffset
 *         cp.dstY          = hOffset
 */
    __pyx_t_4 = __pyx_v_arrayState.array;
    __pyx_v_cp.dstArray = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1877
 *     if (count - copied > 0):
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.dstY          = hOffset
 * 
 */
    __pyx_v_cp.dstXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1878
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 *         cp.dstY          = hOffset             # <<<<<<<<<<<<<<
 * 
 *         cp.srcDevice     = <ccuda.CUdeviceptr_v2>(src + copied)
 */
    __pyx_v_cp.dstY = __pyx_v_hOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1880
 *         cp.dstY          = hOffset
 * 
 *         cp.srcDevice     = <ccuda.CUdeviceptr_v2>(src + copied)             # <<<<<<<<<<<<<<
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = srcOffset
 */
    __pyx_v_cp.srcDevice = ((CUdeviceptr_v2)(__pyx_v_src + __pyx_v_copied));

    /* "cuda/_lib/ccudart/utils.pyx":1881
 * 
 *         cp.srcDevice     = <ccuda.CUdeviceptr_v2>(src + copied)
 *         cp.srcPitch      = arrayState.widthInBytes             # <<<<<<<<<<<<<<
 *         cp.srcXInBytes   = srcOffset
 *         cp.srcY          = 0
 */
    __pyx_t_5 = __pyx_v_arrayState.widthInBytes;
    __pyx_v_cp.srcPitch = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":1882
 *         cp.srcDevice     = <ccuda.CUdeviceptr_v2>(src + copied)
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = srcOffset             # <<<<<<<<<<<<<<
 *         cp.srcY          = 0
 * 
 */
    __pyx_v_cp.srcXInBytes = __pyx_v_srcOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1883
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = srcOffset
 *         cp.srcY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.Height        = 1
 */
    __pyx_v_cp.srcY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1885
 *         cp.srcY          = 0
 * 
 *         cp.Height        = 1             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = count - copied
 * 
 */
    __pyx_v_cp.Height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1886
 * 
 *         cp.Height        = 1
 *         cp.WidthInBytes  = count - copied             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_cp.WidthInBytes = (__pyx_v_count - __pyx_v_copied);

    /* "cuda/_lib/ccudart/utils.pyx":1888
 *         cp.WidthInBytes  = count - copied
 * 
 *         err = driverMemcpy3D(&cp, stream, async)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), __pyx_v_stream, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1888, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1889
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1890
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1889
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1875
 *             return err
 * 
 *     if (count - copied > 0):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1892
 *             return err
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1822
 * 
 * 
 * cdef cudaError_t copyFromDevice(ccuda.CUmemorytype type, cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *src, size_t srcOffset, size_t count, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     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.utils.copyFromDevice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":1895
 * 
 * 
 * cdef cudaError_t copyToHost(cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, char *dst, size_t count, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToHost(cudaArray_const_t __pyx_v_thisArray, size_t __pyx_v_hOffset, size_t __pyx_v_wOffset, char *__pyx_v_dst, size_t __pyx_v_count, CUstream __pyx_v_stream, bool __pyx_v_async) {
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaArrayLocalState __pyx_v_arrayState;
  cudaError_t __pyx_v_err;
  size_t __pyx_v_copied;
  CUDA_MEMCPY3D_v2 __pyx_v_cp;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  size_t __pyx_t_4;
  CUarray __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("copyToHost", __pyx_f[0], 1895, 1, __PYX_ERR(0, 1895, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1897
 * cdef cudaError_t copyToHost(cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, char *dst, size_t count, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":1898
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))             # <<<<<<<<<<<<<<
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v_arrayState), 0, (sizeof(__pyx_v_arrayState))));

  /* "cuda/_lib/ccudart/utils.pyx":1899
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getLocalState((&__pyx_v_arrayState), __pyx_v_thisArray); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1899, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1900
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t copied = 0
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1901
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef size_t copied = 0
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1900
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t copied = 0
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1902
 *     if err != cudaSuccess:
 *         return err
 *     cdef size_t copied = 0             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 * 
 */
  __pyx_v_copied = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1903
 *         return err
 *     cdef size_t copied = 0
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)             # <<<<<<<<<<<<<<
 * 
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):
 */
  __pyx_v_cp = __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy3DInit(CU_MEMORYTYPE_HOST, CU_MEMORYTYPE_ARRAY);

  /* "cuda/_lib/ccudart/utils.pyx":1905
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 * 
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):             # <<<<<<<<<<<<<<
 *         cp.dstHost       = dst
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  __pyx_t_3 = (__pyx_v_wOffset > 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_count >= (__pyx_v_arrayState.widthInBytes - __pyx_v_wOffset));
  __pyx_t_2 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1906
 * 
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):
 *         cp.dstHost       = dst             # <<<<<<<<<<<<<<
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = 0
 */
    __pyx_v_cp.dstHost = __pyx_v_dst;

    /* "cuda/_lib/ccudart/utils.pyx":1907
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):
 *         cp.dstHost       = dst
 *         cp.dstPitch      = arrayState.widthInBytes             # <<<<<<<<<<<<<<
 *         cp.dstXInBytes   = 0
 *         cp.dstY          = 0
 */
    __pyx_t_4 = __pyx_v_arrayState.widthInBytes;
    __pyx_v_cp.dstPitch = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1908
 *         cp.dstHost       = dst
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = 0             # <<<<<<<<<<<<<<
 *         cp.dstY          = 0
 * 
 */
    __pyx_v_cp.dstXInBytes = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1909
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = 0
 *         cp.dstY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.srcArray      = arrayState.array
 */
    __pyx_v_cp.dstY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1911
 *         cp.dstY          = 0
 * 
 *         cp.srcArray      = arrayState.array             # <<<<<<<<<<<<<<
 *         cp.srcXInBytes   = wOffset
 *         cp.srcY          = hOffset
 */
    __pyx_t_5 = __pyx_v_arrayState.array;
    __pyx_v_cp.srcArray = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":1912
 * 
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.srcY          = hOffset
 * 
 */
    __pyx_v_cp.srcXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1913
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset
 *         cp.srcY          = hOffset             # <<<<<<<<<<<<<<
 * 
 *         cp.Height        = 1
 */
    __pyx_v_cp.srcY = __pyx_v_hOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1915
 *         cp.srcY          = hOffset
 * 
 *         cp.Height        = 1             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = arrayState.widthInBytes - wOffset
 * 
 */
    __pyx_v_cp.Height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1916
 * 
 *         cp.Height        = 1
 *         cp.WidthInBytes  = arrayState.widthInBytes - wOffset             # <<<<<<<<<<<<<<
 * 
 *         copied  += cp.Height * cp.WidthInBytes
 */
    __pyx_v_cp.WidthInBytes = (__pyx_v_arrayState.widthInBytes - __pyx_v_wOffset);

    /* "cuda/_lib/ccudart/utils.pyx":1918
 *         cp.WidthInBytes  = arrayState.widthInBytes - wOffset
 * 
 *         copied  += cp.Height * cp.WidthInBytes             # <<<<<<<<<<<<<<
 *         hOffset += cp.Height
 *         wOffset  = 0
 */
    __pyx_v_copied = (__pyx_v_copied + (__pyx_v_cp.Height * __pyx_v_cp.WidthInBytes));

    /* "cuda/_lib/ccudart/utils.pyx":1919
 * 
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height             # <<<<<<<<<<<<<<
 *         wOffset  = 0
 * 
 */
    __pyx_v_hOffset = (__pyx_v_hOffset + __pyx_v_cp.Height);

    /* "cuda/_lib/ccudart/utils.pyx":1920
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height
 *         wOffset  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_wOffset = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1922
 *         wOffset  = 0
 * 
 *         err = driverMemcpy3D(&cp, stream, async)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), __pyx_v_stream, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1922, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1923
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1924
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *     if (count - copied >= arrayState.widthInBytes):
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1923
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1905
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 * 
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):             # <<<<<<<<<<<<<<
 *         cp.dstHost       = dst
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1926
 *             return err
 * 
 *     if (count - copied >= arrayState.widthInBytes):             # <<<<<<<<<<<<<<
 *         cp.dstHost       = dst + copied
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  __pyx_t_2 = ((__pyx_v_count - __pyx_v_copied) >= __pyx_v_arrayState.widthInBytes);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1927
 * 
 *     if (count - copied >= arrayState.widthInBytes):
 *         cp.dstHost       = dst + copied             # <<<<<<<<<<<<<<
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = 0
 */
    __pyx_v_cp.dstHost = (__pyx_v_dst + __pyx_v_copied);

    /* "cuda/_lib/ccudart/utils.pyx":1928
 *     if (count - copied >= arrayState.widthInBytes):
 *         cp.dstHost       = dst + copied
 *         cp.dstPitch      = arrayState.widthInBytes             # <<<<<<<<<<<<<<
 *         cp.dstXInBytes   = 0
 *         cp.dstY          = 0
 */
    __pyx_t_4 = __pyx_v_arrayState.widthInBytes;
    __pyx_v_cp.dstPitch = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1929
 *         cp.dstHost       = dst + copied
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = 0             # <<<<<<<<<<<<<<
 *         cp.dstY          = 0
 * 
 */
    __pyx_v_cp.dstXInBytes = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1930
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = 0
 *         cp.dstY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.srcArray      = arrayState.array
 */
    __pyx_v_cp.dstY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1932
 *         cp.dstY          = 0
 * 
 *         cp.srcArray      = arrayState.array             # <<<<<<<<<<<<<<
 *         cp.srcXInBytes   = wOffset
 *         cp.srcY          = hOffset
 */
    __pyx_t_5 = __pyx_v_arrayState.array;
    __pyx_v_cp.srcArray = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":1933
 * 
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.srcY          = hOffset
 * 
 */
    __pyx_v_cp.srcXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1934
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset
 *         cp.srcY          = hOffset             # <<<<<<<<<<<<<<
 * 
 *         cp.Height        = <size_t>((count - copied) / arrayState.widthInBytes)
 */
    __pyx_v_cp.srcY = __pyx_v_hOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1936
 *         cp.srcY          = hOffset
 * 
 *         cp.Height        = <size_t>((count - copied) / arrayState.widthInBytes)             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = arrayState.widthInBytes
 * 
 */
    __pyx_t_4 = (__pyx_v_count - __pyx_v_copied);
    if (unlikely(__pyx_v_arrayState.widthInBytes == 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, 1936, __pyx_L1_error)
    }
    __pyx_v_cp.Height = ((size_t)(((double)__pyx_t_4) / ((double)__pyx_v_arrayState.widthInBytes)));

    /* "cuda/_lib/ccudart/utils.pyx":1937
 * 
 *         cp.Height        = <size_t>((count - copied) / arrayState.widthInBytes)
 *         cp.WidthInBytes  = arrayState.widthInBytes             # <<<<<<<<<<<<<<
 * 
 *         copied  += cp.Height * cp.WidthInBytes
 */
    __pyx_t_4 = __pyx_v_arrayState.widthInBytes;
    __pyx_v_cp.WidthInBytes = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1939
 *         cp.WidthInBytes  = arrayState.widthInBytes
 * 
 *         copied  += cp.Height * cp.WidthInBytes             # <<<<<<<<<<<<<<
 *         hOffset += cp.Height
 *         wOffset  = 0
 */
    __pyx_v_copied = (__pyx_v_copied + (__pyx_v_cp.Height * __pyx_v_cp.WidthInBytes));

    /* "cuda/_lib/ccudart/utils.pyx":1940
 * 
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height             # <<<<<<<<<<<<<<
 *         wOffset  = 0
 * 
 */
    __pyx_v_hOffset = (__pyx_v_hOffset + __pyx_v_cp.Height);

    /* "cuda/_lib/ccudart/utils.pyx":1941
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height
 *         wOffset  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_wOffset = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1943
 *         wOffset  = 0
 * 
 *         err = driverMemcpy3D(&cp, stream, async)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), __pyx_v_stream, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1943, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1944
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1945
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *     if (count - copied > 0):
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1944
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1926
 *             return err
 * 
 *     if (count - copied >= arrayState.widthInBytes):             # <<<<<<<<<<<<<<
 *         cp.dstHost       = dst + copied
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1947
 *             return err
 * 
 *     if (count - copied > 0):             # <<<<<<<<<<<<<<
 *         cp.dstHost       = dst + copied
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  __pyx_t_2 = ((__pyx_v_count - __pyx_v_copied) > 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1948
 * 
 *     if (count - copied > 0):
 *         cp.dstHost       = dst + copied             # <<<<<<<<<<<<<<
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = 0
 */
    __pyx_v_cp.dstHost = (__pyx_v_dst + __pyx_v_copied);

    /* "cuda/_lib/ccudart/utils.pyx":1949
 *     if (count - copied > 0):
 *         cp.dstHost       = dst + copied
 *         cp.dstPitch      = arrayState.widthInBytes             # <<<<<<<<<<<<<<
 *         cp.dstXInBytes   = 0
 *         cp.dstY          = 0
 */
    __pyx_t_4 = __pyx_v_arrayState.widthInBytes;
    __pyx_v_cp.dstPitch = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":1950
 *         cp.dstHost       = dst + copied
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = 0             # <<<<<<<<<<<<<<
 *         cp.dstY          = 0
 * 
 */
    __pyx_v_cp.dstXInBytes = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1951
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = 0
 *         cp.dstY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.srcArray      = arrayState.array
 */
    __pyx_v_cp.dstY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1953
 *         cp.dstY          = 0
 * 
 *         cp.srcArray      = arrayState.array             # <<<<<<<<<<<<<<
 *         cp.srcXInBytes   = wOffset
 *         cp.srcY          = hOffset
 */
    __pyx_t_5 = __pyx_v_arrayState.array;
    __pyx_v_cp.srcArray = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":1954
 * 
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.srcY          = hOffset
 * 
 */
    __pyx_v_cp.srcXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1955
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset
 *         cp.srcY          = hOffset             # <<<<<<<<<<<<<<
 * 
 *         cp.Height        = 1
 */
    __pyx_v_cp.srcY = __pyx_v_hOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1957
 *         cp.srcY          = hOffset
 * 
 *         cp.Height        = 1             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = count - copied
 * 
 */
    __pyx_v_cp.Height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1958
 * 
 *         cp.Height        = 1
 *         cp.WidthInBytes  = count - copied             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_cp.WidthInBytes = (__pyx_v_count - __pyx_v_copied);

    /* "cuda/_lib/ccudart/utils.pyx":1960
 *         cp.WidthInBytes  = count - copied
 * 
 *         err = driverMemcpy3D(&cp, stream, async)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), __pyx_v_stream, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1960, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1961
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1962
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1961
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1947
 *             return err
 * 
 *     if (count - copied > 0):             # <<<<<<<<<<<<<<
 *         cp.dstHost       = dst + copied
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1964
 *             return err
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1895
 * 
 * 
 * cdef cudaError_t copyToHost(cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, char *dst, size_t count, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     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.utils.copyToHost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":1967
 * 
 * 
 * cdef cudaError_t driverMemcpy3DPeer(ccuda.CUDA_MEMCPY3D_PEER *cp, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if async:
 *         return <cudaError_t>ccuda._cuMemcpy3DPeerAsync(cp, stream)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3DPeer(CUDA_MEMCPY3D_PEER *__pyx_v_cp, CUstream __pyx_v_stream, bool __pyx_v_async) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  CUresult __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("driverMemcpy3DPeer", __pyx_f[0], 1967, 1, __PYX_ERR(0, 1967, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1968
 * 
 * cdef cudaError_t driverMemcpy3DPeer(ccuda.CUDA_MEMCPY3D_PEER *cp, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if async:             # <<<<<<<<<<<<<<
 *         return <cudaError_t>ccuda._cuMemcpy3DPeerAsync(cp, stream)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_async != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1969
 * cdef cudaError_t driverMemcpy3DPeer(ccuda.CUDA_MEMCPY3D_PEER *cp, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if async:
 *         return <cudaError_t>ccuda._cuMemcpy3DPeerAsync(cp, stream)             # <<<<<<<<<<<<<<
 *     else:
 *         return <cudaError_t>ccuda._cuMemcpy3DPeer(cp)
 */
    __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy3DPeerAsync(__pyx_v_cp, __pyx_v_stream); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1969, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_2);
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1968
 * 
 * cdef cudaError_t driverMemcpy3DPeer(ccuda.CUDA_MEMCPY3D_PEER *cp, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if async:             # <<<<<<<<<<<<<<
 *         return <cudaError_t>ccuda._cuMemcpy3DPeerAsync(cp, stream)
 *     else:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1971
 *         return <cudaError_t>ccuda._cuMemcpy3DPeerAsync(cp, stream)
 *     else:
 *         return <cudaError_t>ccuda._cuMemcpy3DPeer(cp)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy3DPeer(__pyx_v_cp); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1971, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_2);
    goto __pyx_L0;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1967
 * 
 * 
 * cdef cudaError_t driverMemcpy3DPeer(ccuda.CUDA_MEMCPY3D_PEER *cp, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if async:
 *         return <cudaError_t>ccuda._cuMemcpy3DPeerAsync(cp, stream)
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1974
 * 
 * 
 * cdef cudaError_t driverMemcpy3D(ccuda.CUDA_MEMCPY3D_v2 *cp, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if async:
 *         return <cudaError_t>ccuda._cuMemcpy3DAsync_v2(cp, stream)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D(CUDA_MEMCPY3D_v2 *__pyx_v_cp, CUstream __pyx_v_stream, bool __pyx_v_async) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  CUresult __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("driverMemcpy3D", __pyx_f[0], 1974, 1, __PYX_ERR(0, 1974, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1975
 * 
 * cdef cudaError_t driverMemcpy3D(ccuda.CUDA_MEMCPY3D_v2 *cp, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if async:             # <<<<<<<<<<<<<<
 *         return <cudaError_t>ccuda._cuMemcpy3DAsync_v2(cp, stream)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_async != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1976
 * cdef cudaError_t driverMemcpy3D(ccuda.CUDA_MEMCPY3D_v2 *cp, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if async:
 *         return <cudaError_t>ccuda._cuMemcpy3DAsync_v2(cp, stream)             # <<<<<<<<<<<<<<
 *     else:
 *         return <cudaError_t>ccuda._cuMemcpy3D_v2(cp)
 */
    __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy3DAsync_v2(__pyx_v_cp, __pyx_v_stream); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1976, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_2);
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1975
 * 
 * cdef cudaError_t driverMemcpy3D(ccuda.CUDA_MEMCPY3D_v2 *cp, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if async:             # <<<<<<<<<<<<<<
 *         return <cudaError_t>ccuda._cuMemcpy3DAsync_v2(cp, stream)
 *     else:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1978
 *         return <cudaError_t>ccuda._cuMemcpy3DAsync_v2(cp, stream)
 *     else:
 *         return <cudaError_t>ccuda._cuMemcpy3D_v2(cp)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy3D_v2(__pyx_v_cp); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1978, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_2);
    goto __pyx_L0;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1974
 * 
 * 
 * cdef cudaError_t driverMemcpy3D(ccuda.CUDA_MEMCPY3D_v2 *cp, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if async:
 *         return <cudaError_t>ccuda._cuMemcpy3DAsync_v2(cp, stream)
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1981
 * 
 * 
 * cdef cudaError_t memcpy3D(const cudaMemcpy3DParms *p, bool peer, int srcDevice, int dstDevice, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cd
 *     cdef ccuda.CUDA_MEMCPY3D_PEER cdPeer
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy3D(struct cudaMemcpy3DParms const *__pyx_v_p, bool __pyx_v_peer, int __pyx_v_srcDevice, int __pyx_v_dstDevice, cudaStream_t __pyx_v_sid, bool __pyx_v_async) {
  CUDA_MEMCPY3D_v2 __pyx_v_cd;
  CUDA_MEMCPY3D_PEER __pyx_v_cdPeer;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_srcDev;
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *__pyx_v_dstDev;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  size_t __pyx_t_4;
  CUmemorytype __pyx_t_5;
  void const *__pyx_t_6;
  CUdeviceptr __pyx_t_7;
  CUarray __pyx_t_8;
  CUcontext __pyx_t_9;
  void *__pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_TraceCall("memcpy3D", __pyx_f[0], 1981, 1, __PYX_ERR(0, 1981, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1987
 *     cdef cudaPythonDevice *dstDev
 * 
 *     memset(&cdPeer, 0, sizeof(cdPeer))             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err = toDriverMemCopy3DParams(p, &cd)
 */
  (void)(memset((&__pyx_v_cdPeer), 0, (sizeof(__pyx_v_cdPeer))));

  /* "cuda/_lib/ccudart/utils.pyx":1989
 *     memset(&cdPeer, 0, sizeof(cdPeer))
 * 
 *     cdef cudaError_t err = toDriverMemCopy3DParams(p, &cd)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams(__pyx_v_p, (&__pyx_v_cd)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1989, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1990
 * 
 *     cdef cudaError_t err = toDriverMemCopy3DParams(p, &cd)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1991
 *     cdef cudaError_t err = toDriverMemCopy3DParams(p, &cd)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     # Execute the copy
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1990
 * 
 *     cdef cudaError_t err = toDriverMemCopy3DParams(p, &cd)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1994
 * 
 *     # Execute the copy
 *     if peer:             # <<<<<<<<<<<<<<
 *         srcDev = m_global.getDevice(srcDevice)
 *         dstDev = m_global.getDevice(dstDevice)
 */
  __pyx_t_2 = (__pyx_v_peer != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1995
 *     # Execute the copy
 *     if peer:
 *         srcDev = m_global.getDevice(srcDevice)             # <<<<<<<<<<<<<<
 *         dstDev = m_global.getDevice(dstDevice)
 *         if srcDev == NULL or dstDev == NULL:
 */
    __pyx_v_srcDev = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_5utils_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_5utils_m_global, __pyx_v_srcDevice);

    /* "cuda/_lib/ccudart/utils.pyx":1996
 *     if peer:
 *         srcDev = m_global.getDevice(srcDevice)
 *         dstDev = m_global.getDevice(dstDevice)             # <<<<<<<<<<<<<<
 *         if srcDev == NULL or dstDev == NULL:
 *             return cudaErrorInvalidDevice
 */
    __pyx_v_dstDev = ((struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)__pyx_v_4cuda_4_lib_7ccudart_5utils_m_global->__pyx_vtab)->getDevice(__pyx_v_4cuda_4_lib_7ccudart_5utils_m_global, __pyx_v_dstDevice);

    /* "cuda/_lib/ccudart/utils.pyx":1997
 *         srcDev = m_global.getDevice(srcDevice)
 *         dstDev = m_global.getDevice(dstDevice)
 *         if srcDev == NULL or dstDev == NULL:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidDevice
 *         cdPeer.srcXInBytes = cd.srcXInBytes
 */
    __pyx_t_3 = (__pyx_v_srcDev == NULL);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_dstDev == NULL);
    __pyx_t_2 = __pyx_t_3;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1998
 *         dstDev = m_global.getDevice(dstDevice)
 *         if srcDev == NULL or dstDev == NULL:
 *             return cudaErrorInvalidDevice             # <<<<<<<<<<<<<<
 *         cdPeer.srcXInBytes = cd.srcXInBytes
 *         cdPeer.srcY = cd.srcY
 */
      __pyx_r = cudaErrorInvalidDevice;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":1997
 *         srcDev = m_global.getDevice(srcDevice)
 *         dstDev = m_global.getDevice(dstDevice)
 *         if srcDev == NULL or dstDev == NULL:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidDevice
 *         cdPeer.srcXInBytes = cd.srcXInBytes
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1999
 *         if srcDev == NULL or dstDev == NULL:
 *             return cudaErrorInvalidDevice
 *         cdPeer.srcXInBytes = cd.srcXInBytes             # <<<<<<<<<<<<<<
 *         cdPeer.srcY = cd.srcY
 *         cdPeer.srcZ = cd.srcZ
 */
    __pyx_t_4 = __pyx_v_cd.srcXInBytes;
    __pyx_v_cdPeer.srcXInBytes = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2000
 *             return cudaErrorInvalidDevice
 *         cdPeer.srcXInBytes = cd.srcXInBytes
 *         cdPeer.srcY = cd.srcY             # <<<<<<<<<<<<<<
 *         cdPeer.srcZ = cd.srcZ
 *         cdPeer.srcLOD = cd.srcLOD
 */
    __pyx_t_4 = __pyx_v_cd.srcY;
    __pyx_v_cdPeer.srcY = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2001
 *         cdPeer.srcXInBytes = cd.srcXInBytes
 *         cdPeer.srcY = cd.srcY
 *         cdPeer.srcZ = cd.srcZ             # <<<<<<<<<<<<<<
 *         cdPeer.srcLOD = cd.srcLOD
 *         cdPeer.srcMemoryType = cd.srcMemoryType
 */
    __pyx_t_4 = __pyx_v_cd.srcZ;
    __pyx_v_cdPeer.srcZ = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2002
 *         cdPeer.srcY = cd.srcY
 *         cdPeer.srcZ = cd.srcZ
 *         cdPeer.srcLOD = cd.srcLOD             # <<<<<<<<<<<<<<
 *         cdPeer.srcMemoryType = cd.srcMemoryType
 *         cdPeer.srcHost = cd.srcHost
 */
    __pyx_t_4 = __pyx_v_cd.srcLOD;
    __pyx_v_cdPeer.srcLOD = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2003
 *         cdPeer.srcZ = cd.srcZ
 *         cdPeer.srcLOD = cd.srcLOD
 *         cdPeer.srcMemoryType = cd.srcMemoryType             # <<<<<<<<<<<<<<
 *         cdPeer.srcHost = cd.srcHost
 *         cdPeer.srcDevice = cd.srcDevice
 */
    __pyx_t_5 = __pyx_v_cd.srcMemoryType;
    __pyx_v_cdPeer.srcMemoryType = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":2004
 *         cdPeer.srcLOD = cd.srcLOD
 *         cdPeer.srcMemoryType = cd.srcMemoryType
 *         cdPeer.srcHost = cd.srcHost             # <<<<<<<<<<<<<<
 *         cdPeer.srcDevice = cd.srcDevice
 *         cdPeer.srcArray = cd.srcArray
 */
    __pyx_t_6 = __pyx_v_cd.srcHost;
    __pyx_v_cdPeer.srcHost = __pyx_t_6;

    /* "cuda/_lib/ccudart/utils.pyx":2005
 *         cdPeer.srcMemoryType = cd.srcMemoryType
 *         cdPeer.srcHost = cd.srcHost
 *         cdPeer.srcDevice = cd.srcDevice             # <<<<<<<<<<<<<<
 *         cdPeer.srcArray = cd.srcArray
 *         cdPeer.srcContext = srcDev.primaryContext
 */
    __pyx_t_7 = __pyx_v_cd.srcDevice;
    __pyx_v_cdPeer.srcDevice = __pyx_t_7;

    /* "cuda/_lib/ccudart/utils.pyx":2006
 *         cdPeer.srcHost = cd.srcHost
 *         cdPeer.srcDevice = cd.srcDevice
 *         cdPeer.srcArray = cd.srcArray             # <<<<<<<<<<<<<<
 *         cdPeer.srcContext = srcDev.primaryContext
 *         cdPeer.srcPitch = cd.srcPitch
 */
    __pyx_t_8 = __pyx_v_cd.srcArray;
    __pyx_v_cdPeer.srcArray = __pyx_t_8;

    /* "cuda/_lib/ccudart/utils.pyx":2007
 *         cdPeer.srcDevice = cd.srcDevice
 *         cdPeer.srcArray = cd.srcArray
 *         cdPeer.srcContext = srcDev.primaryContext             # <<<<<<<<<<<<<<
 *         cdPeer.srcPitch = cd.srcPitch
 *         cdPeer.srcHeight = cd.srcHeight
 */
    __pyx_t_9 = __pyx_v_srcDev->primaryContext;
    __pyx_v_cdPeer.srcContext = __pyx_t_9;

    /* "cuda/_lib/ccudart/utils.pyx":2008
 *         cdPeer.srcArray = cd.srcArray
 *         cdPeer.srcContext = srcDev.primaryContext
 *         cdPeer.srcPitch = cd.srcPitch             # <<<<<<<<<<<<<<
 *         cdPeer.srcHeight = cd.srcHeight
 *         cdPeer.dstXInBytes = cd.dstXInBytes
 */
    __pyx_t_4 = __pyx_v_cd.srcPitch;
    __pyx_v_cdPeer.srcPitch = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2009
 *         cdPeer.srcContext = srcDev.primaryContext
 *         cdPeer.srcPitch = cd.srcPitch
 *         cdPeer.srcHeight = cd.srcHeight             # <<<<<<<<<<<<<<
 *         cdPeer.dstXInBytes = cd.dstXInBytes
 *         cdPeer.dstY = cd.dstY
 */
    __pyx_t_4 = __pyx_v_cd.srcHeight;
    __pyx_v_cdPeer.srcHeight = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2010
 *         cdPeer.srcPitch = cd.srcPitch
 *         cdPeer.srcHeight = cd.srcHeight
 *         cdPeer.dstXInBytes = cd.dstXInBytes             # <<<<<<<<<<<<<<
 *         cdPeer.dstY = cd.dstY
 *         cdPeer.dstZ = cd.dstZ
 */
    __pyx_t_4 = __pyx_v_cd.dstXInBytes;
    __pyx_v_cdPeer.dstXInBytes = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2011
 *         cdPeer.srcHeight = cd.srcHeight
 *         cdPeer.dstXInBytes = cd.dstXInBytes
 *         cdPeer.dstY = cd.dstY             # <<<<<<<<<<<<<<
 *         cdPeer.dstZ = cd.dstZ
 *         cdPeer.dstLOD = cd.dstLOD
 */
    __pyx_t_4 = __pyx_v_cd.dstY;
    __pyx_v_cdPeer.dstY = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2012
 *         cdPeer.dstXInBytes = cd.dstXInBytes
 *         cdPeer.dstY = cd.dstY
 *         cdPeer.dstZ = cd.dstZ             # <<<<<<<<<<<<<<
 *         cdPeer.dstLOD = cd.dstLOD
 *         cdPeer.dstMemoryType = cd.dstMemoryType
 */
    __pyx_t_4 = __pyx_v_cd.dstZ;
    __pyx_v_cdPeer.dstZ = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2013
 *         cdPeer.dstY = cd.dstY
 *         cdPeer.dstZ = cd.dstZ
 *         cdPeer.dstLOD = cd.dstLOD             # <<<<<<<<<<<<<<
 *         cdPeer.dstMemoryType = cd.dstMemoryType
 *         cdPeer.dstHost = cd.dstHost
 */
    __pyx_t_4 = __pyx_v_cd.dstLOD;
    __pyx_v_cdPeer.dstLOD = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2014
 *         cdPeer.dstZ = cd.dstZ
 *         cdPeer.dstLOD = cd.dstLOD
 *         cdPeer.dstMemoryType = cd.dstMemoryType             # <<<<<<<<<<<<<<
 *         cdPeer.dstHost = cd.dstHost
 *         cdPeer.dstDevice = cd.dstDevice
 */
    __pyx_t_5 = __pyx_v_cd.dstMemoryType;
    __pyx_v_cdPeer.dstMemoryType = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":2015
 *         cdPeer.dstLOD = cd.dstLOD
 *         cdPeer.dstMemoryType = cd.dstMemoryType
 *         cdPeer.dstHost = cd.dstHost             # <<<<<<<<<<<<<<
 *         cdPeer.dstDevice = cd.dstDevice
 *         cdPeer.dstArray = cd.dstArray
 */
    __pyx_t_10 = __pyx_v_cd.dstHost;
    __pyx_v_cdPeer.dstHost = __pyx_t_10;

    /* "cuda/_lib/ccudart/utils.pyx":2016
 *         cdPeer.dstMemoryType = cd.dstMemoryType
 *         cdPeer.dstHost = cd.dstHost
 *         cdPeer.dstDevice = cd.dstDevice             # <<<<<<<<<<<<<<
 *         cdPeer.dstArray = cd.dstArray
 *         cdPeer.dstContext = dstDev.primaryContext
 */
    __pyx_t_7 = __pyx_v_cd.dstDevice;
    __pyx_v_cdPeer.dstDevice = __pyx_t_7;

    /* "cuda/_lib/ccudart/utils.pyx":2017
 *         cdPeer.dstHost = cd.dstHost
 *         cdPeer.dstDevice = cd.dstDevice
 *         cdPeer.dstArray = cd.dstArray             # <<<<<<<<<<<<<<
 *         cdPeer.dstContext = dstDev.primaryContext
 *         cdPeer.dstPitch = cd.dstPitch
 */
    __pyx_t_8 = __pyx_v_cd.dstArray;
    __pyx_v_cdPeer.dstArray = __pyx_t_8;

    /* "cuda/_lib/ccudart/utils.pyx":2018
 *         cdPeer.dstDevice = cd.dstDevice
 *         cdPeer.dstArray = cd.dstArray
 *         cdPeer.dstContext = dstDev.primaryContext             # <<<<<<<<<<<<<<
 *         cdPeer.dstPitch = cd.dstPitch
 *         cdPeer.dstHeight = cd.dstHeight
 */
    __pyx_t_9 = __pyx_v_dstDev->primaryContext;
    __pyx_v_cdPeer.dstContext = __pyx_t_9;

    /* "cuda/_lib/ccudart/utils.pyx":2019
 *         cdPeer.dstArray = cd.dstArray
 *         cdPeer.dstContext = dstDev.primaryContext
 *         cdPeer.dstPitch = cd.dstPitch             # <<<<<<<<<<<<<<
 *         cdPeer.dstHeight = cd.dstHeight
 *         cdPeer.WidthInBytes = cd.WidthInBytes
 */
    __pyx_t_4 = __pyx_v_cd.dstPitch;
    __pyx_v_cdPeer.dstPitch = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2020
 *         cdPeer.dstContext = dstDev.primaryContext
 *         cdPeer.dstPitch = cd.dstPitch
 *         cdPeer.dstHeight = cd.dstHeight             # <<<<<<<<<<<<<<
 *         cdPeer.WidthInBytes = cd.WidthInBytes
 *         cdPeer.Height = cd.Height
 */
    __pyx_t_4 = __pyx_v_cd.dstHeight;
    __pyx_v_cdPeer.dstHeight = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2021
 *         cdPeer.dstPitch = cd.dstPitch
 *         cdPeer.dstHeight = cd.dstHeight
 *         cdPeer.WidthInBytes = cd.WidthInBytes             # <<<<<<<<<<<<<<
 *         cdPeer.Height = cd.Height
 *         cdPeer.Depth = cd.Depth
 */
    __pyx_t_4 = __pyx_v_cd.WidthInBytes;
    __pyx_v_cdPeer.WidthInBytes = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2022
 *         cdPeer.dstHeight = cd.dstHeight
 *         cdPeer.WidthInBytes = cd.WidthInBytes
 *         cdPeer.Height = cd.Height             # <<<<<<<<<<<<<<
 *         cdPeer.Depth = cd.Depth
 *         err = driverMemcpy3DPeer(&cdPeer, sid, async)
 */
    __pyx_t_4 = __pyx_v_cd.Height;
    __pyx_v_cdPeer.Height = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2023
 *         cdPeer.WidthInBytes = cd.WidthInBytes
 *         cdPeer.Height = cd.Height
 *         cdPeer.Depth = cd.Depth             # <<<<<<<<<<<<<<
 *         err = driverMemcpy3DPeer(&cdPeer, sid, async)
 *     else:
 */
    __pyx_t_4 = __pyx_v_cd.Depth;
    __pyx_v_cdPeer.Depth = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2024
 *         cdPeer.Height = cd.Height
 *         cdPeer.Depth = cd.Depth
 *         err = driverMemcpy3DPeer(&cdPeer, sid, async)             # <<<<<<<<<<<<<<
 *     else:
 *         err = driverMemcpy3D(&cd, sid, async)
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3DPeer((&__pyx_v_cdPeer), __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2024, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1994
 * 
 *     # Execute the copy
 *     if peer:             # <<<<<<<<<<<<<<
 *         srcDev = m_global.getDevice(srcDevice)
 *         dstDev = m_global.getDevice(dstDevice)
 */
    goto __pyx_L4;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2026
 *         err = driverMemcpy3DPeer(&cdPeer, sid, async)
 *     else:
 *         err = driverMemcpy3D(&cd, sid, async)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
  /*else*/ {
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cd), __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2026, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;
  }
  __pyx_L4:;

  /* "cuda/_lib/ccudart/utils.pyx":2027
 *     else:
 *         err = driverMemcpy3D(&cd, sid, async)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1981
 * 
 * 
 * cdef cudaError_t memcpy3D(const cudaMemcpy3DParms *p, bool peer, int srcDevice, int dstDevice, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cd
 *     cdef ccuda.CUDA_MEMCPY3D_PEER cdPeer
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2030
 * 
 * 
 * cdef cudaError_t copyToDevice(ccuda.CUmemorytype type, cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *dst, size_t dstOffset, size_t count, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToDevice(CUmemorytype __pyx_v_type, cudaArray_const_t __pyx_v_thisArray, size_t __pyx_v_hOffset, size_t __pyx_v_wOffset, char const *__pyx_v_dst, size_t __pyx_v_dstOffset, size_t __pyx_v_count, CUstream __pyx_v_stream, bool __pyx_v_async) {
  struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaArrayLocalState __pyx_v_arrayState;
  cudaError_t __pyx_v_err;
  size_t __pyx_v_copied;
  CUDA_MEMCPY3D_v2 __pyx_v_cp;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  size_t __pyx_t_4;
  CUarray __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("copyToDevice", __pyx_f[0], 2030, 1, __PYX_ERR(0, 2030, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2032
 * cdef cudaError_t copyToDevice(ccuda.CUmemorytype type, cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *dst, size_t dstOffset, size_t count, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":2033
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))             # <<<<<<<<<<<<<<
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 */
  (void)(memset((&__pyx_v_arrayState), 0, (sizeof(__pyx_v_arrayState))));

  /* "cuda/_lib/ccudart/utils.pyx":2034
 *     cdef cudaError_t err = cudaSuccess
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getLocalState((&__pyx_v_arrayState), __pyx_v_thisArray); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2034, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":2035
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t copied = 0
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":2036
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     cdef size_t copied = 0
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(type, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2035
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t copied = 0
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2037
 *     if err != cudaSuccess:
 *         return err
 *     cdef size_t copied = 0             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(type, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 * 
 */
  __pyx_v_copied = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2038
 *         return err
 *     cdef size_t copied = 0
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(type, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)             # <<<<<<<<<<<<<<
 * 
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):
 */
  __pyx_v_cp = __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy3DInit(__pyx_v_type, CU_MEMORYTYPE_ARRAY);

  /* "cuda/_lib/ccudart/utils.pyx":2040
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(type, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 * 
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):             # <<<<<<<<<<<<<<
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>dst
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  __pyx_t_3 = (__pyx_v_wOffset > 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_count >= (__pyx_v_arrayState.widthInBytes - __pyx_v_wOffset));
  __pyx_t_2 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":2041
 * 
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>dst             # <<<<<<<<<<<<<<
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = dstOffset
 */
    __pyx_v_cp.dstDevice = ((CUdeviceptr_v2)__pyx_v_dst);

    /* "cuda/_lib/ccudart/utils.pyx":2042
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>dst
 *         cp.dstPitch      = arrayState.widthInBytes             # <<<<<<<<<<<<<<
 *         cp.dstXInBytes   = dstOffset
 *         cp.dstY          = 0
 */
    __pyx_t_4 = __pyx_v_arrayState.widthInBytes;
    __pyx_v_cp.dstPitch = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2043
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>dst
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = dstOffset             # <<<<<<<<<<<<<<
 *         cp.dstY          = 0
 * 
 */
    __pyx_v_cp.dstXInBytes = __pyx_v_dstOffset;

    /* "cuda/_lib/ccudart/utils.pyx":2044
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = dstOffset
 *         cp.dstY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.srcArray      = arrayState.array
 */
    __pyx_v_cp.dstY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":2046
 *         cp.dstY          = 0
 * 
 *         cp.srcArray      = arrayState.array             # <<<<<<<<<<<<<<
 *         cp.srcXInBytes   = wOffset
 *         cp.srcY          = hOffset
 */
    __pyx_t_5 = __pyx_v_arrayState.array;
    __pyx_v_cp.srcArray = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":2047
 * 
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.srcY          = hOffset
 * 
 */
    __pyx_v_cp.srcXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":2048
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset
 *         cp.srcY          = hOffset             # <<<<<<<<<<<<<<
 * 
 *         cp.Height        = 1
 */
    __pyx_v_cp.srcY = __pyx_v_hOffset;

    /* "cuda/_lib/ccudart/utils.pyx":2050
 *         cp.srcY          = hOffset
 * 
 *         cp.Height        = 1             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = arrayState.widthInBytes - wOffset
 * 
 */
    __pyx_v_cp.Height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":2051
 * 
 *         cp.Height        = 1
 *         cp.WidthInBytes  = arrayState.widthInBytes - wOffset             # <<<<<<<<<<<<<<
 * 
 *         copied  += cp.Height * cp.WidthInBytes
 */
    __pyx_v_cp.WidthInBytes = (__pyx_v_arrayState.widthInBytes - __pyx_v_wOffset);

    /* "cuda/_lib/ccudart/utils.pyx":2053
 *         cp.WidthInBytes  = arrayState.widthInBytes - wOffset
 * 
 *         copied  += cp.Height * cp.WidthInBytes             # <<<<<<<<<<<<<<
 *         hOffset += cp.Height
 *         wOffset  = 0
 */
    __pyx_v_copied = (__pyx_v_copied + (__pyx_v_cp.Height * __pyx_v_cp.WidthInBytes));

    /* "cuda/_lib/ccudart/utils.pyx":2054
 * 
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height             # <<<<<<<<<<<<<<
 *         wOffset  = 0
 * 
 */
    __pyx_v_hOffset = (__pyx_v_hOffset + __pyx_v_cp.Height);

    /* "cuda/_lib/ccudart/utils.pyx":2055
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height
 *         wOffset  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_wOffset = 0;

    /* "cuda/_lib/ccudart/utils.pyx":2057
 *         wOffset  = 0
 * 
 *         err = driverMemcpy3D(&cp, stream, async)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), __pyx_v_stream, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2057, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":2058
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":2059
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *     if (count - copied >= arrayState.widthInBytes):
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2058
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2040
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp = memCopy3DInit(type, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 * 
 *     if (wOffset > 0) and (count >= arrayState.widthInBytes - wOffset):             # <<<<<<<<<<<<<<
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>dst
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2061
 *             return err
 * 
 *     if (count - copied >= arrayState.widthInBytes):             # <<<<<<<<<<<<<<
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>(dst + copied)
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  __pyx_t_2 = ((__pyx_v_count - __pyx_v_copied) >= __pyx_v_arrayState.widthInBytes);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":2062
 * 
 *     if (count - copied >= arrayState.widthInBytes):
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>(dst + copied)             # <<<<<<<<<<<<<<
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = dstOffset
 */
    __pyx_v_cp.dstDevice = ((CUdeviceptr_v2)(__pyx_v_dst + __pyx_v_copied));

    /* "cuda/_lib/ccudart/utils.pyx":2063
 *     if (count - copied >= arrayState.widthInBytes):
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>(dst + copied)
 *         cp.dstPitch      = arrayState.widthInBytes             # <<<<<<<<<<<<<<
 *         cp.dstXInBytes   = dstOffset
 *         cp.dstY          = 0
 */
    __pyx_t_4 = __pyx_v_arrayState.widthInBytes;
    __pyx_v_cp.dstPitch = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2064
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>(dst + copied)
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = dstOffset             # <<<<<<<<<<<<<<
 *         cp.dstY          = 0
 * 
 */
    __pyx_v_cp.dstXInBytes = __pyx_v_dstOffset;

    /* "cuda/_lib/ccudart/utils.pyx":2065
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = dstOffset
 *         cp.dstY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.srcArray      = arrayState.array
 */
    __pyx_v_cp.dstY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":2067
 *         cp.dstY          = 0
 * 
 *         cp.srcArray      = arrayState.array             # <<<<<<<<<<<<<<
 *         cp.srcXInBytes   = wOffset
 *         cp.srcY          = hOffset
 */
    __pyx_t_5 = __pyx_v_arrayState.array;
    __pyx_v_cp.srcArray = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":2068
 * 
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.srcY          = hOffset
 * 
 */
    __pyx_v_cp.srcXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":2069
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset
 *         cp.srcY          = hOffset             # <<<<<<<<<<<<<<
 * 
 *         cp.Height        = <size_t>((count - copied) / arrayState.widthInBytes)
 */
    __pyx_v_cp.srcY = __pyx_v_hOffset;

    /* "cuda/_lib/ccudart/utils.pyx":2071
 *         cp.srcY          = hOffset
 * 
 *         cp.Height        = <size_t>((count - copied) / arrayState.widthInBytes)             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = arrayState.widthInBytes
 * 
 */
    __pyx_t_4 = (__pyx_v_count - __pyx_v_copied);
    if (unlikely(__pyx_v_arrayState.widthInBytes == 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, 2071, __pyx_L1_error)
    }
    __pyx_v_cp.Height = ((size_t)(((double)__pyx_t_4) / ((double)__pyx_v_arrayState.widthInBytes)));

    /* "cuda/_lib/ccudart/utils.pyx":2072
 * 
 *         cp.Height        = <size_t>((count - copied) / arrayState.widthInBytes)
 *         cp.WidthInBytes  = arrayState.widthInBytes             # <<<<<<<<<<<<<<
 * 
 *         copied  += cp.Height * cp.WidthInBytes
 */
    __pyx_t_4 = __pyx_v_arrayState.widthInBytes;
    __pyx_v_cp.WidthInBytes = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2074
 *         cp.WidthInBytes  = arrayState.widthInBytes
 * 
 *         copied  += cp.Height * cp.WidthInBytes             # <<<<<<<<<<<<<<
 *         hOffset += cp.Height
 *         wOffset  = 0
 */
    __pyx_v_copied = (__pyx_v_copied + (__pyx_v_cp.Height * __pyx_v_cp.WidthInBytes));

    /* "cuda/_lib/ccudart/utils.pyx":2075
 * 
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height             # <<<<<<<<<<<<<<
 *         wOffset  = 0
 * 
 */
    __pyx_v_hOffset = (__pyx_v_hOffset + __pyx_v_cp.Height);

    /* "cuda/_lib/ccudart/utils.pyx":2076
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height
 *         wOffset  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_wOffset = 0;

    /* "cuda/_lib/ccudart/utils.pyx":2078
 *         wOffset  = 0
 * 
 *         err = driverMemcpy3D(&cp, stream, async)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), __pyx_v_stream, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2078, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":2079
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":2080
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *     if (count - copied > 0):
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2079
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2061
 *             return err
 * 
 *     if (count - copied >= arrayState.widthInBytes):             # <<<<<<<<<<<<<<
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>(dst + copied)
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2082
 *             return err
 * 
 *     if (count - copied > 0):             # <<<<<<<<<<<<<<
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>(dst + copied)
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  __pyx_t_2 = ((__pyx_v_count - __pyx_v_copied) > 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":2083
 * 
 *     if (count - copied > 0):
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>(dst + copied)             # <<<<<<<<<<<<<<
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = dstOffset
 */
    __pyx_v_cp.dstDevice = ((CUdeviceptr_v2)(__pyx_v_dst + __pyx_v_copied));

    /* "cuda/_lib/ccudart/utils.pyx":2084
 *     if (count - copied > 0):
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>(dst + copied)
 *         cp.dstPitch      = arrayState.widthInBytes             # <<<<<<<<<<<<<<
 *         cp.dstXInBytes   = dstOffset
 *         cp.dstY          = 0
 */
    __pyx_t_4 = __pyx_v_arrayState.widthInBytes;
    __pyx_v_cp.dstPitch = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2085
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>(dst + copied)
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = dstOffset             # <<<<<<<<<<<<<<
 *         cp.dstY          = 0
 * 
 */
    __pyx_v_cp.dstXInBytes = __pyx_v_dstOffset;

    /* "cuda/_lib/ccudart/utils.pyx":2086
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = dstOffset
 *         cp.dstY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.srcArray      = arrayState.array
 */
    __pyx_v_cp.dstY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":2088
 *         cp.dstY          = 0
 * 
 *         cp.srcArray      = arrayState.array             # <<<<<<<<<<<<<<
 *         cp.srcXInBytes   = wOffset
 *         cp.srcY          = hOffset
 */
    __pyx_t_5 = __pyx_v_arrayState.array;
    __pyx_v_cp.srcArray = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":2089
 * 
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.srcY          = hOffset
 * 
 */
    __pyx_v_cp.srcXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":2090
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset
 *         cp.srcY          = hOffset             # <<<<<<<<<<<<<<
 * 
 *         cp.Height        = 1
 */
    __pyx_v_cp.srcY = __pyx_v_hOffset;

    /* "cuda/_lib/ccudart/utils.pyx":2092
 *         cp.srcY          = hOffset
 * 
 *         cp.Height        = 1             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = count - copied
 * 
 */
    __pyx_v_cp.Height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":2093
 * 
 *         cp.Height        = 1
 *         cp.WidthInBytes  = count - copied             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_cp.WidthInBytes = (__pyx_v_count - __pyx_v_copied);

    /* "cuda/_lib/ccudart/utils.pyx":2095
 *         cp.WidthInBytes  = count - copied
 * 
 *         err = driverMemcpy3D(&cp, stream, async)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_driverMemcpy3D((&__pyx_v_cp), __pyx_v_stream, __pyx_v_async); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2095, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":2096
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":2097
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2096
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2082
 *             return err
 * 
 *     if (count - copied > 0):             # <<<<<<<<<<<<<<
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>(dst + copied)
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2099
 *             return err
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2030
 * 
 * 
 * cdef cudaError_t copyToDevice(ccuda.CUmemorytype type, cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, const char *dst, size_t dstOffset, size_t count, ccuda.CUstream stream, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     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.utils.copyToDevice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":2102
 * 
 * 
 * cdef cudaError_t copy1DConvertTo3DParams(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaMemcpy3DParms *p) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     memset(p, 0, sizeof(cudaMemcpy3DParms))
 *     p[0].extent.width = count
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_copy1DConvertTo3DParams(void *__pyx_v_dst, void const *__pyx_v_src, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind, struct cudaMemcpy3DParms *__pyx_v_p) {
  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("copy1DConvertTo3DParams", __pyx_f[0], 2102, 1, __PYX_ERR(0, 2102, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2103
 * 
 * cdef cudaError_t copy1DConvertTo3DParams(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaMemcpy3DParms *p) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     memset(p, 0, sizeof(cudaMemcpy3DParms))             # <<<<<<<<<<<<<<
 *     p[0].extent.width = count
 *     p[0].extent.height = 1
 */
  (void)(memset(__pyx_v_p, 0, (sizeof(struct cudaMemcpy3DParms))));

  /* "cuda/_lib/ccudart/utils.pyx":2104
 * cdef cudaError_t copy1DConvertTo3DParams(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaMemcpy3DParms *p) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     memset(p, 0, sizeof(cudaMemcpy3DParms))
 *     p[0].extent.width = count             # <<<<<<<<<<<<<<
 *     p[0].extent.height = 1
 *     p[0].extent.depth = 1
 */
  (__pyx_v_p[0]).extent.width = __pyx_v_count;

  /* "cuda/_lib/ccudart/utils.pyx":2105
 *     memset(p, 0, sizeof(cudaMemcpy3DParms))
 *     p[0].extent.width = count
 *     p[0].extent.height = 1             # <<<<<<<<<<<<<<
 *     p[0].extent.depth = 1
 *     p[0].dstPtr.ptr = dst
 */
  (__pyx_v_p[0]).extent.height = 1;

  /* "cuda/_lib/ccudart/utils.pyx":2106
 *     p[0].extent.width = count
 *     p[0].extent.height = 1
 *     p[0].extent.depth = 1             # <<<<<<<<<<<<<<
 *     p[0].dstPtr.ptr = dst
 *     p[0].srcPtr.ptr = <void *>src
 */
  (__pyx_v_p[0]).extent.depth = 1;

  /* "cuda/_lib/ccudart/utils.pyx":2107
 *     p[0].extent.height = 1
 *     p[0].extent.depth = 1
 *     p[0].dstPtr.ptr = dst             # <<<<<<<<<<<<<<
 *     p[0].srcPtr.ptr = <void *>src
 *     p[0].kind = kind
 */
  (__pyx_v_p[0]).dstPtr.ptr = __pyx_v_dst;

  /* "cuda/_lib/ccudart/utils.pyx":2108
 *     p[0].extent.depth = 1
 *     p[0].dstPtr.ptr = dst
 *     p[0].srcPtr.ptr = <void *>src             # <<<<<<<<<<<<<<
 *     p[0].kind = kind
 * 
 */
  (__pyx_v_p[0]).srcPtr.ptr = ((void *)__pyx_v_src);

  /* "cuda/_lib/ccudart/utils.pyx":2109
 *     p[0].dstPtr.ptr = dst
 *     p[0].srcPtr.ptr = <void *>src
 *     p[0].kind = kind             # <<<<<<<<<<<<<<
 * 
 * 
 */
  (__pyx_v_p[0]).kind = __pyx_v_kind;

  /* "cuda/_lib/ccudart/utils.pyx":2102
 * 
 * 
 * cdef cudaError_t copy1DConvertTo3DParams(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaMemcpy3DParms *p) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     memset(p, 0, sizeof(cudaMemcpy3DParms))
 *     p[0].extent.width = count
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2112
 * 
 * 
 * cdef void toDriverMemsetNodeParams(const cudaMemsetParams *pRuntimeParams, ccuda.CUDA_MEMSET_NODE_PARAMS *pDriverParams) noexcept nogil:             # <<<<<<<<<<<<<<
 *     pDriverParams[0].dst = <ccuda.CUdeviceptr_v2>pRuntimeParams[0].dst
 *     pDriverParams[0].pitch = pRuntimeParams[0].pitch
 */

static void __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemsetNodeParams(struct cudaMemsetParams const *__pyx_v_pRuntimeParams, CUDA_MEMSET_NODE_PARAMS *__pyx_v_pDriverParams) {
  __Pyx_TraceDeclarations
  size_t __pyx_t_1;
  unsigned 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("toDriverMemsetNodeParams", __pyx_f[0], 2112, 1, __PYX_ERR(0, 2112, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2113
 * 
 * cdef void toDriverMemsetNodeParams(const cudaMemsetParams *pRuntimeParams, ccuda.CUDA_MEMSET_NODE_PARAMS *pDriverParams) noexcept nogil:
 *     pDriverParams[0].dst = <ccuda.CUdeviceptr_v2>pRuntimeParams[0].dst             # <<<<<<<<<<<<<<
 *     pDriverParams[0].pitch = pRuntimeParams[0].pitch
 *     pDriverParams[0].value = pRuntimeParams[0].value
 */
  (__pyx_v_pDriverParams[0]).dst = ((CUdeviceptr_v2)(__pyx_v_pRuntimeParams[0]).dst);

  /* "cuda/_lib/ccudart/utils.pyx":2114
 * cdef void toDriverMemsetNodeParams(const cudaMemsetParams *pRuntimeParams, ccuda.CUDA_MEMSET_NODE_PARAMS *pDriverParams) noexcept nogil:
 *     pDriverParams[0].dst = <ccuda.CUdeviceptr_v2>pRuntimeParams[0].dst
 *     pDriverParams[0].pitch = pRuntimeParams[0].pitch             # <<<<<<<<<<<<<<
 *     pDriverParams[0].value = pRuntimeParams[0].value
 *     pDriverParams[0].elementSize = pRuntimeParams[0].elementSize
 */
  __pyx_t_1 = (__pyx_v_pRuntimeParams[0]).pitch;
  (__pyx_v_pDriverParams[0]).pitch = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":2115
 *     pDriverParams[0].dst = <ccuda.CUdeviceptr_v2>pRuntimeParams[0].dst
 *     pDriverParams[0].pitch = pRuntimeParams[0].pitch
 *     pDriverParams[0].value = pRuntimeParams[0].value             # <<<<<<<<<<<<<<
 *     pDriverParams[0].elementSize = pRuntimeParams[0].elementSize
 *     pDriverParams[0].width = pRuntimeParams[0].width
 */
  __pyx_t_2 = (__pyx_v_pRuntimeParams[0]).value;
  (__pyx_v_pDriverParams[0]).value = __pyx_t_2;

  /* "cuda/_lib/ccudart/utils.pyx":2116
 *     pDriverParams[0].pitch = pRuntimeParams[0].pitch
 *     pDriverParams[0].value = pRuntimeParams[0].value
 *     pDriverParams[0].elementSize = pRuntimeParams[0].elementSize             # <<<<<<<<<<<<<<
 *     pDriverParams[0].width = pRuntimeParams[0].width
 *     pDriverParams[0].height = pRuntimeParams[0].height
 */
  __pyx_t_2 = (__pyx_v_pRuntimeParams[0]).elementSize;
  (__pyx_v_pDriverParams[0]).elementSize = __pyx_t_2;

  /* "cuda/_lib/ccudart/utils.pyx":2117
 *     pDriverParams[0].value = pRuntimeParams[0].value
 *     pDriverParams[0].elementSize = pRuntimeParams[0].elementSize
 *     pDriverParams[0].width = pRuntimeParams[0].width             # <<<<<<<<<<<<<<
 *     pDriverParams[0].height = pRuntimeParams[0].height
 * 
 */
  __pyx_t_1 = (__pyx_v_pRuntimeParams[0]).width;
  (__pyx_v_pDriverParams[0]).width = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":2118
 *     pDriverParams[0].elementSize = pRuntimeParams[0].elementSize
 *     pDriverParams[0].width = pRuntimeParams[0].width
 *     pDriverParams[0].height = pRuntimeParams[0].height             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = (__pyx_v_pRuntimeParams[0]).height;
  (__pyx_v_pDriverParams[0]).height = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":2112
 * 
 * 
 * cdef void toDriverMemsetNodeParams(const cudaMemsetParams *pRuntimeParams, ccuda.CUDA_MEMSET_NODE_PARAMS *pDriverParams) noexcept nogil:             # <<<<<<<<<<<<<<
 *     pDriverParams[0].dst = <ccuda.CUdeviceptr_v2>pRuntimeParams[0].dst
 *     pDriverParams[0].pitch = pRuntimeParams[0].pitch
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_WriteUnraisable("cuda._lib.ccudart.utils.toDriverMemsetNodeParams", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
}

/* "cuda/_lib/ccudart/utils.pyx":2121
 * 
 * 
 * cdef cudaError_t getElementSize(size_t *elementSize, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR driverDesc
 *     cdef cudaError_t err = cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_getElementSize(size_t *__pyx_v_elementSize, cudaArray_t __pyx_v_array) {
  CUDA_ARRAY3D_DESCRIPTOR __pyx_v_driverDesc;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  unsigned 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("getElementSize", __pyx_f[0], 2121, 1, __PYX_ERR(0, 2121, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2123
 * cdef cudaError_t getElementSize(size_t *elementSize, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR driverDesc
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>array)
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":2124
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR driverDesc
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>array)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuArray3DGetDescriptor_v2((&__pyx_v_driverDesc), ((CUarray)__pyx_v_array)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2124, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/utils.pyx":2125
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>array)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if (driverDesc.Format == ccuda.CU_AD_FORMAT_FLOAT or
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":2126
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>array)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     if (driverDesc.Format == ccuda.CU_AD_FORMAT_FLOAT or
 *         driverDesc.Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32 or
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2125
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuArray3DGetDescriptor_v2(&driverDesc, <ccuda.CUarray>array)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     if (driverDesc.Format == ccuda.CU_AD_FORMAT_FLOAT or
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2127
 *     if err != cudaSuccess:
 *         return err
 *     if (driverDesc.Format == ccuda.CU_AD_FORMAT_FLOAT or             # <<<<<<<<<<<<<<
 *         driverDesc.Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32 or
 *         driverDesc.Format == ccuda.CU_AD_FORMAT_SIGNED_INT32):
 */
  switch (__pyx_v_driverDesc.Format) {
    case CU_AD_FORMAT_FLOAT:
    case CU_AD_FORMAT_UNSIGNED_INT32:

    /* "cuda/_lib/ccudart/utils.pyx":2128
 *         return err
 *     if (driverDesc.Format == ccuda.CU_AD_FORMAT_FLOAT or
 *         driverDesc.Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32 or             # <<<<<<<<<<<<<<
 *         driverDesc.Format == ccuda.CU_AD_FORMAT_SIGNED_INT32):
 *         elementSize[0] = driverDesc.NumChannels * 4
 */
    case CU_AD_FORMAT_SIGNED_INT32:

    /* "cuda/_lib/ccudart/utils.pyx":2130
 *         driverDesc.Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32 or
 *         driverDesc.Format == ccuda.CU_AD_FORMAT_SIGNED_INT32):
 *         elementSize[0] = driverDesc.NumChannels * 4             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     elif (driverDesc.Format == ccuda.CU_AD_FORMAT_HALF or
 */
    (__pyx_v_elementSize[0]) = (__pyx_v_driverDesc.NumChannels * 4);

    /* "cuda/_lib/ccudart/utils.pyx":2131
 *         driverDesc.Format == ccuda.CU_AD_FORMAT_SIGNED_INT32):
 *         elementSize[0] = driverDesc.NumChannels * 4
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     elif (driverDesc.Format == ccuda.CU_AD_FORMAT_HALF or
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_SIGNED_INT16 or
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2127
 *     if err != cudaSuccess:
 *         return err
 *     if (driverDesc.Format == ccuda.CU_AD_FORMAT_FLOAT or             # <<<<<<<<<<<<<<
 *         driverDesc.Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT32 or
 *         driverDesc.Format == ccuda.CU_AD_FORMAT_SIGNED_INT32):
 */
    break;
    case CU_AD_FORMAT_HALF:

    /* "cuda/_lib/ccudart/utils.pyx":2132
 *         elementSize[0] = driverDesc.NumChannels * 4
 *         return cudaSuccess
 *     elif (driverDesc.Format == ccuda.CU_AD_FORMAT_HALF or             # <<<<<<<<<<<<<<
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_SIGNED_INT16 or
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 */
    case CU_AD_FORMAT_SIGNED_INT16:

    /* "cuda/_lib/ccudart/utils.pyx":2133
 *         return cudaSuccess
 *     elif (driverDesc.Format == ccuda.CU_AD_FORMAT_HALF or
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_SIGNED_INT16 or             # <<<<<<<<<<<<<<
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 *         elementSize[0] = driverDesc.NumChannels * 2
 */
    case CU_AD_FORMAT_UNSIGNED_INT16:

    /* "cuda/_lib/ccudart/utils.pyx":2135
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_SIGNED_INT16 or
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 *         elementSize[0] = driverDesc.NumChannels * 2             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     elif (driverDesc.Format == ccuda.CU_AD_FORMAT_SIGNED_INT8 or
 */
    (__pyx_v_elementSize[0]) = (__pyx_v_driverDesc.NumChannels * 2);

    /* "cuda/_lib/ccudart/utils.pyx":2136
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 *         elementSize[0] = driverDesc.NumChannels * 2
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     elif (driverDesc.Format == ccuda.CU_AD_FORMAT_SIGNED_INT8 or
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8 or
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2132
 *         elementSize[0] = driverDesc.NumChannels * 4
 *         return cudaSuccess
 *     elif (driverDesc.Format == ccuda.CU_AD_FORMAT_HALF or             # <<<<<<<<<<<<<<
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_SIGNED_INT16 or
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT16):
 */
    break;
    case CU_AD_FORMAT_SIGNED_INT8:

    /* "cuda/_lib/ccudart/utils.pyx":2137
 *         elementSize[0] = driverDesc.NumChannels * 2
 *         return cudaSuccess
 *     elif (driverDesc.Format == ccuda.CU_AD_FORMAT_SIGNED_INT8 or             # <<<<<<<<<<<<<<
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8 or
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_NV12):
 */
    case CU_AD_FORMAT_UNSIGNED_INT8:

    /* "cuda/_lib/ccudart/utils.pyx":2138
 *         return cudaSuccess
 *     elif (driverDesc.Format == ccuda.CU_AD_FORMAT_SIGNED_INT8 or
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8 or             # <<<<<<<<<<<<<<
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_NV12):
 *         elementSize[0] = driverDesc.NumChannels
 */
    case CU_AD_FORMAT_NV12:

    /* "cuda/_lib/ccudart/utils.pyx":2140
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8 or
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_NV12):
 *         elementSize[0] = driverDesc.NumChannels             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     return cudaErrorInvalidChannelDescriptor
 */
    __pyx_t_3 = __pyx_v_driverDesc.NumChannels;
    (__pyx_v_elementSize[0]) = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2141
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_NV12):
 *         elementSize[0] = driverDesc.NumChannels
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     return cudaErrorInvalidChannelDescriptor
 * 
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2137
 *         elementSize[0] = driverDesc.NumChannels * 2
 *         return cudaSuccess
 *     elif (driverDesc.Format == ccuda.CU_AD_FORMAT_SIGNED_INT8 or             # <<<<<<<<<<<<<<
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_UNSIGNED_INT8 or
 *           driverDesc.Format == ccuda.CU_AD_FORMAT_NV12):
 */
    break;
    default: break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2142
 *         elementSize[0] = driverDesc.NumChannels
 *         return cudaSuccess
 *     return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaErrorInvalidChannelDescriptor;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2121
 * 
 * 
 * cdef cudaError_t getElementSize(size_t *elementSize, cudaArray_t array) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR driverDesc
 *     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.utils.getElementSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":2145
 * 
 * 
 * cdef cudaError_t toDriverMemCopy3DParams(const cudaMemcpy3DParms *p, ccuda.CUDA_MEMCPY3D *cd) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     memset(cd, 0, sizeof(ccuda.CUDA_MEMCPY3D))
 *     cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams(struct cudaMemcpy3DParms const *__pyx_v_p, CUDA_MEMCPY3D *__pyx_v_cd) {
  size_t __pyx_v_srcElementSize;
  size_t __pyx_v_dstElementSize;
  cudaError_t __pyx_v_err;
  struct cudaExtent __pyx_v_srcBlockExtent;
  struct cudaExtent __pyx_v_dstBlockExtent;
  struct cudaExtent __pyx_v_copyBlockExtent;
  CUarray_format __pyx_v_srcFmt;
  CUarray_format __pyx_v_dstFmt;
  int __pyx_v_numChannels;
  size_t __pyx_v_adjustedSrcHeight;
  size_t __pyx_v_adjustedDstHeight;
  size_t __pyx_v_elementSize;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __pyx_t_3;
  void *__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("toDriverMemCopy3DParams", __pyx_f[0], 2145, 1, __PYX_ERR(0, 2145, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2146
 * 
 * cdef cudaError_t toDriverMemCopy3DParams(const cudaMemcpy3DParms *p, ccuda.CUDA_MEMCPY3D *cd) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     memset(cd, 0, sizeof(ccuda.CUDA_MEMCPY3D))             # <<<<<<<<<<<<<<
 *     cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *     cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 */
  (void)(memset(__pyx_v_cd, 0, (sizeof(CUDA_MEMCPY3D))));

  /* "cuda/_lib/ccudart/utils.pyx":2147
 * cdef cudaError_t toDriverMemCopy3DParams(const cudaMemcpy3DParms *p, ccuda.CUDA_MEMCPY3D *cd) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     memset(cd, 0, sizeof(ccuda.CUDA_MEMCPY3D))
 *     cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE             # <<<<<<<<<<<<<<
 *     cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *     cd[0].WidthInBytes = 0
 */
  (__pyx_v_cd[0]).dstMemoryType = CU_MEMORYTYPE_DEVICE;

  /* "cuda/_lib/ccudart/utils.pyx":2148
 *     memset(cd, 0, sizeof(ccuda.CUDA_MEMCPY3D))
 *     cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *     cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE             # <<<<<<<<<<<<<<
 *     cd[0].WidthInBytes = 0
 *     cd[0].Height = 1
 */
  (__pyx_v_cd[0]).srcMemoryType = CU_MEMORYTYPE_DEVICE;

  /* "cuda/_lib/ccudart/utils.pyx":2149
 *     cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *     cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *     cd[0].WidthInBytes = 0             # <<<<<<<<<<<<<<
 *     cd[0].Height = 1
 *     cd[0].Depth = 1
 */
  (__pyx_v_cd[0]).WidthInBytes = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2150
 *     cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *     cd[0].WidthInBytes = 0
 *     cd[0].Height = 1             # <<<<<<<<<<<<<<
 *     cd[0].Depth = 1
 *     cdef size_t srcElementSize = 0
 */
  (__pyx_v_cd[0]).Height = 1;

  /* "cuda/_lib/ccudart/utils.pyx":2151
 *     cd[0].WidthInBytes = 0
 *     cd[0].Height = 1
 *     cd[0].Depth = 1             # <<<<<<<<<<<<<<
 *     cdef size_t srcElementSize = 0
 *     cdef size_t dstElementSize = 0
 */
  (__pyx_v_cd[0]).Depth = 1;

  /* "cuda/_lib/ccudart/utils.pyx":2152
 *     cd[0].Height = 1
 *     cd[0].Depth = 1
 *     cdef size_t srcElementSize = 0             # <<<<<<<<<<<<<<
 *     cdef size_t dstElementSize = 0
 *     cdef cudaError_t err = cudaSuccess
 */
  __pyx_v_srcElementSize = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2153
 *     cd[0].Depth = 1
 *     cdef size_t srcElementSize = 0
 *     cdef size_t dstElementSize = 0             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */
  __pyx_v_dstElementSize = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2154
 *     cdef size_t srcElementSize = 0
 *     cdef size_t dstElementSize = 0
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaExtent srcBlockExtent
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":2161
 *     cdef ccuda.CUarray_format srcFmt
 *     cdef ccuda.CUarray_format dstFmt
 *     cdef int numChannels = 0             # <<<<<<<<<<<<<<
 *     srcBlockExtent.width = srcBlockExtent.height = srcBlockExtent.depth = 1
 *     dstBlockExtent.width = dstBlockExtent.height = dstBlockExtent.depth = 1
 */
  __pyx_v_numChannels = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2162
 *     cdef ccuda.CUarray_format dstFmt
 *     cdef int numChannels = 0
 *     srcBlockExtent.width = srcBlockExtent.height = srcBlockExtent.depth = 1             # <<<<<<<<<<<<<<
 *     dstBlockExtent.width = dstBlockExtent.height = dstBlockExtent.depth = 1
 *     copyBlockExtent.width = copyBlockExtent.height = copyBlockExtent.depth = 1
 */
  __pyx_v_srcBlockExtent.width = 1;
  __pyx_v_srcBlockExtent.height = 1;
  __pyx_v_srcBlockExtent.depth = 1;

  /* "cuda/_lib/ccudart/utils.pyx":2163
 *     cdef int numChannels = 0
 *     srcBlockExtent.width = srcBlockExtent.height = srcBlockExtent.depth = 1
 *     dstBlockExtent.width = dstBlockExtent.height = dstBlockExtent.depth = 1             # <<<<<<<<<<<<<<
 *     copyBlockExtent.width = copyBlockExtent.height = copyBlockExtent.depth = 1
 * 
 */
  __pyx_v_dstBlockExtent.width = 1;
  __pyx_v_dstBlockExtent.height = 1;
  __pyx_v_dstBlockExtent.depth = 1;

  /* "cuda/_lib/ccudart/utils.pyx":2164
 *     srcBlockExtent.width = srcBlockExtent.height = srcBlockExtent.depth = 1
 *     dstBlockExtent.width = dstBlockExtent.height = dstBlockExtent.depth = 1
 *     copyBlockExtent.width = copyBlockExtent.height = copyBlockExtent.depth = 1             # <<<<<<<<<<<<<<
 * 
 *     if p[0].extent.width == 0 or p[0].extent.height == 0 or p[0].extent.depth == 0:
 */
  __pyx_v_copyBlockExtent.width = 1;
  __pyx_v_copyBlockExtent.height = 1;
  __pyx_v_copyBlockExtent.depth = 1;

  /* "cuda/_lib/ccudart/utils.pyx":2166
 *     copyBlockExtent.width = copyBlockExtent.height = copyBlockExtent.depth = 1
 * 
 *     if p[0].extent.width == 0 or p[0].extent.height == 0 or p[0].extent.depth == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  __pyx_t_2 = ((__pyx_v_p[0]).extent.width == 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_p[0]).extent.height == 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_p[0]).extent.depth == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2167
 * 
 *     if p[0].extent.width == 0 or p[0].extent.height == 0 or p[0].extent.depth == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if p[0].kind == cudaMemcpyHostToHost:
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2166
 *     copyBlockExtent.width = copyBlockExtent.height = copyBlockExtent.depth = 1
 * 
 *     if p[0].extent.width == 0 or p[0].extent.height == 0 or p[0].extent.depth == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2169
 *         return cudaSuccess
 * 
 *     if p[0].kind == cudaMemcpyHostToHost:             # <<<<<<<<<<<<<<
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 */
  __pyx_t_1 = ((__pyx_v_p[0]).kind == cudaMemcpyHostToHost);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2170
 * 
 *     if p[0].kind == cudaMemcpyHostToHost:
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST             # <<<<<<<<<<<<<<
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *     elif p[0].kind == cudaMemcpyHostToDevice:
 */
    (__pyx_v_cd[0]).srcMemoryType = CU_MEMORYTYPE_HOST;

    /* "cuda/_lib/ccudart/utils.pyx":2171
 *     if p[0].kind == cudaMemcpyHostToHost:
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST             # <<<<<<<<<<<<<<
 *     elif p[0].kind == cudaMemcpyHostToDevice:
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 */
    (__pyx_v_cd[0]).dstMemoryType = CU_MEMORYTYPE_HOST;

    /* "cuda/_lib/ccudart/utils.pyx":2169
 *         return cudaSuccess
 * 
 *     if p[0].kind == cudaMemcpyHostToHost:             # <<<<<<<<<<<<<<
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 */
    goto __pyx_L7;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2172
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *     elif p[0].kind == cudaMemcpyHostToDevice:             # <<<<<<<<<<<<<<
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 */
  __pyx_t_1 = ((__pyx_v_p[0]).kind == cudaMemcpyHostToDevice);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2173
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *     elif p[0].kind == cudaMemcpyHostToDevice:
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST             # <<<<<<<<<<<<<<
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *     elif p[0].kind == cudaMemcpyDeviceToHost:
 */
    (__pyx_v_cd[0]).srcMemoryType = CU_MEMORYTYPE_HOST;

    /* "cuda/_lib/ccudart/utils.pyx":2174
 *     elif p[0].kind == cudaMemcpyHostToDevice:
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE             # <<<<<<<<<<<<<<
 *     elif p[0].kind == cudaMemcpyDeviceToHost:
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 */
    (__pyx_v_cd[0]).dstMemoryType = CU_MEMORYTYPE_DEVICE;

    /* "cuda/_lib/ccudart/utils.pyx":2172
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *     elif p[0].kind == cudaMemcpyHostToDevice:             # <<<<<<<<<<<<<<
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 */
    goto __pyx_L7;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2175
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *     elif p[0].kind == cudaMemcpyDeviceToHost:             # <<<<<<<<<<<<<<
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 */
  __pyx_t_1 = ((__pyx_v_p[0]).kind == cudaMemcpyDeviceToHost);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2176
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *     elif p[0].kind == cudaMemcpyDeviceToHost:
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE             # <<<<<<<<<<<<<<
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *     elif p[0].kind == cudaMemcpyDeviceToDevice:
 */
    (__pyx_v_cd[0]).srcMemoryType = CU_MEMORYTYPE_DEVICE;

    /* "cuda/_lib/ccudart/utils.pyx":2177
 *     elif p[0].kind == cudaMemcpyDeviceToHost:
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST             # <<<<<<<<<<<<<<
 *     elif p[0].kind == cudaMemcpyDeviceToDevice:
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 */
    (__pyx_v_cd[0]).dstMemoryType = CU_MEMORYTYPE_HOST;

    /* "cuda/_lib/ccudart/utils.pyx":2175
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *     elif p[0].kind == cudaMemcpyDeviceToHost:             # <<<<<<<<<<<<<<
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 */
    goto __pyx_L7;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2178
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *     elif p[0].kind == cudaMemcpyDeviceToDevice:             # <<<<<<<<<<<<<<
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 */
  __pyx_t_1 = ((__pyx_v_p[0]).kind == cudaMemcpyDeviceToDevice);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2179
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *     elif p[0].kind == cudaMemcpyDeviceToDevice:
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE             # <<<<<<<<<<<<<<
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *     elif p[0].kind == cudaMemcpyDefault:
 */
    (__pyx_v_cd[0]).srcMemoryType = CU_MEMORYTYPE_DEVICE;

    /* "cuda/_lib/ccudart/utils.pyx":2180
 *     elif p[0].kind == cudaMemcpyDeviceToDevice:
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE             # <<<<<<<<<<<<<<
 *     elif p[0].kind == cudaMemcpyDefault:
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED
 */
    (__pyx_v_cd[0]).dstMemoryType = CU_MEMORYTYPE_DEVICE;

    /* "cuda/_lib/ccudart/utils.pyx":2178
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *     elif p[0].kind == cudaMemcpyDeviceToDevice:             # <<<<<<<<<<<<<<
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 */
    goto __pyx_L7;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2181
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *     elif p[0].kind == cudaMemcpyDefault:             # <<<<<<<<<<<<<<
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED
 */
  __pyx_t_1 = ((__pyx_v_p[0]).kind == cudaMemcpyDefault);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2182
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *     elif p[0].kind == cudaMemcpyDefault:
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED             # <<<<<<<<<<<<<<
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED
 *     else:
 */
    (__pyx_v_cd[0]).srcMemoryType = CU_MEMORYTYPE_UNIFIED;

    /* "cuda/_lib/ccudart/utils.pyx":2183
 *     elif p[0].kind == cudaMemcpyDefault:
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorInvalidMemcpyDirection
 */
    (__pyx_v_cd[0]).dstMemoryType = CU_MEMORYTYPE_UNIFIED;

    /* "cuda/_lib/ccudart/utils.pyx":2181
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *     elif p[0].kind == cudaMemcpyDefault:             # <<<<<<<<<<<<<<
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED
 */
    goto __pyx_L7;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2185
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED
 *     else:
 *         return cudaErrorInvalidMemcpyDirection             # <<<<<<<<<<<<<<
 * 
 *     if p[0].srcArray:
 */
  /*else*/ {
    __pyx_r = cudaErrorInvalidMemcpyDirection;
    goto __pyx_L0;
  }
  __pyx_L7:;

  /* "cuda/_lib/ccudart/utils.pyx":2187
 *         return cudaErrorInvalidMemcpyDirection
 * 
 *     if p[0].srcArray:             # <<<<<<<<<<<<<<
 *         err = getFormat(p[0].srcArray, numChannels, &srcFmt)
 *         if err != cudaSuccess:
 */
  __pyx_t_1 = ((__pyx_v_p[0]).srcArray != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2188
 * 
 *     if p[0].srcArray:
 *         err = getFormat(p[0].srcArray, numChannels, &srcFmt)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getFormat((__pyx_v_p[0]).srcArray, __pyx_v_numChannels, (&__pyx_v_srcFmt)); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2188, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2189
 *     if p[0].srcArray:
 *         err = getFormat(p[0].srcArray, numChannels, &srcFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2190
 *         err = getFormat(p[0].srcArray, numChannels, &srcFmt)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2189
 *     if p[0].srcArray:
 *         err = getFormat(p[0].srcArray, numChannels, &srcFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2191
 *         if err != cudaSuccess:
 *             return err
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getArrayBlockExtent((&__pyx_v_srcBlockExtent), __pyx_v_srcFmt); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2191, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2192
 *             return err
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         copyBlockExtent = srcBlockExtent
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2193
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         copyBlockExtent = srcBlockExtent
 *     if p[0].dstArray:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2192
 *             return err
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         copyBlockExtent = srcBlockExtent
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2194
 *         if err != cudaSuccess:
 *             return err
 *         copyBlockExtent = srcBlockExtent             # <<<<<<<<<<<<<<
 *     if p[0].dstArray:
 *         err = getFormat(p[0].dstArray, numChannels, &dstFmt)
 */
    __pyx_v_copyBlockExtent = __pyx_v_srcBlockExtent;

    /* "cuda/_lib/ccudart/utils.pyx":2187
 *         return cudaErrorInvalidMemcpyDirection
 * 
 *     if p[0].srcArray:             # <<<<<<<<<<<<<<
 *         err = getFormat(p[0].srcArray, numChannels, &srcFmt)
 *         if err != cudaSuccess:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2195
 *             return err
 *         copyBlockExtent = srcBlockExtent
 *     if p[0].dstArray:             # <<<<<<<<<<<<<<
 *         err = getFormat(p[0].dstArray, numChannels, &dstFmt)
 *         if err != cudaSuccess:
 */
  __pyx_t_1 = ((__pyx_v_p[0]).dstArray != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2196
 *         copyBlockExtent = srcBlockExtent
 *     if p[0].dstArray:
 *         err = getFormat(p[0].dstArray, numChannels, &dstFmt)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getFormat((__pyx_v_p[0]).dstArray, __pyx_v_numChannels, (&__pyx_v_dstFmt)); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2196, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2197
 *     if p[0].dstArray:
 *         err = getFormat(p[0].dstArray, numChannels, &dstFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2198
 *         err = getFormat(p[0].dstArray, numChannels, &dstFmt)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2197
 *     if p[0].dstArray:
 *         err = getFormat(p[0].dstArray, numChannels, &dstFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2199
 *         if err != cudaSuccess:
 *             return err
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getArrayBlockExtent((&__pyx_v_dstBlockExtent), __pyx_v_dstFmt); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2199, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2200
 *             return err
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         if not p[0].srcArray:
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2201
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         if not p[0].srcArray:
 *             copyBlockExtent = dstBlockExtent
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2200
 *             return err
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         if not p[0].srcArray:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2202
 *         if err != cudaSuccess:
 *             return err
 *         if not p[0].srcArray:             # <<<<<<<<<<<<<<
 *             copyBlockExtent = dstBlockExtent
 * 
 */
    __pyx_t_1 = (!((__pyx_v_p[0]).srcArray != 0));
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2203
 *             return err
 *         if not p[0].srcArray:
 *             copyBlockExtent = dstBlockExtent             # <<<<<<<<<<<<<<
 * 
 *     if p[0].srcArray:
 */
      __pyx_v_copyBlockExtent = __pyx_v_dstBlockExtent;

      /* "cuda/_lib/ccudart/utils.pyx":2202
 *         if err != cudaSuccess:
 *             return err
 *         if not p[0].srcArray:             # <<<<<<<<<<<<<<
 *             copyBlockExtent = dstBlockExtent
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2195
 *             return err
 *         copyBlockExtent = srcBlockExtent
 *     if p[0].dstArray:             # <<<<<<<<<<<<<<
 *         err = getFormat(p[0].dstArray, numChannels, &dstFmt)
 *         if err != cudaSuccess:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2205
 *             copyBlockExtent = dstBlockExtent
 * 
 *     if p[0].srcArray:             # <<<<<<<<<<<<<<
 *         if NULL != p[0].srcPtr.ptr or ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST == cd[0].srcMemoryType:
 *             return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_p[0]).srcArray != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2206
 * 
 *     if p[0].srcArray:
 *         if NULL != p[0].srcPtr.ptr or ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST == cd[0].srcMemoryType:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY
 */
    __pyx_t_2 = (NULL != (__pyx_v_p[0]).srcPtr.ptr);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L17_bool_binop_done;
    }
    __pyx_t_2 = (CU_MEMORYTYPE_HOST == (__pyx_v_cd[0]).srcMemoryType);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L17_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2207
 *     if p[0].srcArray:
 *         if NULL != p[0].srcPtr.ptr or ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST == cd[0].srcMemoryType:
 *             return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY
 *         cd[0].srcArray = <ccuda.CUarray>p[0].srcArray
 */
      __pyx_r = cudaErrorInvalidValue;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2206
 * 
 *     if p[0].srcArray:
 *         if NULL != p[0].srcPtr.ptr or ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST == cd[0].srcMemoryType:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2208
 *         if NULL != p[0].srcPtr.ptr or ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST == cd[0].srcMemoryType:
 *             return cudaErrorInvalidValue
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY             # <<<<<<<<<<<<<<
 *         cd[0].srcArray = <ccuda.CUarray>p[0].srcArray
 *         err = getElementSize(&srcElementSize, p[0].srcArray)
 */
    (__pyx_v_cd[0]).srcMemoryType = CU_MEMORYTYPE_ARRAY;

    /* "cuda/_lib/ccudart/utils.pyx":2209
 *             return cudaErrorInvalidValue
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY
 *         cd[0].srcArray = <ccuda.CUarray>p[0].srcArray             # <<<<<<<<<<<<<<
 *         err = getElementSize(&srcElementSize, p[0].srcArray)
 *         if err != cudaSuccess:
 */
    (__pyx_v_cd[0]).srcArray = ((CUarray)(__pyx_v_p[0]).srcArray);

    /* "cuda/_lib/ccudart/utils.pyx":2210
 *         cd[0].srcMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY
 *         cd[0].srcArray = <ccuda.CUarray>p[0].srcArray
 *         err = getElementSize(&srcElementSize, p[0].srcArray)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getElementSize((&__pyx_v_srcElementSize), (__pyx_v_p[0]).srcArray); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2210, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2211
 *         cd[0].srcArray = <ccuda.CUarray>p[0].srcArray
 *         err = getElementSize(&srcElementSize, p[0].srcArray)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     else:
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2212
 *         err = getElementSize(&srcElementSize, p[0].srcArray)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *     else:
 *         if NULL == p[0].srcPtr.ptr:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2211
 *         cd[0].srcArray = <ccuda.CUarray>p[0].srcArray
 *         err = getElementSize(&srcElementSize, p[0].srcArray)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     else:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2205
 *             copyBlockExtent = dstBlockExtent
 * 
 *     if p[0].srcArray:             # <<<<<<<<<<<<<<
 *         if NULL != p[0].srcPtr.ptr or ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST == cd[0].srcMemoryType:
 *             return cudaErrorInvalidValue
 */
    goto __pyx_L15;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2214
 *             return err
 *     else:
 *         if NULL == p[0].srcPtr.ptr:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         if (p[0].extent.height > 1 or p[0].extent.depth > 1) and (p[0].extent.width > p[0].srcPtr.pitch):
 */
  /*else*/ {
    __pyx_t_1 = (NULL == (__pyx_v_p[0]).srcPtr.ptr);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2215
 *     else:
 *         if NULL == p[0].srcPtr.ptr:
 *             return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *         if (p[0].extent.height > 1 or p[0].extent.depth > 1) and (p[0].extent.width > p[0].srcPtr.pitch):
 *             return cudaErrorInvalidPitchValue
 */
      __pyx_r = cudaErrorInvalidValue;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2214
 *             return err
 *     else:
 *         if NULL == p[0].srcPtr.ptr:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         if (p[0].extent.height > 1 or p[0].extent.depth > 1) and (p[0].extent.width > p[0].srcPtr.pitch):
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2216
 *         if NULL == p[0].srcPtr.ptr:
 *             return cudaErrorInvalidValue
 *         if (p[0].extent.height > 1 or p[0].extent.depth > 1) and (p[0].extent.width > p[0].srcPtr.pitch):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidPitchValue
 *         if p[0].extent.depth > 1:
 */
    __pyx_t_2 = ((__pyx_v_p[0]).extent.height > 1);
    if (!__pyx_t_2) {
    } else {
      goto __pyx_L23_next_and;
    }
    __pyx_t_2 = ((__pyx_v_p[0]).extent.depth > 1);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L22_bool_binop_done;
    }
    __pyx_L23_next_and:;
    __pyx_t_2 = ((__pyx_v_p[0]).extent.width > (__pyx_v_p[0]).srcPtr.pitch);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L22_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2217
 *             return cudaErrorInvalidValue
 *         if (p[0].extent.height > 1 or p[0].extent.depth > 1) and (p[0].extent.width > p[0].srcPtr.pitch):
 *             return cudaErrorInvalidPitchValue             # <<<<<<<<<<<<<<
 *         if p[0].extent.depth > 1:
 *             adjustedSrcHeight = p[0].srcPtr.ysize * copyBlockExtent.height
 */
      __pyx_r = cudaErrorInvalidPitchValue;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2216
 *         if NULL == p[0].srcPtr.ptr:
 *             return cudaErrorInvalidValue
 *         if (p[0].extent.height > 1 or p[0].extent.depth > 1) and (p[0].extent.width > p[0].srcPtr.pitch):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidPitchValue
 *         if p[0].extent.depth > 1:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2218
 *         if (p[0].extent.height > 1 or p[0].extent.depth > 1) and (p[0].extent.width > p[0].srcPtr.pitch):
 *             return cudaErrorInvalidPitchValue
 *         if p[0].extent.depth > 1:             # <<<<<<<<<<<<<<
 *             adjustedSrcHeight = p[0].srcPtr.ysize * copyBlockExtent.height
 *             if p[0].extent.height > adjustedSrcHeight:
 */
    __pyx_t_1 = ((__pyx_v_p[0]).extent.depth > 1);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2219
 *             return cudaErrorInvalidPitchValue
 *         if p[0].extent.depth > 1:
 *             adjustedSrcHeight = p[0].srcPtr.ysize * copyBlockExtent.height             # <<<<<<<<<<<<<<
 *             if p[0].extent.height > adjustedSrcHeight:
 *                 return cudaErrorInvalidPitchValue
 */
      __pyx_v_adjustedSrcHeight = ((__pyx_v_p[0]).srcPtr.ysize * __pyx_v_copyBlockExtent.height);

      /* "cuda/_lib/ccudart/utils.pyx":2220
 *         if p[0].extent.depth > 1:
 *             adjustedSrcHeight = p[0].srcPtr.ysize * copyBlockExtent.height
 *             if p[0].extent.height > adjustedSrcHeight:             # <<<<<<<<<<<<<<
 *                 return cudaErrorInvalidPitchValue
 * 
 */
      __pyx_t_1 = ((__pyx_v_p[0]).extent.height > __pyx_v_adjustedSrcHeight);
      if (__pyx_t_1) {

        /* "cuda/_lib/ccudart/utils.pyx":2221
 *             adjustedSrcHeight = p[0].srcPtr.ysize * copyBlockExtent.height
 *             if p[0].extent.height > adjustedSrcHeight:
 *                 return cudaErrorInvalidPitchValue             # <<<<<<<<<<<<<<
 * 
 *         if ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST == cd[0].srcMemoryType:
 */
        __pyx_r = cudaErrorInvalidPitchValue;
        goto __pyx_L0;

        /* "cuda/_lib/ccudart/utils.pyx":2220
 *         if p[0].extent.depth > 1:
 *             adjustedSrcHeight = p[0].srcPtr.ysize * copyBlockExtent.height
 *             if p[0].extent.height > adjustedSrcHeight:             # <<<<<<<<<<<<<<
 *                 return cudaErrorInvalidPitchValue
 * 
 */
      }

      /* "cuda/_lib/ccudart/utils.pyx":2218
 *         if (p[0].extent.height > 1 or p[0].extent.depth > 1) and (p[0].extent.width > p[0].srcPtr.pitch):
 *             return cudaErrorInvalidPitchValue
 *         if p[0].extent.depth > 1:             # <<<<<<<<<<<<<<
 *             adjustedSrcHeight = p[0].srcPtr.ysize * copyBlockExtent.height
 *             if p[0].extent.height > adjustedSrcHeight:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2223
 *                 return cudaErrorInvalidPitchValue
 * 
 *         if ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST == cd[0].srcMemoryType:             # <<<<<<<<<<<<<<
 *             cd[0].srcHost = p[0].srcPtr.ptr
 *         else:
 */
    __pyx_t_1 = (CU_MEMORYTYPE_HOST == (__pyx_v_cd[0]).srcMemoryType);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2224
 * 
 *         if ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST == cd[0].srcMemoryType:
 *             cd[0].srcHost = p[0].srcPtr.ptr             # <<<<<<<<<<<<<<
 *         else:
 *             cd[0].srcDevice = <ccuda.CUdeviceptr_v2>(p[0].srcPtr.ptr)
 */
      __pyx_t_4 = (__pyx_v_p[0]).srcPtr.ptr;
      (__pyx_v_cd[0]).srcHost = __pyx_t_4;

      /* "cuda/_lib/ccudart/utils.pyx":2223
 *                 return cudaErrorInvalidPitchValue
 * 
 *         if ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST == cd[0].srcMemoryType:             # <<<<<<<<<<<<<<
 *             cd[0].srcHost = p[0].srcPtr.ptr
 *         else:
 */
      goto __pyx_L27;
    }

    /* "cuda/_lib/ccudart/utils.pyx":2226
 *             cd[0].srcHost = p[0].srcPtr.ptr
 *         else:
 *             cd[0].srcDevice = <ccuda.CUdeviceptr_v2>(p[0].srcPtr.ptr)             # <<<<<<<<<<<<<<
 *         cd[0].srcPitch = p[0].srcPtr.pitch
 *         cd[0].srcHeight = p[0].srcPtr.ysize
 */
    /*else*/ {
      (__pyx_v_cd[0]).srcDevice = ((CUdeviceptr_v2)(__pyx_v_p[0]).srcPtr.ptr);
    }
    __pyx_L27:;

    /* "cuda/_lib/ccudart/utils.pyx":2227
 *         else:
 *             cd[0].srcDevice = <ccuda.CUdeviceptr_v2>(p[0].srcPtr.ptr)
 *         cd[0].srcPitch = p[0].srcPtr.pitch             # <<<<<<<<<<<<<<
 *         cd[0].srcHeight = p[0].srcPtr.ysize
 * 
 */
    __pyx_t_5 = (__pyx_v_p[0]).srcPtr.pitch;
    (__pyx_v_cd[0]).srcPitch = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":2228
 *             cd[0].srcDevice = <ccuda.CUdeviceptr_v2>(p[0].srcPtr.ptr)
 *         cd[0].srcPitch = p[0].srcPtr.pitch
 *         cd[0].srcHeight = p[0].srcPtr.ysize             # <<<<<<<<<<<<<<
 * 
 *     if p[0].dstArray:
 */
    __pyx_t_5 = (__pyx_v_p[0]).srcPtr.ysize;
    (__pyx_v_cd[0]).srcHeight = __pyx_t_5;
  }
  __pyx_L15:;

  /* "cuda/_lib/ccudart/utils.pyx":2230
 *         cd[0].srcHeight = p[0].srcPtr.ysize
 * 
 *     if p[0].dstArray:             # <<<<<<<<<<<<<<
 *         if NULL != p[0].dstPtr.ptr:
 *             return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_p[0]).dstArray != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2231
 * 
 *     if p[0].dstArray:
 *         if NULL != p[0].dstPtr.ptr:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY
 */
    __pyx_t_1 = (NULL != (__pyx_v_p[0]).dstPtr.ptr);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2232
 *     if p[0].dstArray:
 *         if NULL != p[0].dstPtr.ptr:
 *             return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY
 *         cd[0].dstArray = <ccuda.CUarray>p[0].dstArray
 */
      __pyx_r = cudaErrorInvalidValue;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2231
 * 
 *     if p[0].dstArray:
 *         if NULL != p[0].dstPtr.ptr:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2233
 *         if NULL != p[0].dstPtr.ptr:
 *             return cudaErrorInvalidValue
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY             # <<<<<<<<<<<<<<
 *         cd[0].dstArray = <ccuda.CUarray>p[0].dstArray
 *         err = getElementSize(&dstElementSize, p[0].dstArray)
 */
    (__pyx_v_cd[0]).dstMemoryType = CU_MEMORYTYPE_ARRAY;

    /* "cuda/_lib/ccudart/utils.pyx":2234
 *             return cudaErrorInvalidValue
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY
 *         cd[0].dstArray = <ccuda.CUarray>p[0].dstArray             # <<<<<<<<<<<<<<
 *         err = getElementSize(&dstElementSize, p[0].dstArray)
 *         if err != cudaSuccess:
 */
    (__pyx_v_cd[0]).dstArray = ((CUarray)(__pyx_v_p[0]).dstArray);

    /* "cuda/_lib/ccudart/utils.pyx":2235
 *         cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY
 *         cd[0].dstArray = <ccuda.CUarray>p[0].dstArray
 *         err = getElementSize(&dstElementSize, p[0].dstArray)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getElementSize((&__pyx_v_dstElementSize), (__pyx_v_p[0]).dstArray); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2235, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2236
 *         cd[0].dstArray = <ccuda.CUarray>p[0].dstArray
 *         err = getElementSize(&dstElementSize, p[0].dstArray)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     else:
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2237
 *         err = getElementSize(&dstElementSize, p[0].dstArray)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *     else:
 *         if NULL == p[0].dstPtr.ptr:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2236
 *         cd[0].dstArray = <ccuda.CUarray>p[0].dstArray
 *         err = getElementSize(&dstElementSize, p[0].dstArray)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     else:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2230
 *         cd[0].srcHeight = p[0].srcPtr.ysize
 * 
 *     if p[0].dstArray:             # <<<<<<<<<<<<<<
 *         if NULL != p[0].dstPtr.ptr:
 *             return cudaErrorInvalidValue
 */
    goto __pyx_L28;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2239
 *             return err
 *     else:
 *         if NULL == p[0].dstPtr.ptr:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         if (p[0].extent.height > 1 or p[0].extent.depth > 1) and (p[0].extent.width > p[0].dstPtr.pitch):
 */
  /*else*/ {
    __pyx_t_1 = (NULL == (__pyx_v_p[0]).dstPtr.ptr);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2240
 *     else:
 *         if NULL == p[0].dstPtr.ptr:
 *             return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *         if (p[0].extent.height > 1 or p[0].extent.depth > 1) and (p[0].extent.width > p[0].dstPtr.pitch):
 *             return cudaErrorInvalidPitchValue
 */
      __pyx_r = cudaErrorInvalidValue;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2239
 *             return err
 *     else:
 *         if NULL == p[0].dstPtr.ptr:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         if (p[0].extent.height > 1 or p[0].extent.depth > 1) and (p[0].extent.width > p[0].dstPtr.pitch):
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2241
 *         if NULL == p[0].dstPtr.ptr:
 *             return cudaErrorInvalidValue
 *         if (p[0].extent.height > 1 or p[0].extent.depth > 1) and (p[0].extent.width > p[0].dstPtr.pitch):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidPitchValue
 *         if p[0].extent.depth > 1:
 */
    __pyx_t_2 = ((__pyx_v_p[0]).extent.height > 1);
    if (!__pyx_t_2) {
    } else {
      goto __pyx_L34_next_and;
    }
    __pyx_t_2 = ((__pyx_v_p[0]).extent.depth > 1);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L33_bool_binop_done;
    }
    __pyx_L34_next_and:;
    __pyx_t_2 = ((__pyx_v_p[0]).extent.width > (__pyx_v_p[0]).dstPtr.pitch);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L33_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2242
 *             return cudaErrorInvalidValue
 *         if (p[0].extent.height > 1 or p[0].extent.depth > 1) and (p[0].extent.width > p[0].dstPtr.pitch):
 *             return cudaErrorInvalidPitchValue             # <<<<<<<<<<<<<<
 *         if p[0].extent.depth > 1:
 *             adjustedDstHeight = p[0].dstPtr.ysize * copyBlockExtent.height
 */
      __pyx_r = cudaErrorInvalidPitchValue;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2241
 *         if NULL == p[0].dstPtr.ptr:
 *             return cudaErrorInvalidValue
 *         if (p[0].extent.height > 1 or p[0].extent.depth > 1) and (p[0].extent.width > p[0].dstPtr.pitch):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidPitchValue
 *         if p[0].extent.depth > 1:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2243
 *         if (p[0].extent.height > 1 or p[0].extent.depth > 1) and (p[0].extent.width > p[0].dstPtr.pitch):
 *             return cudaErrorInvalidPitchValue
 *         if p[0].extent.depth > 1:             # <<<<<<<<<<<<<<
 *             adjustedDstHeight = p[0].dstPtr.ysize * copyBlockExtent.height
 *             if p[0].extent.height > adjustedDstHeight:
 */
    __pyx_t_1 = ((__pyx_v_p[0]).extent.depth > 1);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2244
 *             return cudaErrorInvalidPitchValue
 *         if p[0].extent.depth > 1:
 *             adjustedDstHeight = p[0].dstPtr.ysize * copyBlockExtent.height             # <<<<<<<<<<<<<<
 *             if p[0].extent.height > adjustedDstHeight:
 *                 return cudaErrorInvalidPitchValue
 */
      __pyx_v_adjustedDstHeight = ((__pyx_v_p[0]).dstPtr.ysize * __pyx_v_copyBlockExtent.height);

      /* "cuda/_lib/ccudart/utils.pyx":2245
 *         if p[0].extent.depth > 1:
 *             adjustedDstHeight = p[0].dstPtr.ysize * copyBlockExtent.height
 *             if p[0].extent.height > adjustedDstHeight:             # <<<<<<<<<<<<<<
 *                 return cudaErrorInvalidPitchValue
 * 
 */
      __pyx_t_1 = ((__pyx_v_p[0]).extent.height > __pyx_v_adjustedDstHeight);
      if (__pyx_t_1) {

        /* "cuda/_lib/ccudart/utils.pyx":2246
 *             adjustedDstHeight = p[0].dstPtr.ysize * copyBlockExtent.height
 *             if p[0].extent.height > adjustedDstHeight:
 *                 return cudaErrorInvalidPitchValue             # <<<<<<<<<<<<<<
 * 
 *         if ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST == cd[0].dstMemoryType:
 */
        __pyx_r = cudaErrorInvalidPitchValue;
        goto __pyx_L0;

        /* "cuda/_lib/ccudart/utils.pyx":2245
 *         if p[0].extent.depth > 1:
 *             adjustedDstHeight = p[0].dstPtr.ysize * copyBlockExtent.height
 *             if p[0].extent.height > adjustedDstHeight:             # <<<<<<<<<<<<<<
 *                 return cudaErrorInvalidPitchValue
 * 
 */
      }

      /* "cuda/_lib/ccudart/utils.pyx":2243
 *         if (p[0].extent.height > 1 or p[0].extent.depth > 1) and (p[0].extent.width > p[0].dstPtr.pitch):
 *             return cudaErrorInvalidPitchValue
 *         if p[0].extent.depth > 1:             # <<<<<<<<<<<<<<
 *             adjustedDstHeight = p[0].dstPtr.ysize * copyBlockExtent.height
 *             if p[0].extent.height > adjustedDstHeight:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2248
 *                 return cudaErrorInvalidPitchValue
 * 
 *         if ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST == cd[0].dstMemoryType:             # <<<<<<<<<<<<<<
 *             cd[0].dstHost = p[0].dstPtr.ptr
 *         else:
 */
    __pyx_t_1 = (CU_MEMORYTYPE_HOST == (__pyx_v_cd[0]).dstMemoryType);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2249
 * 
 *         if ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST == cd[0].dstMemoryType:
 *             cd[0].dstHost = p[0].dstPtr.ptr             # <<<<<<<<<<<<<<
 *         else:
 *             cd[0].dstDevice = <ccuda.CUdeviceptr_v2>(p[0].dstPtr.ptr)
 */
      __pyx_t_4 = (__pyx_v_p[0]).dstPtr.ptr;
      (__pyx_v_cd[0]).dstHost = __pyx_t_4;

      /* "cuda/_lib/ccudart/utils.pyx":2248
 *                 return cudaErrorInvalidPitchValue
 * 
 *         if ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST == cd[0].dstMemoryType:             # <<<<<<<<<<<<<<
 *             cd[0].dstHost = p[0].dstPtr.ptr
 *         else:
 */
      goto __pyx_L38;
    }

    /* "cuda/_lib/ccudart/utils.pyx":2251
 *             cd[0].dstHost = p[0].dstPtr.ptr
 *         else:
 *             cd[0].dstDevice = <ccuda.CUdeviceptr_v2>(p[0].dstPtr.ptr)             # <<<<<<<<<<<<<<
 *         cd[0].dstPitch = p[0].dstPtr.pitch
 *         cd[0].dstHeight = p[0].dstPtr.ysize
 */
    /*else*/ {
      (__pyx_v_cd[0]).dstDevice = ((CUdeviceptr_v2)(__pyx_v_p[0]).dstPtr.ptr);
    }
    __pyx_L38:;

    /* "cuda/_lib/ccudart/utils.pyx":2252
 *         else:
 *             cd[0].dstDevice = <ccuda.CUdeviceptr_v2>(p[0].dstPtr.ptr)
 *         cd[0].dstPitch = p[0].dstPtr.pitch             # <<<<<<<<<<<<<<
 *         cd[0].dstHeight = p[0].dstPtr.ysize
 * 
 */
    __pyx_t_5 = (__pyx_v_p[0]).dstPtr.pitch;
    (__pyx_v_cd[0]).dstPitch = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":2253
 *             cd[0].dstDevice = <ccuda.CUdeviceptr_v2>(p[0].dstPtr.ptr)
 *         cd[0].dstPitch = p[0].dstPtr.pitch
 *         cd[0].dstHeight = p[0].dstPtr.ysize             # <<<<<<<<<<<<<<
 * 
 *     if srcElementSize and dstElementSize and srcElementSize != dstElementSize:
 */
    __pyx_t_5 = (__pyx_v_p[0]).dstPtr.ysize;
    (__pyx_v_cd[0]).dstHeight = __pyx_t_5;
  }
  __pyx_L28:;

  /* "cuda/_lib/ccudart/utils.pyx":2255
 *         cd[0].dstHeight = p[0].dstPtr.ysize
 * 
 *     if srcElementSize and dstElementSize and srcElementSize != dstElementSize:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_2 = (__pyx_v_srcElementSize != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L40_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_dstElementSize != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L40_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_srcElementSize != __pyx_v_dstElementSize);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L40_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2256
 * 
 *     if srcElementSize and dstElementSize and srcElementSize != dstElementSize:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef size_t elementSize = sizeof(char)
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2255
 *         cd[0].dstHeight = p[0].dstPtr.ysize
 * 
 *     if srcElementSize and dstElementSize and srcElementSize != dstElementSize:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2258
 *         return cudaErrorInvalidValue
 * 
 *     cdef size_t elementSize = sizeof(char)             # <<<<<<<<<<<<<<
 *     if srcElementSize:
 *         elementSize = srcElementSize
 */
  __pyx_v_elementSize = (sizeof(char));

  /* "cuda/_lib/ccudart/utils.pyx":2259
 * 
 *     cdef size_t elementSize = sizeof(char)
 *     if srcElementSize:             # <<<<<<<<<<<<<<
 *         elementSize = srcElementSize
 *     if dstElementSize:
 */
  __pyx_t_1 = (__pyx_v_srcElementSize != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2260
 *     cdef size_t elementSize = sizeof(char)
 *     if srcElementSize:
 *         elementSize = srcElementSize             # <<<<<<<<<<<<<<
 *     if dstElementSize:
 *         elementSize = dstElementSize
 */
    __pyx_v_elementSize = __pyx_v_srcElementSize;

    /* "cuda/_lib/ccudart/utils.pyx":2259
 * 
 *     cdef size_t elementSize = sizeof(char)
 *     if srcElementSize:             # <<<<<<<<<<<<<<
 *         elementSize = srcElementSize
 *     if dstElementSize:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2261
 *     if srcElementSize:
 *         elementSize = srcElementSize
 *     if dstElementSize:             # <<<<<<<<<<<<<<
 *         elementSize = dstElementSize
 *     srcElementSize = elementSize
 */
  __pyx_t_1 = (__pyx_v_dstElementSize != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2262
 *         elementSize = srcElementSize
 *     if dstElementSize:
 *         elementSize = dstElementSize             # <<<<<<<<<<<<<<
 *     srcElementSize = elementSize
 *     dstElementSize = elementSize
 */
    __pyx_v_elementSize = __pyx_v_dstElementSize;

    /* "cuda/_lib/ccudart/utils.pyx":2261
 *     if srcElementSize:
 *         elementSize = srcElementSize
 *     if dstElementSize:             # <<<<<<<<<<<<<<
 *         elementSize = dstElementSize
 *     srcElementSize = elementSize
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2263
 *     if dstElementSize:
 *         elementSize = dstElementSize
 *     srcElementSize = elementSize             # <<<<<<<<<<<<<<
 *     dstElementSize = elementSize
 * 
 */
  __pyx_v_srcElementSize = __pyx_v_elementSize;

  /* "cuda/_lib/ccudart/utils.pyx":2264
 *         elementSize = dstElementSize
 *     srcElementSize = elementSize
 *     dstElementSize = elementSize             # <<<<<<<<<<<<<<
 * 
 *     # Determine the extent of the transfer
 */
  __pyx_v_dstElementSize = __pyx_v_elementSize;

  /* "cuda/_lib/ccudart/utils.pyx":2267
 * 
 *     # Determine the extent of the transfer
 *     cd[0].WidthInBytes = <size_t>((p[0].extent.width + copyBlockExtent.width - 1) / copyBlockExtent.width)  * elementSize             # <<<<<<<<<<<<<<
 *     cd[0].Height       = <size_t>((p[0].extent.height + copyBlockExtent.height - 1) / copyBlockExtent.height)
 *     cd[0].Depth        = p[0].extent.depth
 */
  __pyx_t_5 = (((__pyx_v_p[0]).extent.width + __pyx_v_copyBlockExtent.width) - 1);
  if (unlikely(__pyx_v_copyBlockExtent.width == 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, 2267, __pyx_L1_error)
  }
  (__pyx_v_cd[0]).WidthInBytes = (((size_t)(((double)__pyx_t_5) / ((double)__pyx_v_copyBlockExtent.width))) * __pyx_v_elementSize);

  /* "cuda/_lib/ccudart/utils.pyx":2268
 *     # Determine the extent of the transfer
 *     cd[0].WidthInBytes = <size_t>((p[0].extent.width + copyBlockExtent.width - 1) / copyBlockExtent.width)  * elementSize
 *     cd[0].Height       = <size_t>((p[0].extent.height + copyBlockExtent.height - 1) / copyBlockExtent.height)             # <<<<<<<<<<<<<<
 *     cd[0].Depth        = p[0].extent.depth
 * 
 */
  __pyx_t_5 = (((__pyx_v_p[0]).extent.height + __pyx_v_copyBlockExtent.height) - 1);
  if (unlikely(__pyx_v_copyBlockExtent.height == 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, 2268, __pyx_L1_error)
  }
  (__pyx_v_cd[0]).Height = ((size_t)(((double)__pyx_t_5) / ((double)__pyx_v_copyBlockExtent.height)));

  /* "cuda/_lib/ccudart/utils.pyx":2269
 *     cd[0].WidthInBytes = <size_t>((p[0].extent.width + copyBlockExtent.width - 1) / copyBlockExtent.width)  * elementSize
 *     cd[0].Height       = <size_t>((p[0].extent.height + copyBlockExtent.height - 1) / copyBlockExtent.height)
 *     cd[0].Depth        = p[0].extent.depth             # <<<<<<<<<<<<<<
 * 
 *     # Populate bloated src copy origin
 */
  __pyx_t_5 = (__pyx_v_p[0]).extent.depth;
  (__pyx_v_cd[0]).Depth = __pyx_t_5;

  /* "cuda/_lib/ccudart/utils.pyx":2272
 * 
 *     # Populate bloated src copy origin
 *     cd[0].srcXInBytes  = <size_t>(p[0].srcPos.x / srcBlockExtent.width) * elementSize             # <<<<<<<<<<<<<<
 *     cd[0].srcY         = <size_t>(p[0].srcPos.y / srcBlockExtent.height)
 *     cd[0].srcZ         = p[0].srcPos.z
 */
  if (unlikely(__pyx_v_srcBlockExtent.width == 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, 2272, __pyx_L1_error)
  }
  (__pyx_v_cd[0]).srcXInBytes = (((size_t)(((double)(__pyx_v_p[0]).srcPos.x) / ((double)__pyx_v_srcBlockExtent.width))) * __pyx_v_elementSize);

  /* "cuda/_lib/ccudart/utils.pyx":2273
 *     # Populate bloated src copy origin
 *     cd[0].srcXInBytes  = <size_t>(p[0].srcPos.x / srcBlockExtent.width) * elementSize
 *     cd[0].srcY         = <size_t>(p[0].srcPos.y / srcBlockExtent.height)             # <<<<<<<<<<<<<<
 *     cd[0].srcZ         = p[0].srcPos.z
 * 
 */
  if (unlikely(__pyx_v_srcBlockExtent.height == 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, 2273, __pyx_L1_error)
  }
  (__pyx_v_cd[0]).srcY = ((size_t)(((double)(__pyx_v_p[0]).srcPos.y) / ((double)__pyx_v_srcBlockExtent.height)));

  /* "cuda/_lib/ccudart/utils.pyx":2274
 *     cd[0].srcXInBytes  = <size_t>(p[0].srcPos.x / srcBlockExtent.width) * elementSize
 *     cd[0].srcY         = <size_t>(p[0].srcPos.y / srcBlockExtent.height)
 *     cd[0].srcZ         = p[0].srcPos.z             # <<<<<<<<<<<<<<
 * 
 *     # Populate bloated dst copy origin
 */
  __pyx_t_5 = (__pyx_v_p[0]).srcPos.z;
  (__pyx_v_cd[0]).srcZ = __pyx_t_5;

  /* "cuda/_lib/ccudart/utils.pyx":2277
 * 
 *     # Populate bloated dst copy origin
 *     cd[0].dstXInBytes  = <size_t>(p[0].dstPos.x / dstBlockExtent.width) * elementSize             # <<<<<<<<<<<<<<
 *     cd[0].dstY         = <size_t>(p[0].dstPos.y / dstBlockExtent.height)
 *     cd[0].dstZ         = p[0].dstPos.z
 */
  if (unlikely(__pyx_v_dstBlockExtent.width == 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, 2277, __pyx_L1_error)
  }
  (__pyx_v_cd[0]).dstXInBytes = (((size_t)(((double)(__pyx_v_p[0]).dstPos.x) / ((double)__pyx_v_dstBlockExtent.width))) * __pyx_v_elementSize);

  /* "cuda/_lib/ccudart/utils.pyx":2278
 *     # Populate bloated dst copy origin
 *     cd[0].dstXInBytes  = <size_t>(p[0].dstPos.x / dstBlockExtent.width) * elementSize
 *     cd[0].dstY         = <size_t>(p[0].dstPos.y / dstBlockExtent.height)             # <<<<<<<<<<<<<<
 *     cd[0].dstZ         = p[0].dstPos.z
 * 
 */
  if (unlikely(__pyx_v_dstBlockExtent.height == 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, 2278, __pyx_L1_error)
  }
  (__pyx_v_cd[0]).dstY = ((size_t)(((double)(__pyx_v_p[0]).dstPos.y) / ((double)__pyx_v_dstBlockExtent.height)));

  /* "cuda/_lib/ccudart/utils.pyx":2279
 *     cd[0].dstXInBytes  = <size_t>(p[0].dstPos.x / dstBlockExtent.width) * elementSize
 *     cd[0].dstY         = <size_t>(p[0].dstPos.y / dstBlockExtent.height)
 *     cd[0].dstZ         = p[0].dstPos.z             # <<<<<<<<<<<<<<
 * 
 *     return cudaSuccess
 */
  __pyx_t_5 = (__pyx_v_p[0]).dstPos.z;
  (__pyx_v_cd[0]).dstZ = __pyx_t_5;

  /* "cuda/_lib/ccudart/utils.pyx":2281
 *     cd[0].dstZ         = p[0].dstPos.z
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2145
 * 
 * 
 * cdef cudaError_t toDriverMemCopy3DParams(const cudaMemcpy3DParms *p, ccuda.CUDA_MEMCPY3D *cd) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     memset(cd, 0, sizeof(ccuda.CUDA_MEMCPY3D))
 *     cd[0].dstMemoryType = ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2284
 * 
 * 
 * cdef cudaError_t mallocArray(cudaArray_t *arrayPtr, const cudaChannelFormatDesc *desc,             # <<<<<<<<<<<<<<
 *         size_t depth, size_t height, size_t width, int corr2D, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if arrayPtr == NULL:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_mallocArray(cudaArray_t *__pyx_v_arrayPtr, struct cudaChannelFormatDesc const *__pyx_v_desc, size_t __pyx_v_depth, size_t __pyx_v_height, size_t __pyx_v_width, int __pyx_v_corr2D, unsigned int __pyx_v_flags) {
  CUarray __pyx_v_array;
  CUDA_ARRAY3D_DESCRIPTOR_v2 __pyx_v_ad;
  cudaError_t __pyx_v_err;
  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("mallocArray", __pyx_f[0], 2284, 1, __PYX_ERR(0, 2284, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2286
 * cdef cudaError_t mallocArray(cudaArray_t *arrayPtr, const cudaChannelFormatDesc *desc,
 *         size_t depth, size_t height, size_t width, int corr2D, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if arrayPtr == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_1 = (__pyx_v_arrayPtr == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2287
 *         size_t depth, size_t height, size_t width, int corr2D, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if arrayPtr == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUarray array = NULL
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

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

  /* "cuda/_lib/ccudart/utils.pyx":2289
 *         return cudaErrorInvalidValue
 * 
 *     cdef ccuda.CUarray array = NULL             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 ad
 *     cdef cudaError_t err = cudaSuccess
 */
  __pyx_v_array = NULL;

  /* "cuda/_lib/ccudart/utils.pyx":2291
 *     cdef ccuda.CUarray array = NULL
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 ad
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     arrayPtr[0] = NULL
 *     if (((width == 0)) or
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":2292
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 ad
 *     cdef cudaError_t err = cudaSuccess
 *     arrayPtr[0] = NULL             # <<<<<<<<<<<<<<
 *     if (((width == 0)) or
 *         ((height == 0) and (depth != 0) and not (flags & cudaArrayLayered)) or
 */
  (__pyx_v_arrayPtr[0]) = NULL;

  /* "cuda/_lib/ccudart/utils.pyx":2293
 *     cdef cudaError_t err = cudaSuccess
 *     arrayPtr[0] = NULL
 *     if (((width == 0)) or             # <<<<<<<<<<<<<<
 *         ((height == 0) and (depth != 0) and not (flags & cudaArrayLayered)) or
 *         ((flags & cudaArrayLayered) and (depth == 0)) or
 */
  __pyx_t_2 = (__pyx_v_width == 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2294
 *     arrayPtr[0] = NULL
 *     if (((width == 0)) or
 *         ((height == 0) and (depth != 0) and not (flags & cudaArrayLayered)) or             # <<<<<<<<<<<<<<
 *         ((flags & cudaArrayLayered) and (depth == 0)) or
 *         ((flags & cudaArrayCubemap) and not (flags & cudaArrayLayered) and ((width != height) or (depth != 6))) or
 */
  __pyx_t_2 = (__pyx_v_height == 0);
  if (!__pyx_t_2) {
    goto __pyx_L7_next_or;
  } else {
  }
  __pyx_t_2 = (__pyx_v_depth != 0);
  if (!__pyx_t_2) {
    goto __pyx_L7_next_or;
  } else {
  }
  __pyx_t_2 = (!((__pyx_v_flags & __pyx_e_4cuda_7ccudart_cudaArrayLayered) != 0));
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_L7_next_or:;

  /* "cuda/_lib/ccudart/utils.pyx":2295
 *     if (((width == 0)) or
 *         ((height == 0) and (depth != 0) and not (flags & cudaArrayLayered)) or
 *         ((flags & cudaArrayLayered) and (depth == 0)) or             # <<<<<<<<<<<<<<
 *         ((flags & cudaArrayCubemap) and not (flags & cudaArrayLayered) and ((width != height) or (depth != 6))) or
 *         ((flags & cudaArrayLayered) and (flags & cudaArrayCubemap) and ((width != height) or (depth % 6 != 0)))):
 */
  __pyx_t_2 = ((__pyx_v_flags & __pyx_e_4cuda_7ccudart_cudaArrayLayered) != 0);
  if (!__pyx_t_2) {
    goto __pyx_L10_next_or;
  } else {
  }
  __pyx_t_2 = (__pyx_v_depth == 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_L10_next_or:;

  /* "cuda/_lib/ccudart/utils.pyx":2296
 *         ((height == 0) and (depth != 0) and not (flags & cudaArrayLayered)) or
 *         ((flags & cudaArrayLayered) and (depth == 0)) or
 *         ((flags & cudaArrayCubemap) and not (flags & cudaArrayLayered) and ((width != height) or (depth != 6))) or             # <<<<<<<<<<<<<<
 *         ((flags & cudaArrayLayered) and (flags & cudaArrayCubemap) and ((width != height) or (depth % 6 != 0)))):
 *         return cudaErrorInvalidValue
 */
  __pyx_t_2 = ((__pyx_v_flags & __pyx_e_4cuda_7ccudart_cudaArrayCubemap) != 0);
  if (!__pyx_t_2) {
    goto __pyx_L12_next_or;
  } else {
  }
  __pyx_t_2 = (!((__pyx_v_flags & __pyx_e_4cuda_7ccudart_cudaArrayLayered) != 0));
  if (!__pyx_t_2) {
    goto __pyx_L12_next_or;
  } else {
  }
  __pyx_t_2 = (__pyx_v_width != __pyx_v_height);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_depth != 6);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_L12_next_or:;

  /* "cuda/_lib/ccudart/utils.pyx":2297
 *         ((flags & cudaArrayLayered) and (depth == 0)) or
 *         ((flags & cudaArrayCubemap) and not (flags & cudaArrayLayered) and ((width != height) or (depth != 6))) or
 *         ((flags & cudaArrayLayered) and (flags & cudaArrayCubemap) and ((width != height) or (depth % 6 != 0)))):             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 *     else:
 */
  __pyx_t_2 = ((__pyx_v_flags & __pyx_e_4cuda_7ccudart_cudaArrayLayered) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_flags & __pyx_e_4cuda_7ccudart_cudaArrayCubemap) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_width != __pyx_v_height);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_depth % 6) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":2293
 *     cdef cudaError_t err = cudaSuccess
 *     arrayPtr[0] = NULL
 *     if (((width == 0)) or             # <<<<<<<<<<<<<<
 *         ((height == 0) and (depth != 0) and not (flags & cudaArrayLayered)) or
 *         ((flags & cudaArrayLayered) and (depth == 0)) or
 */
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2298
 *         ((flags & cudaArrayCubemap) and not (flags & cudaArrayLayered) and ((width != height) or (depth != 6))) or
 *         ((flags & cudaArrayLayered) and (flags & cudaArrayCubemap) and ((width != height) or (depth % 6 != 0)))):
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     else:
 *         memset(&ad, 0, sizeof(ad))
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2293
 *     cdef cudaError_t err = cudaSuccess
 *     arrayPtr[0] = NULL
 *     if (((width == 0)) or             # <<<<<<<<<<<<<<
 *         ((height == 0) and (depth != 0) and not (flags & cudaArrayLayered)) or
 *         ((flags & cudaArrayLayered) and (depth == 0)) or
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2300
 *         return cudaErrorInvalidValue
 *     else:
 *         memset(&ad, 0, sizeof(ad))             # <<<<<<<<<<<<<<
 *         err = getDescInfo(desc, <int*>&ad.NumChannels, <ccuda.CUarray_format*>&ad.Format)
 *         if err != cudaSuccess:
 */
  /*else*/ {
    (void)(memset((&__pyx_v_ad), 0, (sizeof(__pyx_v_ad))));

    /* "cuda/_lib/ccudart/utils.pyx":2301
 *     else:
 *         memset(&ad, 0, sizeof(ad))
 *         err = getDescInfo(desc, <int*>&ad.NumChannels, <ccuda.CUarray_format*>&ad.Format)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo(__pyx_v_desc, ((int *)(&__pyx_v_ad.NumChannels)), ((CUarray_format *)(&__pyx_v_ad.Format))); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2301, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2302
 *         memset(&ad, 0, sizeof(ad))
 *         err = getDescInfo(desc, <int*>&ad.NumChannels, <ccuda.CUarray_format*>&ad.Format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         ad.Height = <unsigned int>height
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2303
 *         err = getDescInfo(desc, <int*>&ad.NumChannels, <ccuda.CUarray_format*>&ad.Format)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         ad.Height = <unsigned int>height
 *         ad.Width  = <unsigned int>width
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2302
 *         memset(&ad, 0, sizeof(ad))
 *         err = getDescInfo(desc, <int*>&ad.NumChannels, <ccuda.CUarray_format*>&ad.Format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         ad.Height = <unsigned int>height
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2304
 *         if err != cudaSuccess:
 *             return err
 *         ad.Height = <unsigned int>height             # <<<<<<<<<<<<<<
 *         ad.Width  = <unsigned int>width
 *         ad.Depth  = <unsigned int>(depth - corr2D)
 */
    __pyx_v_ad.Height = ((unsigned int)__pyx_v_height);

    /* "cuda/_lib/ccudart/utils.pyx":2305
 *             return err
 *         ad.Height = <unsigned int>height
 *         ad.Width  = <unsigned int>width             # <<<<<<<<<<<<<<
 *         ad.Depth  = <unsigned int>(depth - corr2D)
 *         ad.Flags  = flags
 */
    __pyx_v_ad.Width = ((unsigned int)__pyx_v_width);

    /* "cuda/_lib/ccudart/utils.pyx":2306
 *         ad.Height = <unsigned int>height
 *         ad.Width  = <unsigned int>width
 *         ad.Depth  = <unsigned int>(depth - corr2D)             # <<<<<<<<<<<<<<
 *         ad.Flags  = flags
 *         err = <cudaError_t>ccuda._cuArray3DCreate_v2(&array, &ad)
 */
    __pyx_v_ad.Depth = ((unsigned int)(__pyx_v_depth - __pyx_v_corr2D));

    /* "cuda/_lib/ccudart/utils.pyx":2307
 *         ad.Width  = <unsigned int>width
 *         ad.Depth  = <unsigned int>(depth - corr2D)
 *         ad.Flags  = flags             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuArray3DCreate_v2(&array, &ad)
 *         if err != cudaSuccess:
 */
    __pyx_v_ad.Flags = __pyx_v_flags;

    /* "cuda/_lib/ccudart/utils.pyx":2308
 *         ad.Depth  = <unsigned int>(depth - corr2D)
 *         ad.Flags  = flags
 *         err = <cudaError_t>ccuda._cuArray3DCreate_v2(&array, &ad)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuArray3DCreate_v2((&__pyx_v_array), (&__pyx_v_ad)); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2308, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_4);

    /* "cuda/_lib/ccudart/utils.pyx":2309
 *         ad.Flags  = flags
 *         err = <cudaError_t>ccuda._cuArray3DCreate_v2(&array, &ad)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2310
 *         err = <cudaError_t>ccuda._cuArray3DCreate_v2(&array, &ad)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *         arrayPtr[0] = <cudaArray_t>array
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2309
 *         ad.Flags  = flags
 *         err = <cudaError_t>ccuda._cuArray3DCreate_v2(&array, &ad)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2312
 *             return err
 * 
 *         arrayPtr[0] = <cudaArray_t>array             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
    (__pyx_v_arrayPtr[0]) = ((cudaArray_t)__pyx_v_array);
  }

  /* "cuda/_lib/ccudart/utils.pyx":2313
 * 
 *         arrayPtr[0] = <cudaArray_t>array
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2284
 * 
 * 
 * cdef cudaError_t mallocArray(cudaArray_t *arrayPtr, const cudaChannelFormatDesc *desc,             # <<<<<<<<<<<<<<
 *         size_t depth, size_t height, size_t width, int corr2D, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if arrayPtr == NULL:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2316
 * 
 * 
 * cdef cudaError_t memcpy2DToArray(cudaArray_t dst, size_t hOffset, size_t wOffset, const char *src,             # <<<<<<<<<<<<<<
 *                                  size_t spitch, size_t width, size_t height, cudaMemcpyKind kind,
 *                                  cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DToArray(cudaArray_t __pyx_v_dst, size_t __pyx_v_hOffset, size_t __pyx_v_wOffset, char 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_sid, bool __pyx_v_async) {
  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("memcpy2DToArray", __pyx_f[0], 2316, 1, __PYX_ERR(0, 2316, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2319
 *                                  size_t spitch, size_t width, size_t height, cudaMemcpyKind kind,
 *                                  cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if height > 1 and width > spitch:
 */
  __pyx_t_2 = (__pyx_v_width == 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_height == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2320
 *                                  cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if width == 0 or height == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     if height > 1 and width > spitch:
 *         return cudaErrorInvalidPitchValue
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2319
 *                                  size_t spitch, size_t width, size_t height, cudaMemcpyKind kind,
 *                                  cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if height > 1 and width > spitch:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2321
 *     if width == 0 or height == 0:
 *         return cudaSuccess
 *     if height > 1 and width > spitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidPitchValue
 * 
 */
  __pyx_t_2 = (__pyx_v_height > 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_width > __pyx_v_spitch);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2322
 *         return cudaSuccess
 *     if height > 1 and width > spitch:
 *         return cudaErrorInvalidPitchValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err = cudaSuccess
 */
    __pyx_r = cudaErrorInvalidPitchValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2321
 *     if width == 0 or height == 0:
 *         return cudaSuccess
 *     if height > 1 and width > spitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidPitchValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2324
 *         return cudaErrorInvalidPitchValue
 * 
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 *        err = copyFromHost2D(dst, hOffset, wOffset, src, spitch, width, height, sid, async)
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":2325
 * 
 *     cdef cudaError_t err = cudaSuccess
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToDevice:             # <<<<<<<<<<<<<<
 *        err = copyFromHost2D(dst, hOffset, wOffset, src, spitch, width, height, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 */
  switch (__pyx_v_kind) {
    case cudaMemcpyHostToDevice:

    /* "cuda/_lib/ccudart/utils.pyx":2326
 *     cdef cudaError_t err = cudaSuccess
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 *        err = copyFromHost2D(dst, hOffset, wOffset, src, spitch, width, height, sid, async)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *        err = copyFromDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, dst, hOffset, wOffset, src, 0, spitch, width, height, sid, async)
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromHost2D(__pyx_v_dst, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_src, __pyx_v_spitch, __pyx_v_width, __pyx_v_height, __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2326, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2325
 * 
 *     cdef cudaError_t err = cudaSuccess
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToDevice:             # <<<<<<<<<<<<<<
 *        err = copyFromHost2D(dst, hOffset, wOffset, src, spitch, width, height, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 */
    break;
    case cudaMemcpyDeviceToDevice:

    /* "cuda/_lib/ccudart/utils.pyx":2328
 *        err = copyFromHost2D(dst, hOffset, wOffset, src, spitch, width, height, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *        err = copyFromDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, dst, hOffset, wOffset, src, 0, spitch, width, height, sid, async)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *        err = copyFromDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, dst, hOffset, wOffset, src, 0, spitch, width, height, sid, async)
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromDevice2D(CU_MEMORYTYPE_DEVICE, __pyx_v_dst, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_src, 0, __pyx_v_spitch, __pyx_v_width, __pyx_v_height, __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2328, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2327
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 *        err = copyFromHost2D(dst, hOffset, wOffset, src, spitch, width, height, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:             # <<<<<<<<<<<<<<
 *        err = copyFromDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, dst, hOffset, wOffset, src, 0, spitch, width, height, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 */
    break;
    case cudaMemcpyDefault:

    /* "cuda/_lib/ccudart/utils.pyx":2330
 *        err = copyFromDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, dst, hOffset, wOffset, src, 0, spitch, width, height, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *        err = copyFromDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, dst, hOffset, wOffset, src, 0, spitch, width, height, sid, async)             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorInvalidMemcpyDirection
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromDevice2D(CU_MEMORYTYPE_UNIFIED, __pyx_v_dst, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_src, 0, __pyx_v_spitch, __pyx_v_width, __pyx_v_height, __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2330, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2329
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *        err = copyFromDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, dst, hOffset, wOffset, src, 0, spitch, width, height, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:             # <<<<<<<<<<<<<<
 *        err = copyFromDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, dst, hOffset, wOffset, src, 0, spitch, width, height, sid, async)
 *     else:
 */
    break;
    default:

    /* "cuda/_lib/ccudart/utils.pyx":2332
 *        err = copyFromDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, dst, hOffset, wOffset, src, 0, spitch, width, height, sid, async)
 *     else:
 *         return cudaErrorInvalidMemcpyDirection             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_r = cudaErrorInvalidMemcpyDirection;
    goto __pyx_L0;
    break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2333
 *     else:
 *         return cudaErrorInvalidMemcpyDirection
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2316
 * 
 * 
 * cdef cudaError_t memcpy2DToArray(cudaArray_t dst, size_t hOffset, size_t wOffset, const char *src,             # <<<<<<<<<<<<<<
 *                                  size_t spitch, size_t width, size_t height, cudaMemcpyKind kind,
 *                                  cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2336
 * 
 * 
 * cdef cudaError_t memcpy2DPtr(char *dst, size_t dpitch, const char *src, size_t spitch, size_t width,             # <<<<<<<<<<<<<<
 *                              size_t height, cudaMemcpyKind kind,
 *                              cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DPtr(char *__pyx_v_dst, size_t __pyx_v_dpitch, char 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_sid, bool __pyx_v_async) {
  cudaError_t __pyx_v_err;
  CUDA_MEMCPY2D_v2 __pyx_v_cp;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __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("memcpy2DPtr", __pyx_f[0], 2336, 1, __PYX_ERR(0, 2336, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2339
 *                              size_t height, cudaMemcpyKind kind,
 *                              cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if height > 1 and width > dpitch:
 */
  __pyx_t_2 = (__pyx_v_width == 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_height == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2340
 *                              cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if width == 0 or height == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     if height > 1 and width > dpitch:
 *         return cudaErrorInvalidPitchValue
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2339
 *                              size_t height, cudaMemcpyKind kind,
 *                              cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if height > 1 and width > dpitch:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2341
 *     if width == 0 or height == 0:
 *         return cudaSuccess
 *     if height > 1 and width > dpitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidPitchValue
 *     if height > 1 and width > spitch:
 */
  __pyx_t_2 = (__pyx_v_height > 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_width > __pyx_v_dpitch);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2342
 *         return cudaSuccess
 *     if height > 1 and width > dpitch:
 *         return cudaErrorInvalidPitchValue             # <<<<<<<<<<<<<<
 *     if height > 1 and width > spitch:
 *         return cudaErrorInvalidPitchValue
 */
    __pyx_r = cudaErrorInvalidPitchValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2341
 *     if width == 0 or height == 0:
 *         return cudaSuccess
 *     if height > 1 and width > dpitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidPitchValue
 *     if height > 1 and width > spitch:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2343
 *     if height > 1 and width > dpitch:
 *         return cudaErrorInvalidPitchValue
 *     if height > 1 and width > spitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidPitchValue
 * 
 */
  __pyx_t_2 = (__pyx_v_height > 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_width > __pyx_v_spitch);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L10_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2344
 *         return cudaErrorInvalidPitchValue
 *     if height > 1 and width > spitch:
 *         return cudaErrorInvalidPitchValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err = cudaSuccess
 */
    __pyx_r = cudaErrorInvalidPitchValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2343
 *     if height > 1 and width > dpitch:
 *         return cudaErrorInvalidPitchValue
 *     if height > 1 and width > spitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidPitchValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2346
 *         return cudaErrorInvalidPitchValue
 * 
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY2D_v2 cp
 *     memset(&cp, 0, sizeof(cp))
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":2348
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUDA_MEMCPY2D_v2 cp
 *     memset(&cp, 0, sizeof(cp))             # <<<<<<<<<<<<<<
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 */
  (void)(memset((&__pyx_v_cp), 0, (sizeof(__pyx_v_cp))));

  /* "cuda/_lib/ccudart/utils.pyx":2350
 *     memset(&cp, 0, sizeof(cp))
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToHost:             # <<<<<<<<<<<<<<
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)
 *         cp.dstHost = dst
 */
  switch (__pyx_v_kind) {
    case cudaMemcpyHostToHost:

    /* "cuda/_lib/ccudart/utils.pyx":2351
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)             # <<<<<<<<<<<<<<
 *         cp.dstHost = dst
 *         cp.srcHost = src
 */
    __pyx_v_cp = __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy2DInit(CU_MEMORYTYPE_HOST, CU_MEMORYTYPE_HOST);

    /* "cuda/_lib/ccudart/utils.pyx":2352
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)
 *         cp.dstHost = dst             # <<<<<<<<<<<<<<
 *         cp.srcHost = src
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 */
    __pyx_v_cp.dstHost = __pyx_v_dst;

    /* "cuda/_lib/ccudart/utils.pyx":2353
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)
 *         cp.dstHost = dst
 *         cp.srcHost = src             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE)
 */
    __pyx_v_cp.srcHost = __pyx_v_src;

    /* "cuda/_lib/ccudart/utils.pyx":2350
 *     memset(&cp, 0, sizeof(cp))
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToHost:             # <<<<<<<<<<<<<<
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)
 *         cp.dstHost = dst
 */
    break;
    case cudaMemcpyDeviceToHost:

    /* "cuda/_lib/ccudart/utils.pyx":2355
 *         cp.srcHost = src
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE)             # <<<<<<<<<<<<<<
 *         cp.dstHost = dst
 *         cp.srcDevice = <ccuda.CUdeviceptr_v2>src
 */
    __pyx_v_cp = __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy2DInit(CU_MEMORYTYPE_HOST, CU_MEMORYTYPE_DEVICE);

    /* "cuda/_lib/ccudart/utils.pyx":2356
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE)
 *         cp.dstHost = dst             # <<<<<<<<<<<<<<
 *         cp.srcDevice = <ccuda.CUdeviceptr_v2>src
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 */
    __pyx_v_cp.dstHost = __pyx_v_dst;

    /* "cuda/_lib/ccudart/utils.pyx":2357
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE)
 *         cp.dstHost = dst
 *         cp.srcDevice = <ccuda.CUdeviceptr_v2>src             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)
 */
    __pyx_v_cp.srcDevice = ((CUdeviceptr_v2)__pyx_v_src);

    /* "cuda/_lib/ccudart/utils.pyx":2354
 *         cp.dstHost = dst
 *         cp.srcHost = src
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:             # <<<<<<<<<<<<<<
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE)
 *         cp.dstHost = dst
 */
    break;
    case cudaMemcpyHostToDevice:

    /* "cuda/_lib/ccudart/utils.pyx":2359
 *         cp.srcDevice = <ccuda.CUdeviceptr_v2>src
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)             # <<<<<<<<<<<<<<
 *         cp.dstDevice = <ccuda.CUdeviceptr_v2>dst
 *         cp.srcHost = src
 */
    __pyx_v_cp = __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy2DInit(CU_MEMORYTYPE_DEVICE, CU_MEMORYTYPE_HOST);

    /* "cuda/_lib/ccudart/utils.pyx":2360
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)
 *         cp.dstDevice = <ccuda.CUdeviceptr_v2>dst             # <<<<<<<<<<<<<<
 *         cp.srcHost = src
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 */
    __pyx_v_cp.dstDevice = ((CUdeviceptr_v2)__pyx_v_dst);

    /* "cuda/_lib/ccudart/utils.pyx":2361
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)
 *         cp.dstDevice = <ccuda.CUdeviceptr_v2>dst
 *         cp.srcHost = src             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE)
 */
    __pyx_v_cp.srcHost = __pyx_v_src;

    /* "cuda/_lib/ccudart/utils.pyx":2358
 *         cp.dstHost = dst
 *         cp.srcDevice = <ccuda.CUdeviceptr_v2>src
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:             # <<<<<<<<<<<<<<
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST)
 *         cp.dstDevice = <ccuda.CUdeviceptr_v2>dst
 */
    break;
    case cudaMemcpyDeviceToDevice:

    /* "cuda/_lib/ccudart/utils.pyx":2363
 *         cp.srcHost = src
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE)             # <<<<<<<<<<<<<<
 *         cp.dstDevice = <ccuda.CUdeviceptr_v2>dst
 *         cp.srcDevice = <ccuda.CUdeviceptr_v2>src
 */
    __pyx_v_cp = __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy2DInit(CU_MEMORYTYPE_DEVICE, CU_MEMORYTYPE_DEVICE);

    /* "cuda/_lib/ccudart/utils.pyx":2364
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE)
 *         cp.dstDevice = <ccuda.CUdeviceptr_v2>dst             # <<<<<<<<<<<<<<
 *         cp.srcDevice = <ccuda.CUdeviceptr_v2>src
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 */
    __pyx_v_cp.dstDevice = ((CUdeviceptr_v2)__pyx_v_dst);

    /* "cuda/_lib/ccudart/utils.pyx":2365
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE)
 *         cp.dstDevice = <ccuda.CUdeviceptr_v2>dst
 *         cp.srcDevice = <ccuda.CUdeviceptr_v2>src             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED)
 */
    __pyx_v_cp.srcDevice = ((CUdeviceptr_v2)__pyx_v_src);

    /* "cuda/_lib/ccudart/utils.pyx":2362
 *         cp.dstDevice = <ccuda.CUdeviceptr_v2>dst
 *         cp.srcHost = src
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:             # <<<<<<<<<<<<<<
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE)
 *         cp.dstDevice = <ccuda.CUdeviceptr_v2>dst
 */
    break;
    case cudaMemcpyDefault:

    /* "cuda/_lib/ccudart/utils.pyx":2367
 *         cp.srcDevice = <ccuda.CUdeviceptr_v2>src
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED)             # <<<<<<<<<<<<<<
 *         cp.dstDevice = <ccuda.CUdeviceptr_v2>dst
 *         cp.srcDevice = <ccuda.CUdeviceptr_v2>src
 */
    __pyx_v_cp = __pyx_f_4cuda_4_lib_7ccudart_5utils_memCopy2DInit(CU_MEMORYTYPE_UNIFIED, CU_MEMORYTYPE_UNIFIED);

    /* "cuda/_lib/ccudart/utils.pyx":2368
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED)
 *         cp.dstDevice = <ccuda.CUdeviceptr_v2>dst             # <<<<<<<<<<<<<<
 *         cp.srcDevice = <ccuda.CUdeviceptr_v2>src
 *     else:
 */
    __pyx_v_cp.dstDevice = ((CUdeviceptr_v2)__pyx_v_dst);

    /* "cuda/_lib/ccudart/utils.pyx":2369
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED)
 *         cp.dstDevice = <ccuda.CUdeviceptr_v2>dst
 *         cp.srcDevice = <ccuda.CUdeviceptr_v2>src             # <<<<<<<<<<<<<<
 *     else:
 *         err = cudaErrorInvalidMemcpyDirection
 */
    __pyx_v_cp.srcDevice = ((CUdeviceptr_v2)__pyx_v_src);

    /* "cuda/_lib/ccudart/utils.pyx":2366
 *         cp.dstDevice = <ccuda.CUdeviceptr_v2>dst
 *         cp.srcDevice = <ccuda.CUdeviceptr_v2>src
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:             # <<<<<<<<<<<<<<
 *         cp = memCopy2DInit(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED)
 *         cp.dstDevice = <ccuda.CUdeviceptr_v2>dst
 */
    break;
    default:

    /* "cuda/_lib/ccudart/utils.pyx":2371
 *         cp.srcDevice = <ccuda.CUdeviceptr_v2>src
 *     else:
 *         err = cudaErrorInvalidMemcpyDirection             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
    __pyx_v_err = cudaErrorInvalidMemcpyDirection;
    break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2373
 *         err = cudaErrorInvalidMemcpyDirection
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2374
 * 
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     cp.dstPitch      = dpitch
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2373
 *         err = cudaErrorInvalidMemcpyDirection
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2376
 *         return err
 * 
 *     cp.dstPitch      = dpitch             # <<<<<<<<<<<<<<
 *     cp.srcPitch      = spitch
 *     cp.WidthInBytes  = width
 */
  __pyx_v_cp.dstPitch = __pyx_v_dpitch;

  /* "cuda/_lib/ccudart/utils.pyx":2377
 * 
 *     cp.dstPitch      = dpitch
 *     cp.srcPitch      = spitch             # <<<<<<<<<<<<<<
 *     cp.WidthInBytes  = width
 *     cp.Height        = height
 */
  __pyx_v_cp.srcPitch = __pyx_v_spitch;

  /* "cuda/_lib/ccudart/utils.pyx":2378
 *     cp.dstPitch      = dpitch
 *     cp.srcPitch      = spitch
 *     cp.WidthInBytes  = width             # <<<<<<<<<<<<<<
 *     cp.Height        = height
 * 
 */
  __pyx_v_cp.WidthInBytes = __pyx_v_width;

  /* "cuda/_lib/ccudart/utils.pyx":2379
 *     cp.srcPitch      = spitch
 *     cp.WidthInBytes  = width
 *     cp.Height        = height             # <<<<<<<<<<<<<<
 * 
 *     if async:
 */
  __pyx_v_cp.Height = __pyx_v_height;

  /* "cuda/_lib/ccudart/utils.pyx":2381
 *     cp.Height        = height
 * 
 *     if async:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuMemcpy2DAsync_v2(&cp, sid)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_async != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2382
 * 
 *     if async:
 *         err = <cudaError_t>ccuda._cuMemcpy2DAsync_v2(&cp, sid)             # <<<<<<<<<<<<<<
 *     else:
 *         err = <cudaError_t>ccuda._cuMemcpy2DUnaligned_v2(&cp)
 */
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy2DAsync_v2((&__pyx_v_cp), __pyx_v_sid); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2382, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":2381
 *     cp.Height        = height
 * 
 *     if async:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuMemcpy2DAsync_v2(&cp, sid)
 *     else:
 */
    goto __pyx_L13;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2384
 *         err = <cudaError_t>ccuda._cuMemcpy2DAsync_v2(&cp, sid)
 *     else:
 *         err = <cudaError_t>ccuda._cuMemcpy2DUnaligned_v2(&cp)             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy2DUnaligned_v2((&__pyx_v_cp)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2384, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);
  }
  __pyx_L13:;

  /* "cuda/_lib/ccudart/utils.pyx":2385
 *     else:
 *         err = <cudaError_t>ccuda._cuMemcpy2DUnaligned_v2(&cp)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2336
 * 
 * 
 * cdef cudaError_t memcpy2DPtr(char *dst, size_t dpitch, const char *src, size_t spitch, size_t width,             # <<<<<<<<<<<<<<
 *                              size_t height, cudaMemcpyKind kind,
 *                              cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2388
 * 
 * 
 * cdef cudaError_t memcpyDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if size == 0:
 *         return cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyDispatch(void *__pyx_v_dst, void const *__pyx_v_src, size_t __pyx_v_size, enum cudaMemcpyKind __pyx_v_kind) {
  CYTHON_UNUSED 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("memcpyDispatch", __pyx_f[0], 2388, 1, __PYX_ERR(0, 2388, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2389
 * 
 * cdef cudaError_t memcpyDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  __pyx_t_1 = (__pyx_v_size == 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2390
 * cdef cudaError_t memcpyDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if size == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err = cudaSuccess
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2389
 * 
 * cdef cudaError_t memcpyDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2392
 *         return cudaSuccess
 * 
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 *         return memcpy2DPtr(<char*>dst, size, <const char*>src, size, size, 1, kind, NULL, 0)
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":2393
 * 
 *     cdef cudaError_t err = cudaSuccess
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToHost:             # <<<<<<<<<<<<<<
 *         return memcpy2DPtr(<char*>dst, size, <const char*>src, size, size, 1, kind, NULL, 0)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 */
  switch (__pyx_v_kind) {
    case cudaMemcpyHostToHost:

    /* "cuda/_lib/ccudart/utils.pyx":2394
 *     cdef cudaError_t err = cudaSuccess
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 *         return memcpy2DPtr(<char*>dst, size, <const char*>src, size, size, 1, kind, NULL, 0)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         err = <cudaError_t>ccuda._cuMemcpyDtoH_v2(dst, <ccuda.CUdeviceptr_v2>src, size)
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DPtr(((char *)__pyx_v_dst), __pyx_v_size, ((char const *)__pyx_v_src), __pyx_v_size, __pyx_v_size, 1, __pyx_v_kind, NULL, 0); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2394, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2393
 * 
 *     cdef cudaError_t err = cudaSuccess
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToHost:             # <<<<<<<<<<<<<<
 *         return memcpy2DPtr(<char*>dst, size, <const char*>src, size, size, 1, kind, NULL, 0)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 */
    break;
    case cudaMemcpyDeviceToHost:

    /* "cuda/_lib/ccudart/utils.pyx":2396
 *         return memcpy2DPtr(<char*>dst, size, <const char*>src, size, size, 1, kind, NULL, 0)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         err = <cudaError_t>ccuda._cuMemcpyDtoH_v2(dst, <ccuda.CUdeviceptr_v2>src, size)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 *         err = <cudaError_t>ccuda._cuMemcpyHtoD_v2(<ccuda.CUdeviceptr_v2>dst, src, size)
 */
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyDtoH_v2(__pyx_v_dst, ((CUdeviceptr_v2)__pyx_v_src), __pyx_v_size); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2396, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":2395
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 *         return memcpy2DPtr(<char*>dst, size, <const char*>src, size, size, 1, kind, NULL, 0)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuMemcpyDtoH_v2(dst, <ccuda.CUdeviceptr_v2>src, size)
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 */
    break;
    case cudaMemcpyHostToDevice:

    /* "cuda/_lib/ccudart/utils.pyx":2398
 *         err = <cudaError_t>ccuda._cuMemcpyDtoH_v2(dst, <ccuda.CUdeviceptr_v2>src, size)
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 *         err = <cudaError_t>ccuda._cuMemcpyHtoD_v2(<ccuda.CUdeviceptr_v2>dst, src, size)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         err = <cudaError_t>ccuda._cuMemcpyDtoD_v2(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size)
 */
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyHtoD_v2(((CUdeviceptr_v2)__pyx_v_dst), __pyx_v_src, __pyx_v_size); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2398, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":2397
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         err = <cudaError_t>ccuda._cuMemcpyDtoH_v2(dst, <ccuda.CUdeviceptr_v2>src, size)
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuMemcpyHtoD_v2(<ccuda.CUdeviceptr_v2>dst, src, size)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 */
    break;
    case cudaMemcpyDeviceToDevice:

    /* "cuda/_lib/ccudart/utils.pyx":2400
 *         err = <cudaError_t>ccuda._cuMemcpyHtoD_v2(<ccuda.CUdeviceptr_v2>dst, src, size)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         err = <cudaError_t>ccuda._cuMemcpyDtoD_v2(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         err = <cudaError_t>ccuda._cuMemcpy(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size)
 */
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyDtoD_v2(((CUdeviceptr_v2)__pyx_v_dst), ((CUdeviceptr_v2)__pyx_v_src), __pyx_v_size); 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/utils.pyx":2399
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 *         err = <cudaError_t>ccuda._cuMemcpyHtoD_v2(<ccuda.CUdeviceptr_v2>dst, src, size)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuMemcpyDtoD_v2(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 */
    break;
    case cudaMemcpyDefault:

    /* "cuda/_lib/ccudart/utils.pyx":2402
 *         err = <cudaError_t>ccuda._cuMemcpyDtoD_v2(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         err = <cudaError_t>ccuda._cuMemcpy(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size)             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorInvalidMemcpyDirection
 */
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy(((CUdeviceptr_v2)__pyx_v_dst), ((CUdeviceptr_v2)__pyx_v_src), __pyx_v_size); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2402, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":2401
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         err = <cudaError_t>ccuda._cuMemcpyDtoD_v2(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuMemcpy(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size)
 *     else:
 */
    break;
    default:

    /* "cuda/_lib/ccudart/utils.pyx":2404
 *         err = <cudaError_t>ccuda._cuMemcpy(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size)
 *     else:
 *         return cudaErrorInvalidMemcpyDirection             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = cudaErrorInvalidMemcpyDirection;
    goto __pyx_L0;
    break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2388
 * 
 * 
 * cdef cudaError_t memcpyDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if size == 0:
 *         return cudaSuccess
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2407
 * 
 * 
 * cdef cudaError_t mallocHost(size_t size, void **mem, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if size == 0:
 *         if mem == NULL:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_mallocHost(size_t __pyx_v_size, void **__pyx_v_mem, unsigned int __pyx_v_flags) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  CUresult __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("mallocHost", __pyx_f[0], 2407, 1, __PYX_ERR(0, 2407, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2408
 * 
 * cdef cudaError_t mallocHost(size_t size, void **mem, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         if mem == NULL:
 *             return cudaErrorInvalidValue
 */
  __pyx_t_1 = (__pyx_v_size == 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2409
 * cdef cudaError_t mallocHost(size_t size, void **mem, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if size == 0:
 *         if mem == NULL:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         mem[0] = NULL
 */
    __pyx_t_1 = (__pyx_v_mem == NULL);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2410
 *     if size == 0:
 *         if mem == NULL:
 *             return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *         mem[0] = NULL
 *         return cudaSuccess
 */
      __pyx_r = cudaErrorInvalidValue;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2409
 * cdef cudaError_t mallocHost(size_t size, void **mem, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if size == 0:
 *         if mem == NULL:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         mem[0] = NULL
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2411
 *         if mem == NULL:
 *             return cudaErrorInvalidValue
 *         mem[0] = NULL             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     else:
 */
    (__pyx_v_mem[0]) = NULL;

    /* "cuda/_lib/ccudart/utils.pyx":2412
 *             return cudaErrorInvalidValue
 *         mem[0] = NULL
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     else:
 *         return <cudaError_t>ccuda._cuMemHostAlloc(mem, size, flags)
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2408
 * 
 * cdef cudaError_t mallocHost(size_t size, void **mem, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         if mem == NULL:
 *             return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2414
 *         return cudaSuccess
 *     else:
 *         return <cudaError_t>ccuda._cuMemHostAlloc(mem, size, flags)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemHostAlloc(__pyx_v_mem, __pyx_v_size, __pyx_v_flags); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2414, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_2);
    goto __pyx_L0;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2407
 * 
 * 
 * cdef cudaError_t mallocHost(size_t size, void **mem, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if size == 0:
 *         if mem == NULL:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2417
 * 
 * 
 * cdef cudaError_t mallocPitch(size_t width, size_t height, size_t depth, void **mem, size_t *pitch) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     height *= depth
 * 
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_mallocPitch(size_t __pyx_v_width, size_t __pyx_v_height, size_t __pyx_v_depth, void **__pyx_v_mem, size_t *__pyx_v_pitch) {
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __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("mallocPitch", __pyx_f[0], 2417, 1, __PYX_ERR(0, 2417, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2418
 * 
 * cdef cudaError_t mallocPitch(size_t width, size_t height, size_t depth, void **mem, size_t *pitch) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     height *= depth             # <<<<<<<<<<<<<<
 * 
 *     if width == 0 or height == 0:
 */
  __pyx_v_height = (__pyx_v_height * __pyx_v_depth);

  /* "cuda/_lib/ccudart/utils.pyx":2420
 *     height *= depth
 * 
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         if mem == NULL or pitch == NULL:
 *             return cudaErrorInvalidValue
 */
  __pyx_t_2 = (__pyx_v_width == 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_height == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2421
 * 
 *     if width == 0 or height == 0:
 *         if mem == NULL or pitch == NULL:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         mem[0]   = NULL
 */
    __pyx_t_2 = (__pyx_v_mem == NULL);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_pitch == NULL);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2422
 *     if width == 0 or height == 0:
 *         if mem == NULL or pitch == NULL:
 *             return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *         mem[0]   = NULL
 *         pitch[0] = 0
 */
      __pyx_r = cudaErrorInvalidValue;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2421
 * 
 *     if width == 0 or height == 0:
 *         if mem == NULL or pitch == NULL:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         mem[0]   = NULL
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2423
 *         if mem == NULL or pitch == NULL:
 *             return cudaErrorInvalidValue
 *         mem[0]   = NULL             # <<<<<<<<<<<<<<
 *         pitch[0] = 0
 *     else:
 */
    (__pyx_v_mem[0]) = NULL;

    /* "cuda/_lib/ccudart/utils.pyx":2424
 *             return cudaErrorInvalidValue
 *         mem[0]   = NULL
 *         pitch[0] = 0             # <<<<<<<<<<<<<<
 *     else:
 *         return <cudaError_t>ccuda._cuMemAllocPitch_v2(<ccuda.CUdeviceptr_v2*>mem, pitch, width, height, 4)
 */
    (__pyx_v_pitch[0]) = 0;

    /* "cuda/_lib/ccudart/utils.pyx":2420
 *     height *= depth
 * 
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         if mem == NULL or pitch == NULL:
 *             return cudaErrorInvalidValue
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2426
 *         pitch[0] = 0
 *     else:
 *         return <cudaError_t>ccuda._cuMemAllocPitch_v2(<ccuda.CUdeviceptr_v2*>mem, pitch, width, height, 4)             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemAllocPitch_v2(((CUdeviceptr_v2 *)__pyx_v_mem), __pyx_v_pitch, __pyx_v_width, __pyx_v_height, 4); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2426, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_3);
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "cuda/_lib/ccudart/utils.pyx":2427
 *     else:
 *         return <cudaError_t>ccuda._cuMemAllocPitch_v2(<ccuda.CUdeviceptr_v2*>mem, pitch, width, height, 4)
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2417
 * 
 * 
 * cdef cudaError_t mallocPitch(size_t width, size_t height, size_t depth, void **mem, size_t *pitch) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     height *= depth
 * 
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2430
 * 
 * 
 * cdef cudaError_t mallocMipmappedArray(cudaMipmappedArray_t *mipmappedArray, const cudaChannelFormatDesc *desc,             # <<<<<<<<<<<<<<
 *                                       size_t depth, size_t height, size_t width, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if mipmappedArray == NULL:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_mallocMipmappedArray(cudaMipmappedArray_t *__pyx_v_mipmappedArray, struct cudaChannelFormatDesc const *__pyx_v_desc, size_t __pyx_v_depth, size_t __pyx_v_height, size_t __pyx_v_width, unsigned int __pyx_v_numLevels, unsigned int __pyx_v_flags) {
  CUmipmappedArray __pyx_v_mipmap;
  CUDA_ARRAY3D_DESCRIPTOR_v2 __pyx_v_ad;
  cudaError_t __pyx_v_err;
  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("mallocMipmappedArray", __pyx_f[0], 2430, 1, __PYX_ERR(0, 2430, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2432
 * cdef cudaError_t mallocMipmappedArray(cudaMipmappedArray_t *mipmappedArray, const cudaChannelFormatDesc *desc,
 *                                       size_t depth, size_t height, size_t width, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if mipmappedArray == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_1 = (__pyx_v_mipmappedArray == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2433
 *                                       size_t depth, size_t height, size_t width, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if mipmappedArray == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUmipmappedArray mipmap = NULL
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2432
 * cdef cudaError_t mallocMipmappedArray(cudaMipmappedArray_t *mipmappedArray, const cudaChannelFormatDesc *desc,
 *                                       size_t depth, size_t height, size_t width, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if mipmappedArray == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2435
 *         return cudaErrorInvalidValue
 * 
 *     cdef ccuda.CUmipmappedArray mipmap = NULL             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 ad
 *     memset(&ad, 0, sizeof(ad))
 */
  __pyx_v_mipmap = NULL;

  /* "cuda/_lib/ccudart/utils.pyx":2437
 *     cdef ccuda.CUmipmappedArray mipmap = NULL
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 ad
 *     memset(&ad, 0, sizeof(ad))             # <<<<<<<<<<<<<<
 * 
 *     mipmappedArray[0] = NULL
 */
  (void)(memset((&__pyx_v_ad), 0, (sizeof(__pyx_v_ad))));

  /* "cuda/_lib/ccudart/utils.pyx":2439
 *     memset(&ad, 0, sizeof(ad))
 * 
 *     mipmappedArray[0] = NULL             # <<<<<<<<<<<<<<
 *     if (((width == 0)) or
 *         ((height == 0) and (depth != 0) and not (flags & cudaArrayLayered)) or
 */
  (__pyx_v_mipmappedArray[0]) = NULL;

  /* "cuda/_lib/ccudart/utils.pyx":2440
 * 
 *     mipmappedArray[0] = NULL
 *     if (((width == 0)) or             # <<<<<<<<<<<<<<
 *         ((height == 0) and (depth != 0) and not (flags & cudaArrayLayered)) or
 *         ((flags & cudaArrayLayered) and (depth == 0)) or
 */
  __pyx_t_2 = (__pyx_v_width == 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2441
 *     mipmappedArray[0] = NULL
 *     if (((width == 0)) or
 *         ((height == 0) and (depth != 0) and not (flags & cudaArrayLayered)) or             # <<<<<<<<<<<<<<
 *         ((flags & cudaArrayLayered) and (depth == 0)) or
 *         ((flags & cudaArrayCubemap) and not (flags & cudaArrayLayered) and ((width != height) or (depth != 6))) or
 */
  __pyx_t_2 = (__pyx_v_height == 0);
  if (!__pyx_t_2) {
    goto __pyx_L7_next_or;
  } else {
  }
  __pyx_t_2 = (__pyx_v_depth != 0);
  if (!__pyx_t_2) {
    goto __pyx_L7_next_or;
  } else {
  }
  __pyx_t_2 = (!((__pyx_v_flags & __pyx_e_4cuda_7ccudart_cudaArrayLayered) != 0));
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_L7_next_or:;

  /* "cuda/_lib/ccudart/utils.pyx":2442
 *     if (((width == 0)) or
 *         ((height == 0) and (depth != 0) and not (flags & cudaArrayLayered)) or
 *         ((flags & cudaArrayLayered) and (depth == 0)) or             # <<<<<<<<<<<<<<
 *         ((flags & cudaArrayCubemap) and not (flags & cudaArrayLayered) and ((width != height) or (depth != 6))) or
 *         ((flags & cudaArrayLayered) and (flags & cudaArrayCubemap) and ((width != height) or (depth % 6 != 0)))):
 */
  __pyx_t_2 = ((__pyx_v_flags & __pyx_e_4cuda_7ccudart_cudaArrayLayered) != 0);
  if (!__pyx_t_2) {
    goto __pyx_L10_next_or;
  } else {
  }
  __pyx_t_2 = (__pyx_v_depth == 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_L10_next_or:;

  /* "cuda/_lib/ccudart/utils.pyx":2443
 *         ((height == 0) and (depth != 0) and not (flags & cudaArrayLayered)) or
 *         ((flags & cudaArrayLayered) and (depth == 0)) or
 *         ((flags & cudaArrayCubemap) and not (flags & cudaArrayLayered) and ((width != height) or (depth != 6))) or             # <<<<<<<<<<<<<<
 *         ((flags & cudaArrayLayered) and (flags & cudaArrayCubemap) and ((width != height) or (depth % 6 != 0)))):
 *         return cudaErrorInvalidValue
 */
  __pyx_t_2 = ((__pyx_v_flags & __pyx_e_4cuda_7ccudart_cudaArrayCubemap) != 0);
  if (!__pyx_t_2) {
    goto __pyx_L12_next_or;
  } else {
  }
  __pyx_t_2 = (!((__pyx_v_flags & __pyx_e_4cuda_7ccudart_cudaArrayLayered) != 0));
  if (!__pyx_t_2) {
    goto __pyx_L12_next_or;
  } else {
  }
  __pyx_t_2 = (__pyx_v_width != __pyx_v_height);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_depth != 6);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_L12_next_or:;

  /* "cuda/_lib/ccudart/utils.pyx":2444
 *         ((flags & cudaArrayLayered) and (depth == 0)) or
 *         ((flags & cudaArrayCubemap) and not (flags & cudaArrayLayered) and ((width != height) or (depth != 6))) or
 *         ((flags & cudaArrayLayered) and (flags & cudaArrayCubemap) and ((width != height) or (depth % 6 != 0)))):             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 *     else:
 */
  __pyx_t_2 = ((__pyx_v_flags & __pyx_e_4cuda_7ccudart_cudaArrayLayered) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_flags & __pyx_e_4cuda_7ccudart_cudaArrayCubemap) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_width != __pyx_v_height);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_depth % 6) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":2440
 * 
 *     mipmappedArray[0] = NULL
 *     if (((width == 0)) or             # <<<<<<<<<<<<<<
 *         ((height == 0) and (depth != 0) and not (flags & cudaArrayLayered)) or
 *         ((flags & cudaArrayLayered) and (depth == 0)) or
 */
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2445
 *         ((flags & cudaArrayCubemap) and not (flags & cudaArrayLayered) and ((width != height) or (depth != 6))) or
 *         ((flags & cudaArrayLayered) and (flags & cudaArrayCubemap) and ((width != height) or (depth % 6 != 0)))):
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     else:
 *         err = getDescInfo(desc, <int*>&ad.NumChannels, &ad.Format)
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2440
 * 
 *     mipmappedArray[0] = NULL
 *     if (((width == 0)) or             # <<<<<<<<<<<<<<
 *         ((height == 0) and (depth != 0) and not (flags & cudaArrayLayered)) or
 *         ((flags & cudaArrayLayered) and (depth == 0)) or
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2447
 *         return cudaErrorInvalidValue
 *     else:
 *         err = getDescInfo(desc, <int*>&ad.NumChannels, &ad.Format)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo(__pyx_v_desc, ((int *)(&__pyx_v_ad.NumChannels)), (&__pyx_v_ad.Format)); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2447, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2448
 *     else:
 *         err = getDescInfo(desc, <int*>&ad.NumChannels, &ad.Format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         ad.Height = <unsigned int>height
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2449
 *         err = getDescInfo(desc, <int*>&ad.NumChannels, &ad.Format)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         ad.Height = <unsigned int>height
 *         ad.Width  = <unsigned int>width
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2448
 *     else:
 *         err = getDescInfo(desc, <int*>&ad.NumChannels, &ad.Format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         ad.Height = <unsigned int>height
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2450
 *         if err != cudaSuccess:
 *             return err
 *         ad.Height = <unsigned int>height             # <<<<<<<<<<<<<<
 *         ad.Width  = <unsigned int>width
 *         ad.Depth  = <unsigned int>depth
 */
    __pyx_v_ad.Height = ((unsigned int)__pyx_v_height);

    /* "cuda/_lib/ccudart/utils.pyx":2451
 *             return err
 *         ad.Height = <unsigned int>height
 *         ad.Width  = <unsigned int>width             # <<<<<<<<<<<<<<
 *         ad.Depth  = <unsigned int>depth
 *         ad.Flags  = flags
 */
    __pyx_v_ad.Width = ((unsigned int)__pyx_v_width);

    /* "cuda/_lib/ccudart/utils.pyx":2452
 *         ad.Height = <unsigned int>height
 *         ad.Width  = <unsigned int>width
 *         ad.Depth  = <unsigned int>depth             # <<<<<<<<<<<<<<
 *         ad.Flags  = flags
 *         err = <cudaError_t>ccuda._cuMipmappedArrayCreate(&mipmap, &ad, numLevels)
 */
    __pyx_v_ad.Depth = ((unsigned int)__pyx_v_depth);

    /* "cuda/_lib/ccudart/utils.pyx":2453
 *         ad.Width  = <unsigned int>width
 *         ad.Depth  = <unsigned int>depth
 *         ad.Flags  = flags             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuMipmappedArrayCreate(&mipmap, &ad, numLevels)
 *         if err != cudaSuccess:
 */
    __pyx_v_ad.Flags = __pyx_v_flags;

    /* "cuda/_lib/ccudart/utils.pyx":2454
 *         ad.Depth  = <unsigned int>depth
 *         ad.Flags  = flags
 *         err = <cudaError_t>ccuda._cuMipmappedArrayCreate(&mipmap, &ad, numLevels)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_4 = __pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayCreate((&__pyx_v_mipmap), (&__pyx_v_ad), __pyx_v_numLevels); if (unlikely(__pyx_t_4 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2454, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_4);

    /* "cuda/_lib/ccudart/utils.pyx":2455
 *         ad.Flags  = flags
 *         err = <cudaError_t>ccuda._cuMipmappedArrayCreate(&mipmap, &ad, numLevels)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         mipmappedArray[0] = <cudaMipmappedArray_t>mipmap
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2456
 *         err = <cudaError_t>ccuda._cuMipmappedArrayCreate(&mipmap, &ad, numLevels)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         mipmappedArray[0] = <cudaMipmappedArray_t>mipmap
 *     return cudaSuccess
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2455
 *         ad.Flags  = flags
 *         err = <cudaError_t>ccuda._cuMipmappedArrayCreate(&mipmap, &ad, numLevels)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         mipmappedArray[0] = <cudaMipmappedArray_t>mipmap
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2457
 *         if err != cudaSuccess:
 *             return err
 *         mipmappedArray[0] = <cudaMipmappedArray_t>mipmap             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
    (__pyx_v_mipmappedArray[0]) = ((cudaMipmappedArray_t)__pyx_v_mipmap);
  }

  /* "cuda/_lib/ccudart/utils.pyx":2458
 *             return err
 *         mipmappedArray[0] = <cudaMipmappedArray_t>mipmap
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2430
 * 
 * 
 * cdef cudaError_t mallocMipmappedArray(cudaMipmappedArray_t *mipmappedArray, const cudaChannelFormatDesc *desc,             # <<<<<<<<<<<<<<
 *                                       size_t depth, size_t height, size_t width, unsigned int numLevels, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if mipmappedArray == NULL:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2461
 * 
 * 
 * cdef cudaError_t memcpyAsyncDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if size == 0:
 *         return cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyAsyncDispatch(void *__pyx_v_dst, void const *__pyx_v_src, size_t __pyx_v_size, enum cudaMemcpyKind __pyx_v_kind, cudaStream_t __pyx_v_stream) {
  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("memcpyAsyncDispatch", __pyx_f[0], 2461, 1, __PYX_ERR(0, 2461, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2462
 * 
 * cdef cudaError_t memcpyAsyncDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 */
  __pyx_t_1 = (__pyx_v_size == 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2463
 * cdef cudaError_t memcpyAsyncDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if size == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 *         return memcpy2DPtr(<char*>dst, size, <const char*>src, size, size, 1, kind, stream, True)
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2462
 * 
 * cdef cudaError_t memcpyAsyncDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2464
 *     if size == 0:
 *         return cudaSuccess
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost:             # <<<<<<<<<<<<<<
 *         return memcpy2DPtr(<char*>dst, size, <const char*>src, size, size, 1, kind, stream, True)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 */
  __pyx_t_1 = (__pyx_v_kind == cudaMemcpyHostToHost);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2465
 *         return cudaSuccess
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 *         return memcpy2DPtr(<char*>dst, size, <const char*>src, size, size, 1, kind, stream, True)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         return <cudaError_t>ccuda._cuMemcpyDtoHAsync_v2(dst, <ccuda.CUdeviceptr_v2>src, size, stream)
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DPtr(((char *)__pyx_v_dst), __pyx_v_size, ((char const *)__pyx_v_src), __pyx_v_size, __pyx_v_size, 1, __pyx_v_kind, __pyx_v_stream, 1); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2465, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2464
 *     if size == 0:
 *         return cudaSuccess
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost:             # <<<<<<<<<<<<<<
 *         return memcpy2DPtr(<char*>dst, size, <const char*>src, size, size, 1, kind, stream, True)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2466
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 *         return memcpy2DPtr(<char*>dst, size, <const char*>src, size, size, 1, kind, stream, True)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:             # <<<<<<<<<<<<<<
 *         return <cudaError_t>ccuda._cuMemcpyDtoHAsync_v2(dst, <ccuda.CUdeviceptr_v2>src, size, stream)
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 */
  __pyx_t_1 = (__pyx_v_kind == cudaMemcpyDeviceToHost);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2467
 *         return memcpy2DPtr(<char*>dst, size, <const char*>src, size, size, 1, kind, stream, True)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         return <cudaError_t>ccuda._cuMemcpyDtoHAsync_v2(dst, <ccuda.CUdeviceptr_v2>src, size, stream)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 *         return<cudaError_t>ccuda._cuMemcpyHtoDAsync_v2(<ccuda.CUdeviceptr_v2>dst, src, size, stream)
 */
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyDtoHAsync_v2(__pyx_v_dst, ((CUdeviceptr_v2)__pyx_v_src), __pyx_v_size, __pyx_v_stream); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2467, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_3);
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2466
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 *         return memcpy2DPtr(<char*>dst, size, <const char*>src, size, size, 1, kind, stream, True)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:             # <<<<<<<<<<<<<<
 *         return <cudaError_t>ccuda._cuMemcpyDtoHAsync_v2(dst, <ccuda.CUdeviceptr_v2>src, size, stream)
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2468
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         return <cudaError_t>ccuda._cuMemcpyDtoHAsync_v2(dst, <ccuda.CUdeviceptr_v2>src, size, stream)
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:             # <<<<<<<<<<<<<<
 *         return<cudaError_t>ccuda._cuMemcpyHtoDAsync_v2(<ccuda.CUdeviceptr_v2>dst, src, size, stream)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 */
  __pyx_t_1 = (__pyx_v_kind == cudaMemcpyHostToDevice);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2469
 *         return <cudaError_t>ccuda._cuMemcpyDtoHAsync_v2(dst, <ccuda.CUdeviceptr_v2>src, size, stream)
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 *         return<cudaError_t>ccuda._cuMemcpyHtoDAsync_v2(<ccuda.CUdeviceptr_v2>dst, src, size, stream)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         return<cudaError_t>ccuda._cuMemcpyDtoDAsync_v2(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size, stream)
 */
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyHtoDAsync_v2(((CUdeviceptr_v2)__pyx_v_dst), __pyx_v_src, __pyx_v_size, __pyx_v_stream); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2469, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_3);
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2468
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         return <cudaError_t>ccuda._cuMemcpyDtoHAsync_v2(dst, <ccuda.CUdeviceptr_v2>src, size, stream)
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:             # <<<<<<<<<<<<<<
 *         return<cudaError_t>ccuda._cuMemcpyHtoDAsync_v2(<ccuda.CUdeviceptr_v2>dst, src, size, stream)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2470
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 *         return<cudaError_t>ccuda._cuMemcpyHtoDAsync_v2(<ccuda.CUdeviceptr_v2>dst, src, size, stream)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:             # <<<<<<<<<<<<<<
 *         return<cudaError_t>ccuda._cuMemcpyDtoDAsync_v2(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size, stream)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 */
  __pyx_t_1 = (__pyx_v_kind == cudaMemcpyDeviceToDevice);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2471
 *         return<cudaError_t>ccuda._cuMemcpyHtoDAsync_v2(<ccuda.CUdeviceptr_v2>dst, src, size, stream)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         return<cudaError_t>ccuda._cuMemcpyDtoDAsync_v2(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size, stream)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         return<cudaError_t>ccuda._cuMemcpyAsync(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size, stream)
 */
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyDtoDAsync_v2(((CUdeviceptr_v2)__pyx_v_dst), ((CUdeviceptr_v2)__pyx_v_src), __pyx_v_size, __pyx_v_stream); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2471, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_3);
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2470
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 *         return<cudaError_t>ccuda._cuMemcpyHtoDAsync_v2(<ccuda.CUdeviceptr_v2>dst, src, size, stream)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:             # <<<<<<<<<<<<<<
 *         return<cudaError_t>ccuda._cuMemcpyDtoDAsync_v2(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size, stream)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2472
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         return<cudaError_t>ccuda._cuMemcpyDtoDAsync_v2(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size, stream)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:             # <<<<<<<<<<<<<<
 *         return<cudaError_t>ccuda._cuMemcpyAsync(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size, stream)
 *     return cudaErrorInvalidMemcpyDirection
 */
  __pyx_t_1 = (__pyx_v_kind == cudaMemcpyDefault);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2473
 *         return<cudaError_t>ccuda._cuMemcpyDtoDAsync_v2(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size, stream)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         return<cudaError_t>ccuda._cuMemcpyAsync(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size, stream)             # <<<<<<<<<<<<<<
 *     return cudaErrorInvalidMemcpyDirection
 * 
 */
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyAsync(((CUdeviceptr_v2)__pyx_v_dst), ((CUdeviceptr_v2)__pyx_v_src), __pyx_v_size, __pyx_v_stream); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2473, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_3);
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2472
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         return<cudaError_t>ccuda._cuMemcpyDtoDAsync_v2(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size, stream)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:             # <<<<<<<<<<<<<<
 *         return<cudaError_t>ccuda._cuMemcpyAsync(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size, stream)
 *     return cudaErrorInvalidMemcpyDirection
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2474
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         return<cudaError_t>ccuda._cuMemcpyAsync(<ccuda.CUdeviceptr_v2>dst, <ccuda.CUdeviceptr_v2>src, size, stream)
 *     return cudaErrorInvalidMemcpyDirection             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaErrorInvalidMemcpyDirection;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2461
 * 
 * 
 * cdef cudaError_t memcpyAsyncDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if size == 0:
 *         return cudaSuccess
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2477
 * 
 * 
 * cdef cudaError_t toCudartMemCopy3DParams(const ccuda.CUDA_MEMCPY3D_v2 *cd, cudaMemcpy3DParms *p) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaExtent srcBlockExtent
 *     cdef cudaExtent dstBlockExtent
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_toCudartMemCopy3DParams(CUDA_MEMCPY3D_v2 const *__pyx_v_cd, struct cudaMemcpy3DParms *__pyx_v_p) {
  struct cudaExtent __pyx_v_srcBlockExtent;
  struct cudaExtent __pyx_v_dstBlockExtent;
  struct cudaExtent __pyx_v_copyBlockExtent;
  CUarray_format __pyx_v_srcFmt;
  CUarray_format __pyx_v_dstFmt;
  int __pyx_v_numChannels;
  size_t __pyx_v_srcElementSize;
  size_t __pyx_v_dstElementSize;
  cudaError_t __pyx_v_err;
  size_t __pyx_v_elementSize;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  size_t __pyx_t_3;
  void *__pyx_t_4;
  cudaError_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("toCudartMemCopy3DParams", __pyx_f[0], 2477, 1, __PYX_ERR(0, 2477, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2483
 *     cdef ccuda.CUarray_format srcFmt
 *     cdef ccuda.CUarray_format dstFmt
 *     cdef int numChannels = 0             # <<<<<<<<<<<<<<
 *     srcBlockExtent.width = srcBlockExtent.height = srcBlockExtent.depth = 1
 *     dstBlockExtent.width = dstBlockExtent.height = dstBlockExtent.depth = 1
 */
  __pyx_v_numChannels = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2484
 *     cdef ccuda.CUarray_format dstFmt
 *     cdef int numChannels = 0
 *     srcBlockExtent.width = srcBlockExtent.height = srcBlockExtent.depth = 1             # <<<<<<<<<<<<<<
 *     dstBlockExtent.width = dstBlockExtent.height = dstBlockExtent.depth = 1
 *     copyBlockExtent.width = copyBlockExtent.height = copyBlockExtent.depth = 1
 */
  __pyx_v_srcBlockExtent.width = 1;
  __pyx_v_srcBlockExtent.height = 1;
  __pyx_v_srcBlockExtent.depth = 1;

  /* "cuda/_lib/ccudart/utils.pyx":2485
 *     cdef int numChannels = 0
 *     srcBlockExtent.width = srcBlockExtent.height = srcBlockExtent.depth = 1
 *     dstBlockExtent.width = dstBlockExtent.height = dstBlockExtent.depth = 1             # <<<<<<<<<<<<<<
 *     copyBlockExtent.width = copyBlockExtent.height = copyBlockExtent.depth = 1
 * 
 */
  __pyx_v_dstBlockExtent.width = 1;
  __pyx_v_dstBlockExtent.height = 1;
  __pyx_v_dstBlockExtent.depth = 1;

  /* "cuda/_lib/ccudart/utils.pyx":2486
 *     srcBlockExtent.width = srcBlockExtent.height = srcBlockExtent.depth = 1
 *     dstBlockExtent.width = dstBlockExtent.height = dstBlockExtent.depth = 1
 *     copyBlockExtent.width = copyBlockExtent.height = copyBlockExtent.depth = 1             # <<<<<<<<<<<<<<
 * 
 *     memset(p, 0, sizeof(cudaMemcpy3DParms))
 */
  __pyx_v_copyBlockExtent.width = 1;
  __pyx_v_copyBlockExtent.height = 1;
  __pyx_v_copyBlockExtent.depth = 1;

  /* "cuda/_lib/ccudart/utils.pyx":2488
 *     copyBlockExtent.width = copyBlockExtent.height = copyBlockExtent.depth = 1
 * 
 *     memset(p, 0, sizeof(cudaMemcpy3DParms))             # <<<<<<<<<<<<<<
 *     p[0].srcPtr.xsize = 0
 *     p[0].dstPtr.xsize = 0
 */
  (void)(memset(__pyx_v_p, 0, (sizeof(struct cudaMemcpy3DParms))));

  /* "cuda/_lib/ccudart/utils.pyx":2489
 * 
 *     memset(p, 0, sizeof(cudaMemcpy3DParms))
 *     p[0].srcPtr.xsize = 0             # <<<<<<<<<<<<<<
 *     p[0].dstPtr.xsize = 0
 * 
 */
  (__pyx_v_p[0]).srcPtr.xsize = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2490
 *     memset(p, 0, sizeof(cudaMemcpy3DParms))
 *     p[0].srcPtr.xsize = 0
 *     p[0].dstPtr.xsize = 0             # <<<<<<<<<<<<<<
 * 
 *     if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST):
 */
  (__pyx_v_p[0]).dstPtr.xsize = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2492
 *     p[0].dstPtr.xsize = 0
 * 
 *     if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST):             # <<<<<<<<<<<<<<
 *         p[0].kind = cudaMemcpyHostToHost
 * 
 */
  __pyx_t_2 = ((__pyx_v_cd[0]).srcMemoryType == CU_MEMORYTYPE_HOST);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_cd[0]).dstMemoryType == CU_MEMORYTYPE_HOST);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2493
 * 
 *     if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST):
 *         p[0].kind = cudaMemcpyHostToHost             # <<<<<<<<<<<<<<
 * 
 *         p[0].srcPtr.ptr = <void*>cd[0].srcHost
 */
    (__pyx_v_p[0]).kind = cudaMemcpyHostToHost;

    /* "cuda/_lib/ccudart/utils.pyx":2495
 *         p[0].kind = cudaMemcpyHostToHost
 * 
 *         p[0].srcPtr.ptr = <void*>cd[0].srcHost             # <<<<<<<<<<<<<<
 *         p[0].srcPtr.pitch = cd[0].srcPitch
 *         p[0].srcPtr.ysize = cd[0].srcHeight
 */
    (__pyx_v_p[0]).srcPtr.ptr = ((void *)(__pyx_v_cd[0]).srcHost);

    /* "cuda/_lib/ccudart/utils.pyx":2496
 * 
 *         p[0].srcPtr.ptr = <void*>cd[0].srcHost
 *         p[0].srcPtr.pitch = cd[0].srcPitch             # <<<<<<<<<<<<<<
 *         p[0].srcPtr.ysize = cd[0].srcHeight
 * 
 */
    __pyx_t_3 = (__pyx_v_cd[0]).srcPitch;
    (__pyx_v_p[0]).srcPtr.pitch = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2497
 *         p[0].srcPtr.ptr = <void*>cd[0].srcHost
 *         p[0].srcPtr.pitch = cd[0].srcPitch
 *         p[0].srcPtr.ysize = cd[0].srcHeight             # <<<<<<<<<<<<<<
 * 
 *         p[0].dstPtr.ptr = cd[0].dstHost
 */
    __pyx_t_3 = (__pyx_v_cd[0]).srcHeight;
    (__pyx_v_p[0]).srcPtr.ysize = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2499
 *         p[0].srcPtr.ysize = cd[0].srcHeight
 * 
 *         p[0].dstPtr.ptr = cd[0].dstHost             # <<<<<<<<<<<<<<
 *         p[0].dstPtr.pitch = cd[0].dstPitch
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 */
    __pyx_t_4 = (__pyx_v_cd[0]).dstHost;
    (__pyx_v_p[0]).dstPtr.ptr = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2500
 * 
 *         p[0].dstPtr.ptr = cd[0].dstHost
 *         p[0].dstPtr.pitch = cd[0].dstPitch             # <<<<<<<<<<<<<<
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 */
    __pyx_t_3 = (__pyx_v_cd[0]).dstPitch;
    (__pyx_v_p[0]).dstPtr.pitch = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2501
 *         p[0].dstPtr.ptr = cd[0].dstHost
 *         p[0].dstPtr.pitch = cd[0].dstPitch
 *         p[0].dstPtr.ysize = cd[0].dstHeight             # <<<<<<<<<<<<<<
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *             and (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 */
    __pyx_t_3 = (__pyx_v_cd[0]).dstHeight;
    (__pyx_v_p[0]).dstPtr.ysize = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2492
 *     p[0].dstPtr.xsize = 0
 * 
 *     if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST):             # <<<<<<<<<<<<<<
 *         p[0].kind = cudaMemcpyHostToHost
 * 
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2502
 *         p[0].dstPtr.pitch = cd[0].dstPitch
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST             # <<<<<<<<<<<<<<
 *             and (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *                 or cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)):
 */
  __pyx_t_2 = ((__pyx_v_cd[0]).srcMemoryType == CU_MEMORYTYPE_HOST);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2503
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *             and (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE             # <<<<<<<<<<<<<<
 *                 or cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)):
 *         p[0].kind = cudaMemcpyHostToDevice
 */
  __pyx_t_2 = ((__pyx_v_cd[0]).dstMemoryType == CU_MEMORYTYPE_DEVICE);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2504
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST
 *             and (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *                 or cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)):             # <<<<<<<<<<<<<<
 *         p[0].kind = cudaMemcpyHostToDevice
 * 
 */
  __pyx_t_2 = ((__pyx_v_cd[0]).dstMemoryType == CU_MEMORYTYPE_ARRAY);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":2502
 *         p[0].dstPtr.pitch = cd[0].dstPitch
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST             # <<<<<<<<<<<<<<
 *             and (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *                 or cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)):
 */
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2505
 *             and (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *                 or cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)):
 *         p[0].kind = cudaMemcpyHostToDevice             # <<<<<<<<<<<<<<
 * 
 *         p[0].srcPtr.ptr = <void*>cd[0].srcHost
 */
    (__pyx_v_p[0]).kind = cudaMemcpyHostToDevice;

    /* "cuda/_lib/ccudart/utils.pyx":2507
 *         p[0].kind = cudaMemcpyHostToDevice
 * 
 *         p[0].srcPtr.ptr = <void*>cd[0].srcHost             # <<<<<<<<<<<<<<
 *         p[0].srcPtr.pitch = cd[0].srcPitch
 *         p[0].srcPtr.ysize = cd[0].srcHeight
 */
    (__pyx_v_p[0]).srcPtr.ptr = ((void *)(__pyx_v_cd[0]).srcHost);

    /* "cuda/_lib/ccudart/utils.pyx":2508
 * 
 *         p[0].srcPtr.ptr = <void*>cd[0].srcHost
 *         p[0].srcPtr.pitch = cd[0].srcPitch             # <<<<<<<<<<<<<<
 *         p[0].srcPtr.ysize = cd[0].srcHeight
 * 
 */
    __pyx_t_3 = (__pyx_v_cd[0]).srcPitch;
    (__pyx_v_p[0]).srcPtr.pitch = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2509
 *         p[0].srcPtr.ptr = <void*>cd[0].srcHost
 *         p[0].srcPtr.pitch = cd[0].srcPitch
 *         p[0].srcPtr.ysize = cd[0].srcHeight             # <<<<<<<<<<<<<<
 * 
 *         if (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 */
    __pyx_t_3 = (__pyx_v_cd[0]).srcHeight;
    (__pyx_v_p[0]).srcPtr.ysize = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2511
 *         p[0].srcPtr.ysize = cd[0].srcHeight
 * 
 *         if (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):             # <<<<<<<<<<<<<<
 *             p[0].dstArray = <cudaArray_t>cd[0].dstArray
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_cd[0]).dstMemoryType == CU_MEMORYTYPE_ARRAY);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2512
 * 
 *         if (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 *             p[0].dstArray = <cudaArray_t>cd[0].dstArray             # <<<<<<<<<<<<<<
 *         else:
 *             p[0].dstPtr.ptr = <void*>cd[0].dstDevice
 */
      (__pyx_v_p[0]).dstArray = ((cudaArray_t)(__pyx_v_cd[0]).dstArray);

      /* "cuda/_lib/ccudart/utils.pyx":2511
 *         p[0].srcPtr.ysize = cd[0].srcHeight
 * 
 *         if (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):             # <<<<<<<<<<<<<<
 *             p[0].dstArray = <cudaArray_t>cd[0].dstArray
 *         else:
 */
      goto __pyx_L9;
    }

    /* "cuda/_lib/ccudart/utils.pyx":2514
 *             p[0].dstArray = <cudaArray_t>cd[0].dstArray
 *         else:
 *             p[0].dstPtr.ptr = <void*>cd[0].dstDevice             # <<<<<<<<<<<<<<
 *             p[0].dstPtr.pitch = cd[0].dstPitch
 *             p[0].dstPtr.ysize = cd[0].dstHeight
 */
    /*else*/ {
      (__pyx_v_p[0]).dstPtr.ptr = ((void *)(__pyx_v_cd[0]).dstDevice);

      /* "cuda/_lib/ccudart/utils.pyx":2515
 *         else:
 *             p[0].dstPtr.ptr = <void*>cd[0].dstDevice
 *             p[0].dstPtr.pitch = cd[0].dstPitch             # <<<<<<<<<<<<<<
 *             p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif ((cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 */
      __pyx_t_3 = (__pyx_v_cd[0]).dstPitch;
      (__pyx_v_p[0]).dstPtr.pitch = __pyx_t_3;

      /* "cuda/_lib/ccudart/utils.pyx":2516
 *             p[0].dstPtr.ptr = <void*>cd[0].dstDevice
 *             p[0].dstPtr.pitch = cd[0].dstPitch
 *             p[0].dstPtr.ysize = cd[0].dstHeight             # <<<<<<<<<<<<<<
 *     elif ((cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 *             and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST):
 */
      __pyx_t_3 = (__pyx_v_cd[0]).dstHeight;
      (__pyx_v_p[0]).dstPtr.ysize = __pyx_t_3;
    }
    __pyx_L9:;

    /* "cuda/_lib/ccudart/utils.pyx":2502
 *         p[0].dstPtr.pitch = cd[0].dstPitch
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST             # <<<<<<<<<<<<<<
 *             and (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE
 *                 or cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)):
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2517
 *             p[0].dstPtr.pitch = cd[0].dstPitch
 *             p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif ((cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)             # <<<<<<<<<<<<<<
 *             and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST):
 *         p[0].kind = cudaMemcpyDeviceToHost
 */
  __pyx_t_2 = ((__pyx_v_cd[0]).srcMemoryType == CU_MEMORYTYPE_DEVICE);
  if (!__pyx_t_2) {
  } else {
    goto __pyx_L11_next_and;
  }
  __pyx_t_2 = ((__pyx_v_cd[0]).srcMemoryType == CU_MEMORYTYPE_ARRAY);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_L11_next_and:;

  /* "cuda/_lib/ccudart/utils.pyx":2518
 *             p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif ((cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 *             and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST):             # <<<<<<<<<<<<<<
 *         p[0].kind = cudaMemcpyDeviceToHost
 * 
 */
  __pyx_t_2 = ((__pyx_v_cd[0]).dstMemoryType == CU_MEMORYTYPE_HOST);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L10_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":2517
 *             p[0].dstPtr.pitch = cd[0].dstPitch
 *             p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif ((cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)             # <<<<<<<<<<<<<<
 *             and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST):
 *         p[0].kind = cudaMemcpyDeviceToHost
 */
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2519
 *     elif ((cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 *             and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST):
 *         p[0].kind = cudaMemcpyDeviceToHost             # <<<<<<<<<<<<<<
 * 
 *         if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 */
    (__pyx_v_p[0]).kind = cudaMemcpyDeviceToHost;

    /* "cuda/_lib/ccudart/utils.pyx":2521
 *         p[0].kind = cudaMemcpyDeviceToHost
 * 
 *         if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):             # <<<<<<<<<<<<<<
 *             p[0].srcArray = <cudaArray_t>cd[0].srcArray
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_cd[0]).srcMemoryType == CU_MEMORYTYPE_ARRAY);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2522
 * 
 *         if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 *             p[0].srcArray = <cudaArray_t>cd[0].srcArray             # <<<<<<<<<<<<<<
 *         else:
 *             p[0].srcPtr.ptr = <void*>cd[0].srcDevice
 */
      (__pyx_v_p[0]).srcArray = ((cudaArray_t)(__pyx_v_cd[0]).srcArray);

      /* "cuda/_lib/ccudart/utils.pyx":2521
 *         p[0].kind = cudaMemcpyDeviceToHost
 * 
 *         if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):             # <<<<<<<<<<<<<<
 *             p[0].srcArray = <cudaArray_t>cd[0].srcArray
 *         else:
 */
      goto __pyx_L13;
    }

    /* "cuda/_lib/ccudart/utils.pyx":2524
 *             p[0].srcArray = <cudaArray_t>cd[0].srcArray
 *         else:
 *             p[0].srcPtr.ptr = <void*>cd[0].srcDevice             # <<<<<<<<<<<<<<
 *             p[0].srcPtr.pitch = cd[0].srcPitch
 *             p[0].srcPtr.ysize = cd[0].srcHeight
 */
    /*else*/ {
      (__pyx_v_p[0]).srcPtr.ptr = ((void *)(__pyx_v_cd[0]).srcDevice);

      /* "cuda/_lib/ccudart/utils.pyx":2525
 *         else:
 *             p[0].srcPtr.ptr = <void*>cd[0].srcDevice
 *             p[0].srcPtr.pitch = cd[0].srcPitch             # <<<<<<<<<<<<<<
 *             p[0].srcPtr.ysize = cd[0].srcHeight
 * 
 */
      __pyx_t_3 = (__pyx_v_cd[0]).srcPitch;
      (__pyx_v_p[0]).srcPtr.pitch = __pyx_t_3;

      /* "cuda/_lib/ccudart/utils.pyx":2526
 *             p[0].srcPtr.ptr = <void*>cd[0].srcDevice
 *             p[0].srcPtr.pitch = cd[0].srcPitch
 *             p[0].srcPtr.ysize = cd[0].srcHeight             # <<<<<<<<<<<<<<
 * 
 *         p[0].dstPtr.ptr = cd[0].dstHost
 */
      __pyx_t_3 = (__pyx_v_cd[0]).srcHeight;
      (__pyx_v_p[0]).srcPtr.ysize = __pyx_t_3;
    }
    __pyx_L13:;

    /* "cuda/_lib/ccudart/utils.pyx":2528
 *             p[0].srcPtr.ysize = cd[0].srcHeight
 * 
 *         p[0].dstPtr.ptr = cd[0].dstHost             # <<<<<<<<<<<<<<
 *         p[0].dstPtr.pitch = cd[0].dstPitch
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 */
    __pyx_t_4 = (__pyx_v_cd[0]).dstHost;
    (__pyx_v_p[0]).dstPtr.ptr = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":2529
 * 
 *         p[0].dstPtr.ptr = cd[0].dstHost
 *         p[0].dstPtr.pitch = cd[0].dstPitch             # <<<<<<<<<<<<<<
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif ((cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 */
    __pyx_t_3 = (__pyx_v_cd[0]).dstPitch;
    (__pyx_v_p[0]).dstPtr.pitch = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2530
 *         p[0].dstPtr.ptr = cd[0].dstHost
 *         p[0].dstPtr.pitch = cd[0].dstPitch
 *         p[0].dstPtr.ysize = cd[0].dstHeight             # <<<<<<<<<<<<<<
 *     elif ((cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 *             and (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)):
 */
    __pyx_t_3 = (__pyx_v_cd[0]).dstHeight;
    (__pyx_v_p[0]).dstPtr.ysize = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2517
 *             p[0].dstPtr.pitch = cd[0].dstPitch
 *             p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif ((cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)             # <<<<<<<<<<<<<<
 *             and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_HOST):
 *         p[0].kind = cudaMemcpyDeviceToHost
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2531
 *         p[0].dstPtr.pitch = cd[0].dstPitch
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif ((cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)             # <<<<<<<<<<<<<<
 *             and (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)):
 *         p[0].kind = cudaMemcpyDeviceToDevice
 */
  __pyx_t_2 = ((__pyx_v_cd[0]).srcMemoryType == CU_MEMORYTYPE_DEVICE);
  if (!__pyx_t_2) {
  } else {
    goto __pyx_L15_next_and;
  }
  __pyx_t_2 = ((__pyx_v_cd[0]).srcMemoryType == CU_MEMORYTYPE_ARRAY);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_L15_next_and:;

  /* "cuda/_lib/ccudart/utils.pyx":2532
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif ((cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 *             and (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)):             # <<<<<<<<<<<<<<
 *         p[0].kind = cudaMemcpyDeviceToDevice
 * 
 */
  __pyx_t_2 = ((__pyx_v_cd[0]).dstMemoryType == CU_MEMORYTYPE_DEVICE);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_cd[0]).dstMemoryType == CU_MEMORYTYPE_ARRAY);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L14_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":2531
 *         p[0].dstPtr.pitch = cd[0].dstPitch
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif ((cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)             # <<<<<<<<<<<<<<
 *             and (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)):
 *         p[0].kind = cudaMemcpyDeviceToDevice
 */
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2533
 *     elif ((cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 *             and (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)):
 *         p[0].kind = cudaMemcpyDeviceToDevice             # <<<<<<<<<<<<<<
 * 
 *         if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 */
    (__pyx_v_p[0]).kind = cudaMemcpyDeviceToDevice;

    /* "cuda/_lib/ccudart/utils.pyx":2535
 *         p[0].kind = cudaMemcpyDeviceToDevice
 * 
 *         if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):             # <<<<<<<<<<<<<<
 *             p[0].srcArray = <cudaArray_t>cd[0].srcArray
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_cd[0]).srcMemoryType == CU_MEMORYTYPE_ARRAY);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2536
 * 
 *         if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 *             p[0].srcArray = <cudaArray_t>cd[0].srcArray             # <<<<<<<<<<<<<<
 *         else:
 *             p[0].srcPtr.ptr = <void*>cd[0].srcDevice
 */
      (__pyx_v_p[0]).srcArray = ((cudaArray_t)(__pyx_v_cd[0]).srcArray);

      /* "cuda/_lib/ccudart/utils.pyx":2535
 *         p[0].kind = cudaMemcpyDeviceToDevice
 * 
 *         if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):             # <<<<<<<<<<<<<<
 *             p[0].srcArray = <cudaArray_t>cd[0].srcArray
 *         else:
 */
      goto __pyx_L18;
    }

    /* "cuda/_lib/ccudart/utils.pyx":2538
 *             p[0].srcArray = <cudaArray_t>cd[0].srcArray
 *         else:
 *             p[0].srcPtr.ptr = <void*>cd[0].srcDevice             # <<<<<<<<<<<<<<
 *             p[0].srcPtr.pitch = cd[0].srcPitch
 *             p[0].srcPtr.ysize = cd[0].srcHeight
 */
    /*else*/ {
      (__pyx_v_p[0]).srcPtr.ptr = ((void *)(__pyx_v_cd[0]).srcDevice);

      /* "cuda/_lib/ccudart/utils.pyx":2539
 *         else:
 *             p[0].srcPtr.ptr = <void*>cd[0].srcDevice
 *             p[0].srcPtr.pitch = cd[0].srcPitch             # <<<<<<<<<<<<<<
 *             p[0].srcPtr.ysize = cd[0].srcHeight
 * 
 */
      __pyx_t_3 = (__pyx_v_cd[0]).srcPitch;
      (__pyx_v_p[0]).srcPtr.pitch = __pyx_t_3;

      /* "cuda/_lib/ccudart/utils.pyx":2540
 *             p[0].srcPtr.ptr = <void*>cd[0].srcDevice
 *             p[0].srcPtr.pitch = cd[0].srcPitch
 *             p[0].srcPtr.ysize = cd[0].srcHeight             # <<<<<<<<<<<<<<
 * 
 *         if (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 */
      __pyx_t_3 = (__pyx_v_cd[0]).srcHeight;
      (__pyx_v_p[0]).srcPtr.ysize = __pyx_t_3;
    }
    __pyx_L18:;

    /* "cuda/_lib/ccudart/utils.pyx":2542
 *             p[0].srcPtr.ysize = cd[0].srcHeight
 * 
 *         if (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):             # <<<<<<<<<<<<<<
 *             p[0].dstArray = <cudaArray_t>cd[0].dstArray
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_cd[0]).dstMemoryType == CU_MEMORYTYPE_ARRAY);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2543
 * 
 *         if (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 *             p[0].dstArray = <cudaArray_t>cd[0].dstArray             # <<<<<<<<<<<<<<
 *         else:
 *             p[0].dstPtr.ptr = <void*>cd[0].dstDevice
 */
      (__pyx_v_p[0]).dstArray = ((cudaArray_t)(__pyx_v_cd[0]).dstArray);

      /* "cuda/_lib/ccudart/utils.pyx":2542
 *             p[0].srcPtr.ysize = cd[0].srcHeight
 * 
 *         if (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):             # <<<<<<<<<<<<<<
 *             p[0].dstArray = <cudaArray_t>cd[0].dstArray
 *         else:
 */
      goto __pyx_L19;
    }

    /* "cuda/_lib/ccudart/utils.pyx":2545
 *             p[0].dstArray = <cudaArray_t>cd[0].dstArray
 *         else:
 *             p[0].dstPtr.ptr = <void*>cd[0].dstDevice             # <<<<<<<<<<<<<<
 *             p[0].dstPtr.pitch = cd[0].dstPitch
 *             p[0].dstPtr.ysize = cd[0].dstHeight
 */
    /*else*/ {
      (__pyx_v_p[0]).dstPtr.ptr = ((void *)(__pyx_v_cd[0]).dstDevice);

      /* "cuda/_lib/ccudart/utils.pyx":2546
 *         else:
 *             p[0].dstPtr.ptr = <void*>cd[0].dstDevice
 *             p[0].dstPtr.pitch = cd[0].dstPitch             # <<<<<<<<<<<<<<
 *             p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED):
 */
      __pyx_t_3 = (__pyx_v_cd[0]).dstPitch;
      (__pyx_v_p[0]).dstPtr.pitch = __pyx_t_3;

      /* "cuda/_lib/ccudart/utils.pyx":2547
 *             p[0].dstPtr.ptr = <void*>cd[0].dstDevice
 *             p[0].dstPtr.pitch = cd[0].dstPitch
 *             p[0].dstPtr.ysize = cd[0].dstHeight             # <<<<<<<<<<<<<<
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED):
 *         p[0].kind = cudaMemcpyDefault
 */
      __pyx_t_3 = (__pyx_v_cd[0]).dstHeight;
      (__pyx_v_p[0]).dstPtr.ysize = __pyx_t_3;
    }
    __pyx_L19:;

    /* "cuda/_lib/ccudart/utils.pyx":2531
 *         p[0].dstPtr.pitch = cd[0].dstPitch
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif ((cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)             # <<<<<<<<<<<<<<
 *             and (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE or cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)):
 *         p[0].kind = cudaMemcpyDeviceToDevice
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2548
 *             p[0].dstPtr.pitch = cd[0].dstPitch
 *             p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED):             # <<<<<<<<<<<<<<
 *         p[0].kind = cudaMemcpyDefault
 * 
 */
  __pyx_t_2 = ((__pyx_v_cd[0]).srcMemoryType == CU_MEMORYTYPE_UNIFIED);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L20_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_cd[0]).dstMemoryType == CU_MEMORYTYPE_UNIFIED);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L20_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2549
 *             p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED):
 *         p[0].kind = cudaMemcpyDefault             # <<<<<<<<<<<<<<
 * 
 *         p[0].srcPtr.ptr = <void*>cd[0].srcDevice
 */
    (__pyx_v_p[0]).kind = cudaMemcpyDefault;

    /* "cuda/_lib/ccudart/utils.pyx":2551
 *         p[0].kind = cudaMemcpyDefault
 * 
 *         p[0].srcPtr.ptr = <void*>cd[0].srcDevice             # <<<<<<<<<<<<<<
 *         p[0].srcPtr.pitch = cd[0].srcPitch
 *         p[0].srcPtr.ysize = cd[0].srcHeight
 */
    (__pyx_v_p[0]).srcPtr.ptr = ((void *)(__pyx_v_cd[0]).srcDevice);

    /* "cuda/_lib/ccudart/utils.pyx":2552
 * 
 *         p[0].srcPtr.ptr = <void*>cd[0].srcDevice
 *         p[0].srcPtr.pitch = cd[0].srcPitch             # <<<<<<<<<<<<<<
 *         p[0].srcPtr.ysize = cd[0].srcHeight
 * 
 */
    __pyx_t_3 = (__pyx_v_cd[0]).srcPitch;
    (__pyx_v_p[0]).srcPtr.pitch = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2553
 *         p[0].srcPtr.ptr = <void*>cd[0].srcDevice
 *         p[0].srcPtr.pitch = cd[0].srcPitch
 *         p[0].srcPtr.ysize = cd[0].srcHeight             # <<<<<<<<<<<<<<
 * 
 *         p[0].dstPtr.ptr = <void*>cd[0].dstDevice
 */
    __pyx_t_3 = (__pyx_v_cd[0]).srcHeight;
    (__pyx_v_p[0]).srcPtr.ysize = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2555
 *         p[0].srcPtr.ysize = cd[0].srcHeight
 * 
 *         p[0].dstPtr.ptr = <void*>cd[0].dstDevice             # <<<<<<<<<<<<<<
 *         p[0].dstPtr.pitch = cd[0].dstPitch
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 */
    (__pyx_v_p[0]).dstPtr.ptr = ((void *)(__pyx_v_cd[0]).dstDevice);

    /* "cuda/_lib/ccudart/utils.pyx":2556
 * 
 *         p[0].dstPtr.ptr = <void*>cd[0].dstDevice
 *         p[0].dstPtr.pitch = cd[0].dstPitch             # <<<<<<<<<<<<<<
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 */
    __pyx_t_3 = (__pyx_v_cd[0]).dstPitch;
    (__pyx_v_p[0]).dstPtr.pitch = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2557
 *         p[0].dstPtr.ptr = <void*>cd[0].dstDevice
 *         p[0].dstPtr.pitch = cd[0].dstPitch
 *         p[0].dstPtr.ysize = cd[0].dstHeight             # <<<<<<<<<<<<<<
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 *         p[0].kind = cudaMemcpyDefault
 */
    __pyx_t_3 = (__pyx_v_cd[0]).dstHeight;
    (__pyx_v_p[0]).dstPtr.ysize = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2548
 *             p[0].dstPtr.pitch = cd[0].dstPitch
 *             p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED):             # <<<<<<<<<<<<<<
 *         p[0].kind = cudaMemcpyDefault
 * 
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2558
 *         p[0].dstPtr.pitch = cd[0].dstPitch
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):             # <<<<<<<<<<<<<<
 *         p[0].kind = cudaMemcpyDefault
 * 
 */
  __pyx_t_2 = ((__pyx_v_cd[0]).srcMemoryType == CU_MEMORYTYPE_UNIFIED);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L22_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_cd[0]).dstMemoryType == CU_MEMORYTYPE_ARRAY);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L22_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2559
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 *         p[0].kind = cudaMemcpyDefault             # <<<<<<<<<<<<<<
 * 
 *         p[0].srcPtr.ptr = <void*>cd[0].srcDevice
 */
    (__pyx_v_p[0]).kind = cudaMemcpyDefault;

    /* "cuda/_lib/ccudart/utils.pyx":2561
 *         p[0].kind = cudaMemcpyDefault
 * 
 *         p[0].srcPtr.ptr = <void*>cd[0].srcDevice             # <<<<<<<<<<<<<<
 *         p[0].srcPtr.pitch = cd[0].srcPitch
 *         p[0].srcPtr.ysize = cd[0].srcHeight
 */
    (__pyx_v_p[0]).srcPtr.ptr = ((void *)(__pyx_v_cd[0]).srcDevice);

    /* "cuda/_lib/ccudart/utils.pyx":2562
 * 
 *         p[0].srcPtr.ptr = <void*>cd[0].srcDevice
 *         p[0].srcPtr.pitch = cd[0].srcPitch             # <<<<<<<<<<<<<<
 *         p[0].srcPtr.ysize = cd[0].srcHeight
 * 
 */
    __pyx_t_3 = (__pyx_v_cd[0]).srcPitch;
    (__pyx_v_p[0]).srcPtr.pitch = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2563
 *         p[0].srcPtr.ptr = <void*>cd[0].srcDevice
 *         p[0].srcPtr.pitch = cd[0].srcPitch
 *         p[0].srcPtr.ysize = cd[0].srcHeight             # <<<<<<<<<<<<<<
 * 
 *         p[0].dstArray = <cudaArray_t>cd[0].dstArray
 */
    __pyx_t_3 = (__pyx_v_cd[0]).srcHeight;
    (__pyx_v_p[0]).srcPtr.ysize = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2565
 *         p[0].srcPtr.ysize = cd[0].srcHeight
 * 
 *         p[0].dstArray = <cudaArray_t>cd[0].dstArray             # <<<<<<<<<<<<<<
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED):
 *         p[0].kind = cudaMemcpyDefault
 */
    (__pyx_v_p[0]).dstArray = ((cudaArray_t)(__pyx_v_cd[0]).dstArray);

    /* "cuda/_lib/ccudart/utils.pyx":2558
 *         p[0].dstPtr.pitch = cd[0].dstPitch
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):             # <<<<<<<<<<<<<<
 *         p[0].kind = cudaMemcpyDefault
 * 
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2566
 * 
 *         p[0].dstArray = <cudaArray_t>cd[0].dstArray
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED):             # <<<<<<<<<<<<<<
 *         p[0].kind = cudaMemcpyDefault
 * 
 */
  __pyx_t_2 = ((__pyx_v_cd[0]).srcMemoryType == CU_MEMORYTYPE_ARRAY);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L24_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_cd[0]).dstMemoryType == CU_MEMORYTYPE_UNIFIED);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L24_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2567
 *         p[0].dstArray = <cudaArray_t>cd[0].dstArray
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED):
 *         p[0].kind = cudaMemcpyDefault             # <<<<<<<<<<<<<<
 * 
 *         p[0].srcArray = <cudaArray_t>cd[0].srcArray
 */
    (__pyx_v_p[0]).kind = cudaMemcpyDefault;

    /* "cuda/_lib/ccudart/utils.pyx":2569
 *         p[0].kind = cudaMemcpyDefault
 * 
 *         p[0].srcArray = <cudaArray_t>cd[0].srcArray             # <<<<<<<<<<<<<<
 * 
 *         p[0].dstPtr.ptr = <void*>cd[0].dstDevice
 */
    (__pyx_v_p[0]).srcArray = ((cudaArray_t)(__pyx_v_cd[0]).srcArray);

    /* "cuda/_lib/ccudart/utils.pyx":2571
 *         p[0].srcArray = <cudaArray_t>cd[0].srcArray
 * 
 *         p[0].dstPtr.ptr = <void*>cd[0].dstDevice             # <<<<<<<<<<<<<<
 *         p[0].dstPtr.pitch = cd[0].dstPitch
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 */
    (__pyx_v_p[0]).dstPtr.ptr = ((void *)(__pyx_v_cd[0]).dstDevice);

    /* "cuda/_lib/ccudart/utils.pyx":2572
 * 
 *         p[0].dstPtr.ptr = <void*>cd[0].dstDevice
 *         p[0].dstPtr.pitch = cd[0].dstPitch             # <<<<<<<<<<<<<<
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 *     else:
 */
    __pyx_t_3 = (__pyx_v_cd[0]).dstPitch;
    (__pyx_v_p[0]).dstPtr.pitch = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2573
 *         p[0].dstPtr.ptr = <void*>cd[0].dstDevice
 *         p[0].dstPtr.pitch = cd[0].dstPitch
 *         p[0].dstPtr.ysize = cd[0].dstHeight             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorUnknown
 */
    __pyx_t_3 = (__pyx_v_cd[0]).dstHeight;
    (__pyx_v_p[0]).dstPtr.ysize = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2566
 * 
 *         p[0].dstArray = <cudaArray_t>cd[0].dstArray
 *     elif (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY and cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED):             # <<<<<<<<<<<<<<
 *         p[0].kind = cudaMemcpyDefault
 * 
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2575
 *         p[0].dstPtr.ysize = cd[0].dstHeight
 *     else:
 *         return cudaErrorUnknown             # <<<<<<<<<<<<<<
 * 
 *     cdef size_t srcElementSize = 0
 */
  /*else*/ {
    __pyx_r = cudaErrorUnknown;
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "cuda/_lib/ccudart/utils.pyx":2577
 *         return cudaErrorUnknown
 * 
 *     cdef size_t srcElementSize = 0             # <<<<<<<<<<<<<<
 *     cdef size_t dstElementSize = 0
 *     cdef cudaError_t err = cudaSuccess
 */
  __pyx_v_srcElementSize = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2578
 * 
 *     cdef size_t srcElementSize = 0
 *     cdef size_t dstElementSize = 0             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 * 
 */
  __pyx_v_dstElementSize = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2579
 *     cdef size_t srcElementSize = 0
 *     cdef size_t dstElementSize = 0
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":2581
 *     cdef cudaError_t err = cudaSuccess
 * 
 *     if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):             # <<<<<<<<<<<<<<
 *         err = getFormat(<cudaArray_t>cd[0].srcArray, numChannels, &srcFmt)
 *         if err != cudaSuccess:
 */
  __pyx_t_1 = ((__pyx_v_cd[0]).srcMemoryType == CU_MEMORYTYPE_ARRAY);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2582
 * 
 *     if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 *         err = getFormat(<cudaArray_t>cd[0].srcArray, numChannels, &srcFmt)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_5 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getFormat(((cudaArray_t)(__pyx_v_cd[0]).srcArray), __pyx_v_numChannels, (&__pyx_v_srcFmt)); if (unlikely(__pyx_t_5 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2582, __pyx_L1_error)
    __pyx_v_err = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":2583
 *     if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 *         err = getFormat(<cudaArray_t>cd[0].srcArray, numChannels, &srcFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2584
 *         err = getFormat(<cudaArray_t>cd[0].srcArray, numChannels, &srcFmt)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2583
 *     if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 *         err = getFormat(<cudaArray_t>cd[0].srcArray, numChannels, &srcFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2585
 *         if err != cudaSuccess:
 *             return err
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_5 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getArrayBlockExtent((&__pyx_v_srcBlockExtent), __pyx_v_srcFmt); if (unlikely(__pyx_t_5 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2585, __pyx_L1_error)
    __pyx_v_err = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":2586
 *             return err
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getElementSize(&srcElementSize, <cudaArray_t>cd[0].srcArray)
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2587
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         err = getElementSize(&srcElementSize, <cudaArray_t>cd[0].srcArray)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2586
 *             return err
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getElementSize(&srcElementSize, <cudaArray_t>cd[0].srcArray)
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2588
 *         if err != cudaSuccess:
 *             return err
 *         err = getElementSize(&srcElementSize, <cudaArray_t>cd[0].srcArray)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_5 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getElementSize((&__pyx_v_srcElementSize), ((cudaArray_t)(__pyx_v_cd[0]).srcArray)); if (unlikely(__pyx_t_5 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2588, __pyx_L1_error)
    __pyx_v_err = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":2589
 *             return err
 *         err = getElementSize(&srcElementSize, <cudaArray_t>cd[0].srcArray)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         copyBlockExtent = srcBlockExtent
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2590
 *         err = getElementSize(&srcElementSize, <cudaArray_t>cd[0].srcArray)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         copyBlockExtent = srcBlockExtent
 * 
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2589
 *             return err
 *         err = getElementSize(&srcElementSize, <cudaArray_t>cd[0].srcArray)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         copyBlockExtent = srcBlockExtent
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2591
 *         if err != cudaSuccess:
 *             return err
 *         copyBlockExtent = srcBlockExtent             # <<<<<<<<<<<<<<
 * 
 *     if (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 */
    __pyx_v_copyBlockExtent = __pyx_v_srcBlockExtent;

    /* "cuda/_lib/ccudart/utils.pyx":2581
 *     cdef cudaError_t err = cudaSuccess
 * 
 *     if (cd[0].srcMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):             # <<<<<<<<<<<<<<
 *         err = getFormat(<cudaArray_t>cd[0].srcArray, numChannels, &srcFmt)
 *         if err != cudaSuccess:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2593
 *         copyBlockExtent = srcBlockExtent
 * 
 *     if (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):             # <<<<<<<<<<<<<<
 *         err = getFormat(<cudaArray_t>cd[0].dstArray, numChannels, &dstFmt)
 *         if err != cudaSuccess:
 */
  __pyx_t_1 = ((__pyx_v_cd[0]).dstMemoryType == CU_MEMORYTYPE_ARRAY);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2594
 * 
 *     if (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 *         err = getFormat(<cudaArray_t>cd[0].dstArray, numChannels, &dstFmt)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_5 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getFormat(((cudaArray_t)(__pyx_v_cd[0]).dstArray), __pyx_v_numChannels, (&__pyx_v_dstFmt)); if (unlikely(__pyx_t_5 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2594, __pyx_L1_error)
    __pyx_v_err = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":2595
 *     if (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 *         err = getFormat(<cudaArray_t>cd[0].dstArray, numChannels, &dstFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2596
 *         err = getFormat(<cudaArray_t>cd[0].dstArray, numChannels, &dstFmt)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2595
 *     if (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):
 *         err = getFormat(<cudaArray_t>cd[0].dstArray, numChannels, &dstFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2597
 *         if err != cudaSuccess:
 *             return err
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_5 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getArrayBlockExtent((&__pyx_v_dstBlockExtent), __pyx_v_dstFmt); if (unlikely(__pyx_t_5 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2597, __pyx_L1_error)
    __pyx_v_err = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":2598
 *             return err
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getElementSize(&dstElementSize, <cudaArray_t>cd[0].dstArray)
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2599
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         err = getElementSize(&dstElementSize, <cudaArray_t>cd[0].dstArray)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2598
 *             return err
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getElementSize(&dstElementSize, <cudaArray_t>cd[0].dstArray)
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2600
 *         if err != cudaSuccess:
 *             return err
 *         err = getElementSize(&dstElementSize, <cudaArray_t>cd[0].dstArray)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_5 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getElementSize((&__pyx_v_dstElementSize), ((cudaArray_t)(__pyx_v_cd[0]).dstArray)); if (unlikely(__pyx_t_5 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2600, __pyx_L1_error)
    __pyx_v_err = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":2601
 *             return err
 *         err = getElementSize(&dstElementSize, <cudaArray_t>cd[0].dstArray)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         if cd[0].srcMemoryType != ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY:
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2602
 *         err = getElementSize(&dstElementSize, <cudaArray_t>cd[0].dstArray)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         if cd[0].srcMemoryType != ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY:
 *             copyBlockExtent = dstBlockExtent
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2601
 *             return err
 *         err = getElementSize(&dstElementSize, <cudaArray_t>cd[0].dstArray)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         if cd[0].srcMemoryType != ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2603
 *         if err != cudaSuccess:
 *             return err
 *         if cd[0].srcMemoryType != ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY:             # <<<<<<<<<<<<<<
 *             copyBlockExtent = dstBlockExtent
 * 
 */
    __pyx_t_1 = ((__pyx_v_cd[0]).srcMemoryType != CU_MEMORYTYPE_ARRAY);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2604
 *             return err
 *         if cd[0].srcMemoryType != ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY:
 *             copyBlockExtent = dstBlockExtent             # <<<<<<<<<<<<<<
 * 
 *     if (srcElementSize and dstElementSize and srcElementSize != dstElementSize):
 */
      __pyx_v_copyBlockExtent = __pyx_v_dstBlockExtent;

      /* "cuda/_lib/ccudart/utils.pyx":2603
 *         if err != cudaSuccess:
 *             return err
 *         if cd[0].srcMemoryType != ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY:             # <<<<<<<<<<<<<<
 *             copyBlockExtent = dstBlockExtent
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2593
 *         copyBlockExtent = srcBlockExtent
 * 
 *     if (cd[0].dstMemoryType == ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY):             # <<<<<<<<<<<<<<
 *         err = getFormat(<cudaArray_t>cd[0].dstArray, numChannels, &dstFmt)
 *         if err != cudaSuccess:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2606
 *             copyBlockExtent = dstBlockExtent
 * 
 *     if (srcElementSize and dstElementSize and srcElementSize != dstElementSize):             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_2 = (__pyx_v_srcElementSize != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L36_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_dstElementSize != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L36_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_srcElementSize != __pyx_v_dstElementSize);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L36_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2607
 * 
 *     if (srcElementSize and dstElementSize and srcElementSize != dstElementSize):
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef size_t elementSize = sizeof(char)
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2606
 *             copyBlockExtent = dstBlockExtent
 * 
 *     if (srcElementSize and dstElementSize and srcElementSize != dstElementSize):             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2609
 *         return cudaErrorInvalidValue
 * 
 *     cdef size_t elementSize = sizeof(char)             # <<<<<<<<<<<<<<
 *     if (srcElementSize):
 *         elementSize = srcElementSize
 */
  __pyx_v_elementSize = (sizeof(char));

  /* "cuda/_lib/ccudart/utils.pyx":2610
 * 
 *     cdef size_t elementSize = sizeof(char)
 *     if (srcElementSize):             # <<<<<<<<<<<<<<
 *         elementSize = srcElementSize
 *     if (dstElementSize):
 */
  __pyx_t_1 = (__pyx_v_srcElementSize != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2611
 *     cdef size_t elementSize = sizeof(char)
 *     if (srcElementSize):
 *         elementSize = srcElementSize             # <<<<<<<<<<<<<<
 *     if (dstElementSize):
 *         elementSize = dstElementSize
 */
    __pyx_v_elementSize = __pyx_v_srcElementSize;

    /* "cuda/_lib/ccudart/utils.pyx":2610
 * 
 *     cdef size_t elementSize = sizeof(char)
 *     if (srcElementSize):             # <<<<<<<<<<<<<<
 *         elementSize = srcElementSize
 *     if (dstElementSize):
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2612
 *     if (srcElementSize):
 *         elementSize = srcElementSize
 *     if (dstElementSize):             # <<<<<<<<<<<<<<
 *         elementSize = dstElementSize
 *     srcElementSize = elementSize
 */
  __pyx_t_1 = (__pyx_v_dstElementSize != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2613
 *         elementSize = srcElementSize
 *     if (dstElementSize):
 *         elementSize = dstElementSize             # <<<<<<<<<<<<<<
 *     srcElementSize = elementSize
 *     dstElementSize = elementSize
 */
    __pyx_v_elementSize = __pyx_v_dstElementSize;

    /* "cuda/_lib/ccudart/utils.pyx":2612
 *     if (srcElementSize):
 *         elementSize = srcElementSize
 *     if (dstElementSize):             # <<<<<<<<<<<<<<
 *         elementSize = dstElementSize
 *     srcElementSize = elementSize
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2614
 *     if (dstElementSize):
 *         elementSize = dstElementSize
 *     srcElementSize = elementSize             # <<<<<<<<<<<<<<
 *     dstElementSize = elementSize
 * 
 */
  __pyx_v_srcElementSize = __pyx_v_elementSize;

  /* "cuda/_lib/ccudart/utils.pyx":2615
 *         elementSize = dstElementSize
 *     srcElementSize = elementSize
 *     dstElementSize = elementSize             # <<<<<<<<<<<<<<
 * 
 *     p[0].extent.width = <size_t>(cd[0].WidthInBytes / elementSize) * copyBlockExtent.width
 */
  __pyx_v_dstElementSize = __pyx_v_elementSize;

  /* "cuda/_lib/ccudart/utils.pyx":2617
 *     dstElementSize = elementSize
 * 
 *     p[0].extent.width = <size_t>(cd[0].WidthInBytes / elementSize) * copyBlockExtent.width             # <<<<<<<<<<<<<<
 *     p[0].extent.height = cd[0].Height * copyBlockExtent.height
 *     p[0].extent.depth = cd[0].Depth
 */
  if (unlikely(__pyx_v_elementSize == 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, 2617, __pyx_L1_error)
  }
  (__pyx_v_p[0]).extent.width = (((size_t)(((double)(__pyx_v_cd[0]).WidthInBytes) / ((double)__pyx_v_elementSize))) * __pyx_v_copyBlockExtent.width);

  /* "cuda/_lib/ccudart/utils.pyx":2618
 * 
 *     p[0].extent.width = <size_t>(cd[0].WidthInBytes / elementSize) * copyBlockExtent.width
 *     p[0].extent.height = cd[0].Height * copyBlockExtent.height             # <<<<<<<<<<<<<<
 *     p[0].extent.depth = cd[0].Depth
 * 
 */
  (__pyx_v_p[0]).extent.height = ((__pyx_v_cd[0]).Height * __pyx_v_copyBlockExtent.height);

  /* "cuda/_lib/ccudart/utils.pyx":2619
 *     p[0].extent.width = <size_t>(cd[0].WidthInBytes / elementSize) * copyBlockExtent.width
 *     p[0].extent.height = cd[0].Height * copyBlockExtent.height
 *     p[0].extent.depth = cd[0].Depth             # <<<<<<<<<<<<<<
 * 
 *     p[0].srcPos.x = <size_t>(cd[0].srcXInBytes / elementSize) * srcBlockExtent.width
 */
  __pyx_t_3 = (__pyx_v_cd[0]).Depth;
  (__pyx_v_p[0]).extent.depth = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":2621
 *     p[0].extent.depth = cd[0].Depth
 * 
 *     p[0].srcPos.x = <size_t>(cd[0].srcXInBytes / elementSize) * srcBlockExtent.width             # <<<<<<<<<<<<<<
 *     p[0].srcPos.y = cd[0].srcY * srcBlockExtent.height
 *     p[0].srcPos.z = cd[0].srcZ
 */
  if (unlikely(__pyx_v_elementSize == 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, 2621, __pyx_L1_error)
  }
  (__pyx_v_p[0]).srcPos.x = (((size_t)(((double)(__pyx_v_cd[0]).srcXInBytes) / ((double)__pyx_v_elementSize))) * __pyx_v_srcBlockExtent.width);

  /* "cuda/_lib/ccudart/utils.pyx":2622
 * 
 *     p[0].srcPos.x = <size_t>(cd[0].srcXInBytes / elementSize) * srcBlockExtent.width
 *     p[0].srcPos.y = cd[0].srcY * srcBlockExtent.height             # <<<<<<<<<<<<<<
 *     p[0].srcPos.z = cd[0].srcZ
 * 
 */
  (__pyx_v_p[0]).srcPos.y = ((__pyx_v_cd[0]).srcY * __pyx_v_srcBlockExtent.height);

  /* "cuda/_lib/ccudart/utils.pyx":2623
 *     p[0].srcPos.x = <size_t>(cd[0].srcXInBytes / elementSize) * srcBlockExtent.width
 *     p[0].srcPos.y = cd[0].srcY * srcBlockExtent.height
 *     p[0].srcPos.z = cd[0].srcZ             # <<<<<<<<<<<<<<
 * 
 *     p[0].dstPos.x = <size_t>(cd[0].dstXInBytes / elementSize) * dstBlockExtent.width
 */
  __pyx_t_3 = (__pyx_v_cd[0]).srcZ;
  (__pyx_v_p[0]).srcPos.z = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":2625
 *     p[0].srcPos.z = cd[0].srcZ
 * 
 *     p[0].dstPos.x = <size_t>(cd[0].dstXInBytes / elementSize) * dstBlockExtent.width             # <<<<<<<<<<<<<<
 *     p[0].dstPos.y = cd[0].dstY * dstBlockExtent.height
 *     p[0].dstPos.z = cd[0].dstZ
 */
  if (unlikely(__pyx_v_elementSize == 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, 2625, __pyx_L1_error)
  }
  (__pyx_v_p[0]).dstPos.x = (((size_t)(((double)(__pyx_v_cd[0]).dstXInBytes) / ((double)__pyx_v_elementSize))) * __pyx_v_dstBlockExtent.width);

  /* "cuda/_lib/ccudart/utils.pyx":2626
 * 
 *     p[0].dstPos.x = <size_t>(cd[0].dstXInBytes / elementSize) * dstBlockExtent.width
 *     p[0].dstPos.y = cd[0].dstY * dstBlockExtent.height             # <<<<<<<<<<<<<<
 *     p[0].dstPos.z = cd[0].dstZ
 *     return cudaSuccess
 */
  (__pyx_v_p[0]).dstPos.y = ((__pyx_v_cd[0]).dstY * __pyx_v_dstBlockExtent.height);

  /* "cuda/_lib/ccudart/utils.pyx":2627
 *     p[0].dstPos.x = <size_t>(cd[0].dstXInBytes / elementSize) * dstBlockExtent.width
 *     p[0].dstPos.y = cd[0].dstY * dstBlockExtent.height
 *     p[0].dstPos.z = cd[0].dstZ             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  __pyx_t_3 = (__pyx_v_cd[0]).dstZ;
  (__pyx_v_p[0]).dstPos.z = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":2628
 *     p[0].dstPos.y = cd[0].dstY * dstBlockExtent.height
 *     p[0].dstPos.z = cd[0].dstZ
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2477
 * 
 * 
 * cdef cudaError_t toCudartMemCopy3DParams(const ccuda.CUDA_MEMCPY3D_v2 *cd, cudaMemcpy3DParms *p) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaExtent srcBlockExtent
 *     cdef cudaExtent dstBlockExtent
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2631
 * 
 * 
 * cdef cudaError_t memcpy2DFromArray(char *dst, size_t dpitch, cudaArray_const_t src, size_t hOffset,             # <<<<<<<<<<<<<<
 *         size_t wOffset, size_t width, size_t height, cudaMemcpyKind kind,
 *         cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DFromArray(char *__pyx_v_dst, size_t __pyx_v_dpitch, cudaArray_const_t __pyx_v_src, size_t __pyx_v_hOffset, size_t __pyx_v_wOffset, size_t __pyx_v_width, size_t __pyx_v_height, enum cudaMemcpyKind __pyx_v_kind, cudaStream_t __pyx_v_sid, bool __pyx_v_async) {
  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("memcpy2DFromArray", __pyx_f[0], 2631, 1, __PYX_ERR(0, 2631, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2634
 *         size_t wOffset, size_t width, size_t height, cudaMemcpyKind kind,
 *         cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     if width == 0 or height == 0:
 *         return cudaSuccess
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":2635
 *         cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if height > 1 and width > dpitch:
 */
  __pyx_t_2 = (__pyx_v_width == 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_height == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2636
 *     cdef cudaError_t err = cudaSuccess
 *     if width == 0 or height == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     if height > 1 and width > dpitch:
 *         return cudaErrorInvalidPitchValue
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2635
 *         cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if height > 1 and width > dpitch:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2637
 *     if width == 0 or height == 0:
 *         return cudaSuccess
 *     if height > 1 and width > dpitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidPitchValue
 * 
 */
  __pyx_t_2 = (__pyx_v_height > 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_width > __pyx_v_dpitch);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2638
 *         return cudaSuccess
 *     if height > 1 and width > dpitch:
 *         return cudaErrorInvalidPitchValue             # <<<<<<<<<<<<<<
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 */
    __pyx_r = cudaErrorInvalidPitchValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2637
 *     if width == 0 or height == 0:
 *         return cudaSuccess
 *     if height > 1 and width > dpitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidPitchValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2640
 *         return cudaErrorInvalidPitchValue
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:             # <<<<<<<<<<<<<<
 *         err = copyToHost2D(src, hOffset, wOffset, dst, dpitch, width, height, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 */
  switch (__pyx_v_kind) {
    case cudaMemcpyDeviceToHost:

    /* "cuda/_lib/ccudart/utils.pyx":2641
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         err = copyToHost2D(src, hOffset, wOffset, dst, dpitch, width, height, sid, async)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         err = copyToDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, src, hOffset, wOffset, dst, 0, dpitch, width, height, sid, async)
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToHost2D(__pyx_v_src, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_dst, __pyx_v_dpitch, __pyx_v_width, __pyx_v_height, __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2641, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2640
 *         return cudaErrorInvalidPitchValue
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:             # <<<<<<<<<<<<<<
 *         err = copyToHost2D(src, hOffset, wOffset, dst, dpitch, width, height, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 */
    break;
    case cudaMemcpyDeviceToDevice:

    /* "cuda/_lib/ccudart/utils.pyx":2643
 *         err = copyToHost2D(src, hOffset, wOffset, dst, dpitch, width, height, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         err = copyToDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, src, hOffset, wOffset, dst, 0, dpitch, width, height, sid, async)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         err = copyToDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, src, hOffset, wOffset, dst, 0, dpitch, width, height, sid, async)
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToDevice2D(CU_MEMORYTYPE_DEVICE, __pyx_v_src, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_dst, 0, __pyx_v_dpitch, __pyx_v_width, __pyx_v_height, __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2643, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2642
 *     if kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         err = copyToHost2D(src, hOffset, wOffset, dst, dpitch, width, height, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:             # <<<<<<<<<<<<<<
 *         err = copyToDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, src, hOffset, wOffset, dst, 0, dpitch, width, height, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 */
    break;
    case cudaMemcpyDefault:

    /* "cuda/_lib/ccudart/utils.pyx":2645
 *         err = copyToDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, src, hOffset, wOffset, dst, 0, dpitch, width, height, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         err = copyToDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, src, hOffset, wOffset, dst, 0, dpitch, width, height, sid, async)             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorInvalidMemcpyDirection
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToDevice2D(CU_MEMORYTYPE_UNIFIED, __pyx_v_src, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_dst, 0, __pyx_v_dpitch, __pyx_v_width, __pyx_v_height, __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2645, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2644
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         err = copyToDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, src, hOffset, wOffset, dst, 0, dpitch, width, height, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:             # <<<<<<<<<<<<<<
 *         err = copyToDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, src, hOffset, wOffset, dst, 0, dpitch, width, height, sid, async)
 *     else:
 */
    break;
    default:

    /* "cuda/_lib/ccudart/utils.pyx":2647
 *         err = copyToDevice2D(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, src, hOffset, wOffset, dst, 0, dpitch, width, height, sid, async)
 *     else:
 *         return cudaErrorInvalidMemcpyDirection             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    __pyx_r = cudaErrorInvalidMemcpyDirection;
    goto __pyx_L0;
    break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2648
 *     else:
 *         return cudaErrorInvalidMemcpyDirection
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2631
 * 
 * 
 * cdef cudaError_t memcpy2DFromArray(char *dst, size_t dpitch, cudaArray_const_t src, size_t hOffset,             # <<<<<<<<<<<<<<
 *         size_t wOffset, size_t width, size_t height, cudaMemcpyKind kind,
 *         cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2651
 * 
 * 
 * cdef cudaError_t memcpy2DArrayToArray(cudaArray_t dst, size_t hOffsetDst, size_t wOffsetDst,             # <<<<<<<<<<<<<<
 *                                       cudaArray_const_t src, size_t hOffsetSrc, size_t wOffsetSrc,
 *                                       size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpy2DArrayToArray(cudaArray_t __pyx_v_dst, size_t __pyx_v_hOffsetDst, size_t __pyx_v_wOffsetDst, cudaArray_const_t __pyx_v_src, size_t __pyx_v_hOffsetSrc, size_t __pyx_v_wOffsetSrc, size_t __pyx_v_width, size_t __pyx_v_height, enum cudaMemcpyKind __pyx_v_kind) {
  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("memcpy2DArrayToArray", __pyx_f[0], 2651, 1, __PYX_ERR(0, 2651, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2654
 *                                       cudaArray_const_t src, size_t hOffsetSrc, size_t wOffsetSrc,
 *                                       size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if kind != cudaMemcpyKind.cudaMemcpyDeviceToDevice and kind != cudaMemcpyKind.cudaMemcpyDefault:
 */
  __pyx_t_2 = (__pyx_v_width == 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_height == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2655
 *                                       size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if width == 0 or height == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     if kind != cudaMemcpyKind.cudaMemcpyDeviceToDevice and kind != cudaMemcpyKind.cudaMemcpyDefault:
 *         return cudaErrorInvalidMemcpyDirection
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2654
 *                                       cudaArray_const_t src, size_t hOffsetSrc, size_t wOffsetSrc,
 *                                       size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if kind != cudaMemcpyKind.cudaMemcpyDeviceToDevice and kind != cudaMemcpyKind.cudaMemcpyDefault:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2656
 *     if width == 0 or height == 0:
 *         return cudaSuccess
 *     if kind != cudaMemcpyKind.cudaMemcpyDeviceToDevice and kind != cudaMemcpyKind.cudaMemcpyDefault:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidMemcpyDirection
 *     return copyToArray2D(src, hOffsetSrc, wOffsetSrc, dst, hOffsetDst, wOffsetDst, width, height)
 */
  switch (__pyx_v_kind) {
    case cudaMemcpyDeviceToDevice:
    case cudaMemcpyDefault:
    __pyx_t_1 = 0;
    break;
    default:
    __pyx_t_1 = 1;
    break;
  }
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2657
 *         return cudaSuccess
 *     if kind != cudaMemcpyKind.cudaMemcpyDeviceToDevice and kind != cudaMemcpyKind.cudaMemcpyDefault:
 *         return cudaErrorInvalidMemcpyDirection             # <<<<<<<<<<<<<<
 *     return copyToArray2D(src, hOffsetSrc, wOffsetSrc, dst, hOffsetDst, wOffsetDst, width, height)
 * 
 */
    __pyx_r = cudaErrorInvalidMemcpyDirection;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2656
 *     if width == 0 or height == 0:
 *         return cudaSuccess
 *     if kind != cudaMemcpyKind.cudaMemcpyDeviceToDevice and kind != cudaMemcpyKind.cudaMemcpyDefault:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidMemcpyDirection
 *     return copyToArray2D(src, hOffsetSrc, wOffsetSrc, dst, hOffsetDst, wOffsetDst, width, height)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2658
 *     if kind != cudaMemcpyKind.cudaMemcpyDeviceToDevice and kind != cudaMemcpyKind.cudaMemcpyDefault:
 *         return cudaErrorInvalidMemcpyDirection
 *     return copyToArray2D(src, hOffsetSrc, wOffsetSrc, dst, hOffsetDst, wOffsetDst, width, height)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToArray2D(__pyx_v_src, __pyx_v_hOffsetSrc, __pyx_v_wOffsetSrc, __pyx_v_dst, __pyx_v_hOffsetDst, __pyx_v_wOffsetDst, __pyx_v_width, __pyx_v_height); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2658, __pyx_L1_error)
  __pyx_r = __pyx_t_3;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2651
 * 
 * 
 * cdef cudaError_t memcpy2DArrayToArray(cudaArray_t dst, size_t hOffsetDst, size_t wOffsetDst,             # <<<<<<<<<<<<<<
 *                                       cudaArray_const_t src, size_t hOffsetSrc, size_t wOffsetSrc,
 *                                       size_t width, size_t height, cudaMemcpyKind kind) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2661
 * 
 * 
 * cdef cudaError_t memset3DPtr(cudaPitchedPtr p, int val, cudaExtent e, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if e.width == 0 or e.height == 0 or e.depth == 0:
 *         return cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_memset3DPtr(struct cudaPitchedPtr __pyx_v_p, int __pyx_v_val, struct cudaExtent __pyx_v_e, cudaStream_t __pyx_v_sid, bool __pyx_v_async) {
  char *__pyx_v_ptr;
  size_t __pyx_v_d;
  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("memset3DPtr", __pyx_f[0], 2661, 1, __PYX_ERR(0, 2661, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2662
 * 
 * cdef cudaError_t memset3DPtr(cudaPitchedPtr p, int val, cudaExtent e, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if e.width == 0 or e.height == 0 or e.depth == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  __pyx_t_2 = (__pyx_v_e.width == 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_e.height == 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_e.depth == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2663
 * cdef cudaError_t memset3DPtr(cudaPitchedPtr p, int val, cudaExtent e, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if e.width == 0 or e.height == 0 or e.depth == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if (e.height > 1 or e.depth > 1) and e.width > p.pitch:
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2662
 * 
 * cdef cudaError_t memset3DPtr(cudaPitchedPtr p, int val, cudaExtent e, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if e.width == 0 or e.height == 0 or e.depth == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2665
 *         return cudaSuccess
 * 
 *     if (e.height > 1 or e.depth > 1) and e.width > p.pitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_2 = (__pyx_v_e.height > 1);
  if (!__pyx_t_2) {
  } else {
    goto __pyx_L9_next_and;
  }
  __pyx_t_2 = (__pyx_v_e.depth > 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_L9_next_and:;
  __pyx_t_2 = (__pyx_v_e.width > __pyx_v_p.pitch);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2666
 * 
 *     if (e.height > 1 or e.depth > 1) and e.width > p.pitch:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     if e.depth > 0 and e.height > p.ysize:
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2665
 *         return cudaSuccess
 * 
 *     if (e.height > 1 or e.depth > 1) and e.width > p.pitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2668
 *         return cudaErrorInvalidValue
 * 
 *     if e.depth > 0 and e.height > p.ysize:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_2 = (__pyx_v_e.depth > 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_e.height > __pyx_v_p.ysize);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L12_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2669
 * 
 *     if e.depth > 0 and e.height > p.ysize:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef char *ptr = <char*>p.ptr
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2668
 *         return cudaErrorInvalidValue
 * 
 *     if e.depth > 0 and e.height > p.ysize:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2671
 *         return cudaErrorInvalidValue
 * 
 *     cdef char *ptr = <char*>p.ptr             # <<<<<<<<<<<<<<
 *     cdef size_t d
 *     cdef cudaError_t err = cudaSuccess
 */
  __pyx_v_ptr = ((char *)__pyx_v_p.ptr);

  /* "cuda/_lib/ccudart/utils.pyx":2673
 *     cdef char *ptr = <char*>p.ptr
 *     cdef size_t d
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if e.width >= p.xsize and e.height == p.ysize and e.width == p.pitch:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":2675
 *     cdef cudaError_t err = cudaSuccess
 * 
 *     if e.width >= p.xsize and e.height == p.ysize and e.width == p.pitch:             # <<<<<<<<<<<<<<
 *         return memsetPtr(ptr, val, e.width * e.height * e.depth, sid, async)
 *     elif e.height == p.ysize:
 */
  __pyx_t_2 = (__pyx_v_e.width >= __pyx_v_p.xsize);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_e.height == __pyx_v_p.ysize);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_e.width == __pyx_v_p.pitch);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2676
 * 
 *     if e.width >= p.xsize and e.height == p.ysize and e.width == p.pitch:
 *         return memsetPtr(ptr, val, e.width * e.height * e.depth, sid, async)             # <<<<<<<<<<<<<<
 *     elif e.height == p.ysize:
 *         return memset2DPtr(ptr, p.pitch, val, e.width, e.height * e.depth, sid, async)
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memsetPtr(__pyx_v_ptr, __pyx_v_val, ((__pyx_v_e.width * __pyx_v_e.height) * __pyx_v_e.depth), __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2676, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2675
 *     cdef cudaError_t err = cudaSuccess
 * 
 *     if e.width >= p.xsize and e.height == p.ysize and e.width == p.pitch:             # <<<<<<<<<<<<<<
 *         return memsetPtr(ptr, val, e.width * e.height * e.depth, sid, async)
 *     elif e.height == p.ysize:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2677
 *     if e.width >= p.xsize and e.height == p.ysize and e.width == p.pitch:
 *         return memsetPtr(ptr, val, e.width * e.height * e.depth, sid, async)
 *     elif e.height == p.ysize:             # <<<<<<<<<<<<<<
 *         return memset2DPtr(ptr, p.pitch, val, e.width, e.height * e.depth, sid, async)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_e.height == __pyx_v_p.ysize);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2678
 *         return memsetPtr(ptr, val, e.width * e.height * e.depth, sid, async)
 *     elif e.height == p.ysize:
 *         return memset2DPtr(ptr, p.pitch, val, e.width, e.height * e.depth, sid, async)             # <<<<<<<<<<<<<<
 *     else:
 *         d = 0
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memset2DPtr(__pyx_v_ptr, __pyx_v_p.pitch, __pyx_v_val, __pyx_v_e.width, (__pyx_v_e.height * __pyx_v_e.depth), __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2678, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2677
 *     if e.width >= p.xsize and e.height == p.ysize and e.width == p.pitch:
 *         return memsetPtr(ptr, val, e.width * e.height * e.depth, sid, async)
 *     elif e.height == p.ysize:             # <<<<<<<<<<<<<<
 *         return memset2DPtr(ptr, p.pitch, val, e.width, e.height * e.depth, sid, async)
 *     else:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2680
 *         return memset2DPtr(ptr, p.pitch, val, e.width, e.height * e.depth, sid, async)
 *     else:
 *         d = 0             # <<<<<<<<<<<<<<
 *         while (d != e.depth):
 *             err = memset2DPtr(ptr, p.pitch, val, e.width, e.height, sid, async)
 */
  /*else*/ {
    __pyx_v_d = 0;

    /* "cuda/_lib/ccudart/utils.pyx":2681
 *     else:
 *         d = 0
 *         while (d != e.depth):             # <<<<<<<<<<<<<<
 *             err = memset2DPtr(ptr, p.pitch, val, e.width, e.height, sid, async)
 *             if err != cudaSuccess:
 */
    while (1) {
      __pyx_t_1 = (__pyx_v_d != __pyx_v_e.depth);
      if (!__pyx_t_1) break;

      /* "cuda/_lib/ccudart/utils.pyx":2682
 *         d = 0
 *         while (d != e.depth):
 *             err = memset2DPtr(ptr, p.pitch, val, e.width, e.height, sid, async)             # <<<<<<<<<<<<<<
 *             if err != cudaSuccess:
 *                 return err
 */
      __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_memset2DPtr(__pyx_v_ptr, __pyx_v_p.pitch, __pyx_v_val, __pyx_v_e.width, __pyx_v_e.height, __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2682, __pyx_L1_error)
      __pyx_v_err = __pyx_t_3;

      /* "cuda/_lib/ccudart/utils.pyx":2683
 *         while (d != e.depth):
 *             err = memset2DPtr(ptr, p.pitch, val, e.width, e.height, sid, async)
 *             if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *                 return err
 *             ptr += p.pitch * p.ysize
 */
      __pyx_t_1 = (__pyx_v_err != cudaSuccess);
      if (__pyx_t_1) {

        /* "cuda/_lib/ccudart/utils.pyx":2684
 *             err = memset2DPtr(ptr, p.pitch, val, e.width, e.height, sid, async)
 *             if err != cudaSuccess:
 *                 return err             # <<<<<<<<<<<<<<
 *             ptr += p.pitch * p.ysize
 *             d += 1
 */
        __pyx_r = __pyx_v_err;
        goto __pyx_L0;

        /* "cuda/_lib/ccudart/utils.pyx":2683
 *         while (d != e.depth):
 *             err = memset2DPtr(ptr, p.pitch, val, e.width, e.height, sid, async)
 *             if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *                 return err
 *             ptr += p.pitch * p.ysize
 */
      }

      /* "cuda/_lib/ccudart/utils.pyx":2685
 *             if err != cudaSuccess:
 *                 return err
 *             ptr += p.pitch * p.ysize             # <<<<<<<<<<<<<<
 *             d += 1
 *     return cudaSuccess
 */
      __pyx_v_ptr = (__pyx_v_ptr + (__pyx_v_p.pitch * __pyx_v_p.ysize));

      /* "cuda/_lib/ccudart/utils.pyx":2686
 *                 return err
 *             ptr += p.pitch * p.ysize
 *             d += 1             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
      __pyx_v_d = (__pyx_v_d + 1);
    }
  }

  /* "cuda/_lib/ccudart/utils.pyx":2687
 *             ptr += p.pitch * p.ysize
 *             d += 1
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2661
 * 
 * 
 * cdef cudaError_t memset3DPtr(cudaPitchedPtr p, int val, cudaExtent e, cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     if e.width == 0 or e.height == 0 or e.depth == 0:
 *         return cudaSuccess
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2690
 * 
 * 
 * cdef cudaError_t memcpyToArray(cudaArray_t dst, size_t hOffset, size_t wOffset, const char *src,             # <<<<<<<<<<<<<<
 *                                size_t count, cudaMemcpyKind kind,
 *                                cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyToArray(cudaArray_t __pyx_v_dst, size_t __pyx_v_hOffset, size_t __pyx_v_wOffset, char const *__pyx_v_src, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind, cudaStream_t __pyx_v_sid, bool __pyx_v_async) {
  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("memcpyToArray", __pyx_f[0], 2690, 1, __PYX_ERR(0, 2690, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2693
 *                                size_t count, cudaMemcpyKind kind,
 *                                cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if count == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  __pyx_t_1 = (__pyx_v_count == 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2694
 *                                cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if count == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2693
 *                                size_t count, cudaMemcpyKind kind,
 *                                cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if count == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2696
 *         return cudaSuccess
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToDevice:             # <<<<<<<<<<<<<<
 *         return copyFromHost(dst, hOffset, wOffset, src, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 */
  switch (__pyx_v_kind) {
    case cudaMemcpyHostToDevice:

    /* "cuda/_lib/ccudart/utils.pyx":2697
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 *         return copyFromHost(dst, hOffset, wOffset, src, count, sid, async)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         return copyFromDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, dst, hOffset, wOffset, src, 0, count, sid, async)
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromHost(__pyx_v_dst, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_src, __pyx_v_count, __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2697, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2696
 *         return cudaSuccess
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToDevice:             # <<<<<<<<<<<<<<
 *         return copyFromHost(dst, hOffset, wOffset, src, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 */
    break;
    case cudaMemcpyDeviceToDevice:

    /* "cuda/_lib/ccudart/utils.pyx":2699
 *         return copyFromHost(dst, hOffset, wOffset, src, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         return copyFromDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, dst, hOffset, wOffset, src, 0, count, sid, async)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         return copyFromDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, dst, hOffset, wOffset, src, 0, count, sid, async)
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromDevice(CU_MEMORYTYPE_DEVICE, __pyx_v_dst, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_src, 0, __pyx_v_count, __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2699, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2698
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 *         return copyFromHost(dst, hOffset, wOffset, src, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:             # <<<<<<<<<<<<<<
 *         return copyFromDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, dst, hOffset, wOffset, src, 0, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 */
    break;
    case cudaMemcpyDefault:

    /* "cuda/_lib/ccudart/utils.pyx":2701
 *         return copyFromDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, dst, hOffset, wOffset, src, 0, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         return copyFromDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, dst, hOffset, wOffset, src, 0, count, sid, async)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost or kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         return cudaErrorInvalidMemcpyDirection
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromDevice(CU_MEMORYTYPE_UNIFIED, __pyx_v_dst, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_src, 0, __pyx_v_count, __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2701, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2700
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         return copyFromDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, dst, hOffset, wOffset, src, 0, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:             # <<<<<<<<<<<<<<
 *         return copyFromDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, dst, hOffset, wOffset, src, 0, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost or kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 */
    break;
    case cudaMemcpyHostToHost:

    /* "cuda/_lib/ccudart/utils.pyx":2702
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         return copyFromDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, dst, hOffset, wOffset, src, 0, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost or kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidMemcpyDirection
 *     return cudaSuccess
 */
    case cudaMemcpyDeviceToHost:

    /* "cuda/_lib/ccudart/utils.pyx":2703
 *         return copyFromDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, dst, hOffset, wOffset, src, 0, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost or kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         return cudaErrorInvalidMemcpyDirection             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
    __pyx_r = cudaErrorInvalidMemcpyDirection;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2702
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         return copyFromDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, dst, hOffset, wOffset, src, 0, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost or kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidMemcpyDirection
 *     return cudaSuccess
 */
    break;
    default: break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2704
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost or kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         return cudaErrorInvalidMemcpyDirection
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2690
 * 
 * 
 * cdef cudaError_t memcpyToArray(cudaArray_t dst, size_t hOffset, size_t wOffset, const char *src,             # <<<<<<<<<<<<<<
 *                                size_t count, cudaMemcpyKind kind,
 *                                cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2707
 * 
 * 
 * cdef cudaError_t memcpyFromArray(char *dst, cudaArray_const_t src, size_t hOffset, size_t wOffset,             # <<<<<<<<<<<<<<
 *                                  size_t count, cudaMemcpyKind kind,
 *                                  cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_memcpyFromArray(char *__pyx_v_dst, cudaArray_const_t __pyx_v_src, size_t __pyx_v_hOffset, size_t __pyx_v_wOffset, size_t __pyx_v_count, enum cudaMemcpyKind __pyx_v_kind, cudaStream_t __pyx_v_sid, bool __pyx_v_async) {
  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("memcpyFromArray", __pyx_f[0], 2707, 1, __PYX_ERR(0, 2707, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2710
 *                                  size_t count, cudaMemcpyKind kind,
 *                                  cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if count == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  __pyx_t_1 = (__pyx_v_count == 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2711
 *                                  cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if count == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2710
 *                                  size_t count, cudaMemcpyKind kind,
 *                                  cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     if count == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2713
 *         return cudaSuccess
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:             # <<<<<<<<<<<<<<
 *         return copyToHost(src, hOffset, wOffset, dst, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 */
  switch (__pyx_v_kind) {
    case cudaMemcpyDeviceToHost:

    /* "cuda/_lib/ccudart/utils.pyx":2714
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         return copyToHost(src, hOffset, wOffset, dst, count, sid, async)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         return copyToDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, src, hOffset, wOffset, dst, 0, count, sid, async)
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToHost(__pyx_v_src, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_dst, __pyx_v_count, __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2714, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2713
 *         return cudaSuccess
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:             # <<<<<<<<<<<<<<
 *         return copyToHost(src, hOffset, wOffset, dst, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 */
    break;
    case cudaMemcpyDeviceToDevice:

    /* "cuda/_lib/ccudart/utils.pyx":2716
 *         return copyToHost(src, hOffset, wOffset, dst, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         return copyToDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, src, hOffset, wOffset, dst, 0, count, sid, async)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         return copyToDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, src, hOffset, wOffset, dst, 0, count, sid, async)
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToDevice(CU_MEMORYTYPE_DEVICE, __pyx_v_src, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_dst, 0, __pyx_v_count, __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2716, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2715
 *     if kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         return copyToHost(src, hOffset, wOffset, dst, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:             # <<<<<<<<<<<<<<
 *         return copyToDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, src, hOffset, wOffset, dst, 0, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 */
    break;
    case cudaMemcpyDefault:

    /* "cuda/_lib/ccudart/utils.pyx":2718
 *         return copyToDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, src, hOffset, wOffset, dst, 0, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         return copyToDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, src, hOffset, wOffset, dst, 0, count, sid, async)             # <<<<<<<<<<<<<<
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice or kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 *         return cudaErrorInvalidMemcpyDirection
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_copyToDevice(CU_MEMORYTYPE_UNIFIED, __pyx_v_src, __pyx_v_hOffset, __pyx_v_wOffset, __pyx_v_dst, 0, __pyx_v_count, __pyx_v_sid, __pyx_v_async); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2718, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2717
 *     elif kind == cudaMemcpyKind.cudaMemcpyDeviceToDevice:
 *         return copyToDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, src, hOffset, wOffset, dst, 0, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:             # <<<<<<<<<<<<<<
 *         return copyToDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, src, hOffset, wOffset, dst, 0, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice or kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 */
    break;
    case cudaMemcpyHostToDevice:

    /* "cuda/_lib/ccudart/utils.pyx":2719
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         return copyToDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, src, hOffset, wOffset, dst, 0, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice or kind == cudaMemcpyKind.cudaMemcpyHostToHost:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidMemcpyDirection
 *     return cudaSuccess
 */
    case cudaMemcpyHostToHost:

    /* "cuda/_lib/ccudart/utils.pyx":2720
 *         return copyToDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, src, hOffset, wOffset, dst, 0, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice or kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 *         return cudaErrorInvalidMemcpyDirection             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
    __pyx_r = cudaErrorInvalidMemcpyDirection;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2719
 *     elif kind == cudaMemcpyKind.cudaMemcpyDefault:
 *         return copyToDevice(ccuda.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, src, hOffset, wOffset, dst, 0, count, sid, async)
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice or kind == cudaMemcpyKind.cudaMemcpyHostToHost:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidMemcpyDirection
 *     return cudaSuccess
 */
    break;
    default: break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2721
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice or kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 *         return cudaErrorInvalidMemcpyDirection
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2707
 * 
 * 
 * cdef cudaError_t memcpyFromArray(char *dst, cudaArray_const_t src, size_t hOffset, size_t wOffset,             # <<<<<<<<<<<<<<
 *                                  size_t count, cudaMemcpyKind kind,
 *                                  cudaStream_t sid, bool async) except ?cudaErrorCallRequiresNewerDriver nogil:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2724
 * 
 * 
 * cdef cudaError_t toDriverCudaResourceDesc(ccuda.CUDA_RESOURCE_DESC *_driver_pResDesc, const cudaResourceDesc *pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef int numChannels
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverCudaResourceDesc(CUDA_RESOURCE_DESC *__pyx_v__driver_pResDesc, struct cudaResourceDesc const *__pyx_v_pResDesc) {
  cudaError_t __pyx_v_err;
  int __pyx_v_numChannels;
  CUarray_format __pyx_v_format;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  size_t __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("toDriverCudaResourceDesc", __pyx_f[0], 2724, 1, __PYX_ERR(0, 2724, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2725
 * 
 * cdef cudaError_t toDriverCudaResourceDesc(ccuda.CUDA_RESOURCE_DESC *_driver_pResDesc, const cudaResourceDesc *pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef int numChannels
 *     cdef ccuda.CUarray_format format
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":2729
 *     cdef ccuda.CUarray_format format
 * 
 *     if pResDesc[0].resType == cudaResourceType.cudaResourceTypeArray:             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].resType          = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY
 *         _driver_pResDesc[0].res.array.hArray = <ccuda.CUarray>pResDesc[0].res.array.array
 */
  __pyx_t_1 = ((__pyx_v_pResDesc[0]).resType == cudaResourceTypeArray);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2730
 * 
 *     if pResDesc[0].resType == cudaResourceType.cudaResourceTypeArray:
 *         _driver_pResDesc[0].resType          = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].res.array.hArray = <ccuda.CUarray>pResDesc[0].res.array.array
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypeMipmappedArray:
 */
    (__pyx_v__driver_pResDesc[0]).resType = CU_RESOURCE_TYPE_ARRAY;

    /* "cuda/_lib/ccudart/utils.pyx":2731
 *     if pResDesc[0].resType == cudaResourceType.cudaResourceTypeArray:
 *         _driver_pResDesc[0].resType          = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY
 *         _driver_pResDesc[0].res.array.hArray = <ccuda.CUarray>pResDesc[0].res.array.array             # <<<<<<<<<<<<<<
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypeMipmappedArray:
 *         _driver_pResDesc[0].resType                    = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY
 */
    (__pyx_v__driver_pResDesc[0]).res.array.hArray = ((CUarray)(__pyx_v_pResDesc[0]).res.array.array);

    /* "cuda/_lib/ccudart/utils.pyx":2729
 *     cdef ccuda.CUarray_format format
 * 
 *     if pResDesc[0].resType == cudaResourceType.cudaResourceTypeArray:             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].resType          = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY
 *         _driver_pResDesc[0].res.array.hArray = <ccuda.CUarray>pResDesc[0].res.array.array
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2732
 *         _driver_pResDesc[0].resType          = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY
 *         _driver_pResDesc[0].res.array.hArray = <ccuda.CUarray>pResDesc[0].res.array.array
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypeMipmappedArray:             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].resType                    = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY
 *         _driver_pResDesc[0].res.mipmap.hMipmappedArray = <ccuda.CUmipmappedArray>pResDesc[0].res.mipmap.mipmap
 */
  __pyx_t_1 = ((__pyx_v_pResDesc[0]).resType == cudaResourceTypeMipmappedArray);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2733
 *         _driver_pResDesc[0].res.array.hArray = <ccuda.CUarray>pResDesc[0].res.array.array
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypeMipmappedArray:
 *         _driver_pResDesc[0].resType                    = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].res.mipmap.hMipmappedArray = <ccuda.CUmipmappedArray>pResDesc[0].res.mipmap.mipmap
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypeLinear:
 */
    (__pyx_v__driver_pResDesc[0]).resType = CU_RESOURCE_TYPE_MIPMAPPED_ARRAY;

    /* "cuda/_lib/ccudart/utils.pyx":2734
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypeMipmappedArray:
 *         _driver_pResDesc[0].resType                    = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY
 *         _driver_pResDesc[0].res.mipmap.hMipmappedArray = <ccuda.CUmipmappedArray>pResDesc[0].res.mipmap.mipmap             # <<<<<<<<<<<<<<
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypeLinear:
 *         _driver_pResDesc[0].resType                = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR
 */
    (__pyx_v__driver_pResDesc[0]).res.mipmap.hMipmappedArray = ((CUmipmappedArray)(__pyx_v_pResDesc[0]).res.mipmap.mipmap);

    /* "cuda/_lib/ccudart/utils.pyx":2732
 *         _driver_pResDesc[0].resType          = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY
 *         _driver_pResDesc[0].res.array.hArray = <ccuda.CUarray>pResDesc[0].res.array.array
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypeMipmappedArray:             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].resType                    = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY
 *         _driver_pResDesc[0].res.mipmap.hMipmappedArray = <ccuda.CUmipmappedArray>pResDesc[0].res.mipmap.mipmap
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2735
 *         _driver_pResDesc[0].resType                    = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY
 *         _driver_pResDesc[0].res.mipmap.hMipmappedArray = <ccuda.CUmipmappedArray>pResDesc[0].res.mipmap.mipmap
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypeLinear:             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].resType                = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR
 *         _driver_pResDesc[0].res.linear.devPtr      = <ccuda.CUdeviceptr>pResDesc[0].res.linear.devPtr
 */
  __pyx_t_1 = ((__pyx_v_pResDesc[0]).resType == cudaResourceTypeLinear);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2736
 *         _driver_pResDesc[0].res.mipmap.hMipmappedArray = <ccuda.CUmipmappedArray>pResDesc[0].res.mipmap.mipmap
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypeLinear:
 *         _driver_pResDesc[0].resType                = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].res.linear.devPtr      = <ccuda.CUdeviceptr>pResDesc[0].res.linear.devPtr
 *         _driver_pResDesc[0].res.linear.sizeInBytes = pResDesc[0].res.linear.sizeInBytes
 */
    (__pyx_v__driver_pResDesc[0]).resType = CU_RESOURCE_TYPE_LINEAR;

    /* "cuda/_lib/ccudart/utils.pyx":2737
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypeLinear:
 *         _driver_pResDesc[0].resType                = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR
 *         _driver_pResDesc[0].res.linear.devPtr      = <ccuda.CUdeviceptr>pResDesc[0].res.linear.devPtr             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].res.linear.sizeInBytes = pResDesc[0].res.linear.sizeInBytes
 *         err = getDescInfo(&pResDesc[0].res.linear.desc, &numChannels, &format)
 */
    (__pyx_v__driver_pResDesc[0]).res.linear.devPtr = ((CUdeviceptr)(__pyx_v_pResDesc[0]).res.linear.devPtr);

    /* "cuda/_lib/ccudart/utils.pyx":2738
 *         _driver_pResDesc[0].resType                = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR
 *         _driver_pResDesc[0].res.linear.devPtr      = <ccuda.CUdeviceptr>pResDesc[0].res.linear.devPtr
 *         _driver_pResDesc[0].res.linear.sizeInBytes = pResDesc[0].res.linear.sizeInBytes             # <<<<<<<<<<<<<<
 *         err = getDescInfo(&pResDesc[0].res.linear.desc, &numChannels, &format)
 *         if err != cudaSuccess:
 */
    __pyx_t_2 = (__pyx_v_pResDesc[0]).res.linear.sizeInBytes;
    (__pyx_v__driver_pResDesc[0]).res.linear.sizeInBytes = __pyx_t_2;

    /* "cuda/_lib/ccudart/utils.pyx":2739
 *         _driver_pResDesc[0].res.linear.devPtr      = <ccuda.CUdeviceptr>pResDesc[0].res.linear.devPtr
 *         _driver_pResDesc[0].res.linear.sizeInBytes = pResDesc[0].res.linear.sizeInBytes
 *         err = getDescInfo(&pResDesc[0].res.linear.desc, &numChannels, &format)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo((&(__pyx_v_pResDesc[0]).res.linear.desc), (&__pyx_v_numChannels), (&__pyx_v_format)); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2739, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2740
 *         _driver_pResDesc[0].res.linear.sizeInBytes = pResDesc[0].res.linear.sizeInBytes
 *         err = getDescInfo(&pResDesc[0].res.linear.desc, &numChannels, &format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2741
 *         err = getDescInfo(&pResDesc[0].res.linear.desc, &numChannels, &format)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *         _driver_pResDesc[0].res.linear.format      = format
 */
      __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, 2741, __pyx_L1_error)

      /* "cuda/_lib/ccudart/utils.pyx":2742
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].res.linear.format      = format
 *         _driver_pResDesc[0].res.linear.numChannels = numChannels
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2740
 *         _driver_pResDesc[0].res.linear.sizeInBytes = pResDesc[0].res.linear.sizeInBytes
 *         err = getDescInfo(&pResDesc[0].res.linear.desc, &numChannels, &format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2743
 *             _setLastError(err)
 *             return err
 *         _driver_pResDesc[0].res.linear.format      = format             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].res.linear.numChannels = numChannels
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypePitch2D:
 */
    (__pyx_v__driver_pResDesc[0]).res.linear.format = __pyx_v_format;

    /* "cuda/_lib/ccudart/utils.pyx":2744
 *             return err
 *         _driver_pResDesc[0].res.linear.format      = format
 *         _driver_pResDesc[0].res.linear.numChannels = numChannels             # <<<<<<<<<<<<<<
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypePitch2D:
 *         _driver_pResDesc[0].resType                  = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D
 */
    (__pyx_v__driver_pResDesc[0]).res.linear.numChannels = __pyx_v_numChannels;

    /* "cuda/_lib/ccudart/utils.pyx":2735
 *         _driver_pResDesc[0].resType                    = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY
 *         _driver_pResDesc[0].res.mipmap.hMipmappedArray = <ccuda.CUmipmappedArray>pResDesc[0].res.mipmap.mipmap
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypeLinear:             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].resType                = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR
 *         _driver_pResDesc[0].res.linear.devPtr      = <ccuda.CUdeviceptr>pResDesc[0].res.linear.devPtr
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2745
 *         _driver_pResDesc[0].res.linear.format      = format
 *         _driver_pResDesc[0].res.linear.numChannels = numChannels
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypePitch2D:             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].resType                  = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D
 *         _driver_pResDesc[0].res.pitch2D.devPtr       = <ccuda.CUdeviceptr>pResDesc[0].res.pitch2D.devPtr
 */
  __pyx_t_1 = ((__pyx_v_pResDesc[0]).resType == cudaResourceTypePitch2D);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2746
 *         _driver_pResDesc[0].res.linear.numChannels = numChannels
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypePitch2D:
 *         _driver_pResDesc[0].resType                  = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].res.pitch2D.devPtr       = <ccuda.CUdeviceptr>pResDesc[0].res.pitch2D.devPtr
 *         _driver_pResDesc[0].res.pitch2D.pitchInBytes = pResDesc[0].res.pitch2D.pitchInBytes
 */
    (__pyx_v__driver_pResDesc[0]).resType = CU_RESOURCE_TYPE_PITCH2D;

    /* "cuda/_lib/ccudart/utils.pyx":2747
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypePitch2D:
 *         _driver_pResDesc[0].resType                  = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D
 *         _driver_pResDesc[0].res.pitch2D.devPtr       = <ccuda.CUdeviceptr>pResDesc[0].res.pitch2D.devPtr             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].res.pitch2D.pitchInBytes = pResDesc[0].res.pitch2D.pitchInBytes
 *         _driver_pResDesc[0].res.pitch2D.width        = pResDesc[0].res.pitch2D.width
 */
    (__pyx_v__driver_pResDesc[0]).res.pitch2D.devPtr = ((CUdeviceptr)(__pyx_v_pResDesc[0]).res.pitch2D.devPtr);

    /* "cuda/_lib/ccudart/utils.pyx":2748
 *         _driver_pResDesc[0].resType                  = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D
 *         _driver_pResDesc[0].res.pitch2D.devPtr       = <ccuda.CUdeviceptr>pResDesc[0].res.pitch2D.devPtr
 *         _driver_pResDesc[0].res.pitch2D.pitchInBytes = pResDesc[0].res.pitch2D.pitchInBytes             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].res.pitch2D.width        = pResDesc[0].res.pitch2D.width
 *         _driver_pResDesc[0].res.pitch2D.height       = pResDesc[0].res.pitch2D.height
 */
    __pyx_t_2 = (__pyx_v_pResDesc[0]).res.pitch2D.pitchInBytes;
    (__pyx_v__driver_pResDesc[0]).res.pitch2D.pitchInBytes = __pyx_t_2;

    /* "cuda/_lib/ccudart/utils.pyx":2749
 *         _driver_pResDesc[0].res.pitch2D.devPtr       = <ccuda.CUdeviceptr>pResDesc[0].res.pitch2D.devPtr
 *         _driver_pResDesc[0].res.pitch2D.pitchInBytes = pResDesc[0].res.pitch2D.pitchInBytes
 *         _driver_pResDesc[0].res.pitch2D.width        = pResDesc[0].res.pitch2D.width             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].res.pitch2D.height       = pResDesc[0].res.pitch2D.height
 *         err = getDescInfo(&pResDesc[0].res.linear.desc, &numChannels, &format)
 */
    __pyx_t_2 = (__pyx_v_pResDesc[0]).res.pitch2D.width;
    (__pyx_v__driver_pResDesc[0]).res.pitch2D.width = __pyx_t_2;

    /* "cuda/_lib/ccudart/utils.pyx":2750
 *         _driver_pResDesc[0].res.pitch2D.pitchInBytes = pResDesc[0].res.pitch2D.pitchInBytes
 *         _driver_pResDesc[0].res.pitch2D.width        = pResDesc[0].res.pitch2D.width
 *         _driver_pResDesc[0].res.pitch2D.height       = pResDesc[0].res.pitch2D.height             # <<<<<<<<<<<<<<
 *         err = getDescInfo(&pResDesc[0].res.linear.desc, &numChannels, &format)
 *         if err != cudaSuccess:
 */
    __pyx_t_2 = (__pyx_v_pResDesc[0]).res.pitch2D.height;
    (__pyx_v__driver_pResDesc[0]).res.pitch2D.height = __pyx_t_2;

    /* "cuda/_lib/ccudart/utils.pyx":2751
 *         _driver_pResDesc[0].res.pitch2D.width        = pResDesc[0].res.pitch2D.width
 *         _driver_pResDesc[0].res.pitch2D.height       = pResDesc[0].res.pitch2D.height
 *         err = getDescInfo(&pResDesc[0].res.linear.desc, &numChannels, &format)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             _setLastError(err)
 */
    __pyx_t_3 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo((&(__pyx_v_pResDesc[0]).res.linear.desc), (&__pyx_v_numChannels), (&__pyx_v_format)); if (unlikely(__pyx_t_3 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2751, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2752
 *         _driver_pResDesc[0].res.pitch2D.height       = pResDesc[0].res.pitch2D.height
 *         err = getDescInfo(&pResDesc[0].res.linear.desc, &numChannels, &format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2753
 *         err = getDescInfo(&pResDesc[0].res.linear.desc, &numChannels, &format)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *         _driver_pResDesc[0].res.pitch2D.format       = format
 */
      __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, 2753, __pyx_L1_error)

      /* "cuda/_lib/ccudart/utils.pyx":2754
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].res.pitch2D.format       = format
 *         _driver_pResDesc[0].res.pitch2D.numChannels  = numChannels
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2752
 *         _driver_pResDesc[0].res.pitch2D.height       = pResDesc[0].res.pitch2D.height
 *         err = getDescInfo(&pResDesc[0].res.linear.desc, &numChannels, &format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2755
 *             _setLastError(err)
 *             return err
 *         _driver_pResDesc[0].res.pitch2D.format       = format             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].res.pitch2D.numChannels  = numChannels
 *     else:
 */
    (__pyx_v__driver_pResDesc[0]).res.pitch2D.format = __pyx_v_format;

    /* "cuda/_lib/ccudart/utils.pyx":2756
 *             return err
 *         _driver_pResDesc[0].res.pitch2D.format       = format
 *         _driver_pResDesc[0].res.pitch2D.numChannels  = numChannels             # <<<<<<<<<<<<<<
 *     else:
 *         _setLastError(cudaErrorInvalidValue)
 */
    (__pyx_v__driver_pResDesc[0]).res.pitch2D.numChannels = __pyx_v_numChannels;

    /* "cuda/_lib/ccudart/utils.pyx":2745
 *         _driver_pResDesc[0].res.linear.format      = format
 *         _driver_pResDesc[0].res.linear.numChannels = numChannels
 *     elif pResDesc[0].resType == cudaResourceType.cudaResourceTypePitch2D:             # <<<<<<<<<<<<<<
 *         _driver_pResDesc[0].resType                  = ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D
 *         _driver_pResDesc[0].res.pitch2D.devPtr       = <ccuda.CUdeviceptr>pResDesc[0].res.pitch2D.devPtr
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2758
 *         _driver_pResDesc[0].res.pitch2D.numChannels  = numChannels
 *     else:
 *         _setLastError(cudaErrorInvalidValue)             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 *     _driver_pResDesc[0].flags = 0
 */
  /*else*/ {
    __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, 2758, __pyx_L1_error)

    /* "cuda/_lib/ccudart/utils.pyx":2759
 *     else:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     _driver_pResDesc[0].flags = 0
 * 
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "cuda/_lib/ccudart/utils.pyx":2760
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 *     _driver_pResDesc[0].flags = 0             # <<<<<<<<<<<<<<
 * 
 *     return err
 */
  (__pyx_v__driver_pResDesc[0]).flags = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2762
 *     _driver_pResDesc[0].flags = 0
 * 
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2724
 * 
 * 
 * cdef cudaError_t toDriverCudaResourceDesc(ccuda.CUDA_RESOURCE_DESC *_driver_pResDesc, const cudaResourceDesc *pResDesc) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef int numChannels
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2765
 * 
 * 
 * cdef cudaError_t getDriverEglFrame(ccuda.CUeglFrame *cuEglFrame, cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef unsigned int i = 0
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_getDriverEglFrame(__pyx_t_4cuda_5ccuda_CUeglFrame *__pyx_v_cuEglFrame, __pyx_t_4cuda_7ccudart_cudaEglFrame __pyx_v_eglFrame) {
  cudaError_t __pyx_v_err;
  unsigned int __pyx_v_i;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  cudaError_t __pyx_t_1;
  int __pyx_t_2;
  unsigned int __pyx_t_3;
  unsigned int __pyx_t_4;
  unsigned int __pyx_t_5;
  void *__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("getDriverEglFrame", __pyx_f[0], 2765, 1, __PYX_ERR(0, 2765, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2766
 * 
 * cdef cudaError_t getDriverEglFrame(ccuda.CUeglFrame *cuEglFrame, cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef unsigned int i = 0
 * 
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":2767
 * cdef cudaError_t getDriverEglFrame(ccuda.CUeglFrame *cuEglFrame, cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     cdef unsigned int i = 0             # <<<<<<<<<<<<<<
 * 
 *     err = getDescInfo(&eglFrame.planeDesc[0].channelDesc, <int*>&cuEglFrame[0].numChannels, &cuEglFrame[0].cuFormat)
 */
  __pyx_v_i = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2769
 *     cdef unsigned int i = 0
 * 
 *     err = getDescInfo(&eglFrame.planeDesc[0].channelDesc, <int*>&cuEglFrame[0].numChannels, &cuEglFrame[0].cuFormat)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         return err
 */
  __pyx_t_1 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getDescInfo((&(__pyx_v_eglFrame.planeDesc[0]).channelDesc), ((int *)(&(__pyx_v_cuEglFrame[0]).numChannels)), (&(__pyx_v_cuEglFrame[0]).cuFormat)); if (unlikely(__pyx_t_1 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2769, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":2770
 * 
 *     err = getDescInfo(&eglFrame.planeDesc[0].channelDesc, <int*>&cuEglFrame[0].numChannels, &cuEglFrame[0].cuFormat)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     for i in range(eglFrame.planeCount):
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":2771
 *     err = getDescInfo(&eglFrame.planeDesc[0].channelDesc, <int*>&cuEglFrame[0].numChannels, &cuEglFrame[0].cuFormat)
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 *     for i in range(eglFrame.planeCount):
 *         if eglFrame.frameType == cudaEglFrameTypeArray:
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2770
 * 
 *     err = getDescInfo(&eglFrame.planeDesc[0].channelDesc, <int*>&cuEglFrame[0].numChannels, &cuEglFrame[0].cuFormat)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     for i in range(eglFrame.planeCount):
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2772
 *     if err != cudaSuccess:
 *         return err
 *     for i in range(eglFrame.planeCount):             # <<<<<<<<<<<<<<
 *         if eglFrame.frameType == cudaEglFrameTypeArray:
 *             cuEglFrame[0].frame.pArray[i] = <ccuda.CUarray>eglFrame.frame.pArray[i]
 */
  __pyx_t_3 = __pyx_v_eglFrame.planeCount;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":2773
 *         return err
 *     for i in range(eglFrame.planeCount):
 *         if eglFrame.frameType == cudaEglFrameTypeArray:             # <<<<<<<<<<<<<<
 *             cuEglFrame[0].frame.pArray[i] = <ccuda.CUarray>eglFrame.frame.pArray[i]
 *         else:
 */
    __pyx_t_2 = (__pyx_v_eglFrame.frameType == __pyx_e_4cuda_7ccudart_cudaEglFrameTypeArray);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":2774
 *     for i in range(eglFrame.planeCount):
 *         if eglFrame.frameType == cudaEglFrameTypeArray:
 *             cuEglFrame[0].frame.pArray[i] = <ccuda.CUarray>eglFrame.frame.pArray[i]             # <<<<<<<<<<<<<<
 *         else:
 *             cuEglFrame[0].frame.pPitch[i] = eglFrame.frame.pPitch[i].ptr
 */
      ((__pyx_v_cuEglFrame[0]).frame.pArray[__pyx_v_i]) = ((CUarray)(__pyx_v_eglFrame.frame.pArray[__pyx_v_i]));

      /* "cuda/_lib/ccudart/utils.pyx":2773
 *         return err
 *     for i in range(eglFrame.planeCount):
 *         if eglFrame.frameType == cudaEglFrameTypeArray:             # <<<<<<<<<<<<<<
 *             cuEglFrame[0].frame.pArray[i] = <ccuda.CUarray>eglFrame.frame.pArray[i]
 *         else:
 */
      goto __pyx_L6;
    }

    /* "cuda/_lib/ccudart/utils.pyx":2776
 *             cuEglFrame[0].frame.pArray[i] = <ccuda.CUarray>eglFrame.frame.pArray[i]
 *         else:
 *             cuEglFrame[0].frame.pPitch[i] = eglFrame.frame.pPitch[i].ptr             # <<<<<<<<<<<<<<
 *     cuEglFrame[0].width = eglFrame.planeDesc[0].width
 *     cuEglFrame[0].height = eglFrame.planeDesc[0].height
 */
    /*else*/ {
      __pyx_t_6 = (__pyx_v_eglFrame.frame.pPitch[__pyx_v_i]).ptr;
      ((__pyx_v_cuEglFrame[0]).frame.pPitch[__pyx_v_i]) = __pyx_t_6;
    }
    __pyx_L6:;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2777
 *         else:
 *             cuEglFrame[0].frame.pPitch[i] = eglFrame.frame.pPitch[i].ptr
 *     cuEglFrame[0].width = eglFrame.planeDesc[0].width             # <<<<<<<<<<<<<<
 *     cuEglFrame[0].height = eglFrame.planeDesc[0].height
 *     cuEglFrame[0].depth = eglFrame.planeDesc[0].depth
 */
  __pyx_t_3 = (__pyx_v_eglFrame.planeDesc[0]).width;
  (__pyx_v_cuEglFrame[0]).width = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":2778
 *             cuEglFrame[0].frame.pPitch[i] = eglFrame.frame.pPitch[i].ptr
 *     cuEglFrame[0].width = eglFrame.planeDesc[0].width
 *     cuEglFrame[0].height = eglFrame.planeDesc[0].height             # <<<<<<<<<<<<<<
 *     cuEglFrame[0].depth = eglFrame.planeDesc[0].depth
 *     cuEglFrame[0].pitch = eglFrame.planeDesc[0].pitch
 */
  __pyx_t_3 = (__pyx_v_eglFrame.planeDesc[0]).height;
  (__pyx_v_cuEglFrame[0]).height = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":2779
 *     cuEglFrame[0].width = eglFrame.planeDesc[0].width
 *     cuEglFrame[0].height = eglFrame.planeDesc[0].height
 *     cuEglFrame[0].depth = eglFrame.planeDesc[0].depth             # <<<<<<<<<<<<<<
 *     cuEglFrame[0].pitch = eglFrame.planeDesc[0].pitch
 *     cuEglFrame[0].planeCount = eglFrame.planeCount
 */
  __pyx_t_3 = (__pyx_v_eglFrame.planeDesc[0]).depth;
  (__pyx_v_cuEglFrame[0]).depth = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":2780
 *     cuEglFrame[0].height = eglFrame.planeDesc[0].height
 *     cuEglFrame[0].depth = eglFrame.planeDesc[0].depth
 *     cuEglFrame[0].pitch = eglFrame.planeDesc[0].pitch             # <<<<<<<<<<<<<<
 *     cuEglFrame[0].planeCount = eglFrame.planeCount
 *     if eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar:
 */
  __pyx_t_3 = (__pyx_v_eglFrame.planeDesc[0]).pitch;
  (__pyx_v_cuEglFrame[0]).pitch = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":2781
 *     cuEglFrame[0].depth = eglFrame.planeDesc[0].depth
 *     cuEglFrame[0].pitch = eglFrame.planeDesc[0].pitch
 *     cuEglFrame[0].planeCount = eglFrame.planeCount             # <<<<<<<<<<<<<<
 *     if eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR
 */
  __pyx_t_3 = __pyx_v_eglFrame.planeCount;
  (__pyx_v_cuEglFrame[0]).planeCount = __pyx_t_3;

  /* "cuda/_lib/ccudart/utils.pyx":2782
 *     cuEglFrame[0].pitch = eglFrame.planeDesc[0].pitch
 *     cuEglFrame[0].planeCount = eglFrame.planeCount
 *     if eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar:
 */
  switch (__pyx_v_eglFrame.eglColorFormat) {
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420Planar:

    /* "cuda/_lib/ccudart/utils.pyx":2783
 *     cuEglFrame[0].planeCount = eglFrame.planeCount
 *     if eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_PLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2782
 *     cuEglFrame[0].pitch = eglFrame.planeDesc[0].pitch
 *     cuEglFrame[0].planeCount = eglFrame.planeCount
 *     if eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420SemiPlanar:

    /* "cuda/_lib/ccudart/utils.pyx":2785
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2784
 *     if eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422Planar:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV422Planar:

    /* "cuda/_lib/ccudart/utils.pyx":2787
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV422_PLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2786
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422Planar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422SemiPlanar:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV422SemiPlanar:

    /* "cuda/_lib/ccudart/utils.pyx":2789
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2788
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422SemiPlanar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444Planar:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV444Planar:

    /* "cuda/_lib/ccudart/utils.pyx":2791
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV444_PLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2790
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444Planar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444SemiPlanar:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV444SemiPlanar:

    /* "cuda/_lib/ccudart/utils.pyx":2793
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUYV422:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2792
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444SemiPlanar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUYV422:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUYV422:

    /* "cuda/_lib/ccudart/utils.pyx":2795
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUYV422:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY422:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUYV_422;

    /* "cuda/_lib/ccudart/utils.pyx":2794
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUYV422:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY422:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatUYVY422:

    /* "cuda/_lib/ccudart/utils.pyx":2797
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY422:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatARGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_UYVY_422;

    /* "cuda/_lib/ccudart/utils.pyx":2796
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUYV422:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY422:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatARGB:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatARGB:

    /* "cuda/_lib/ccudart/utils.pyx":2799
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatARGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatRGBA:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_ARGB;

    /* "cuda/_lib/ccudart/utils.pyx":2798
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY422:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatARGB:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatRGBA:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatRGBA:

    /* "cuda/_lib/ccudart/utils.pyx":2801
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatRGBA:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatABGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_RGBA;

    /* "cuda/_lib/ccudart/utils.pyx":2800
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatARGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatRGBA:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatABGR:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatABGR:

    /* "cuda/_lib/ccudart/utils.pyx":2803
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatABGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBGRA:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_ABGR;

    /* "cuda/_lib/ccudart/utils.pyx":2802
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatRGBA:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatABGR:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBGRA:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBGRA:

    /* "cuda/_lib/ccudart/utils.pyx":2805
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBGRA:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatL:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BGRA;

    /* "cuda/_lib/ccudart/utils.pyx":2804
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatABGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBGRA:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatL:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatL:

    /* "cuda/_lib/ccudart/utils.pyx":2807
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatL:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_L;

    /* "cuda/_lib/ccudart/utils.pyx":2806
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBGRA:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatL:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatR:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatR:

    /* "cuda/_lib/ccudart/utils.pyx":2809
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatA:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_R;

    /* "cuda/_lib/ccudart/utils.pyx":2808
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatL:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatR:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatA:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatA:

    /* "cuda/_lib/ccudart/utils.pyx":2811
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatA:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_A;

    /* "cuda/_lib/ccudart/utils.pyx":2810
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatA:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatRG:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatRG:

    /* "cuda/_lib/ccudart/utils.pyx":2813
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatAYUV:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_RG;

    /* "cuda/_lib/ccudart/utils.pyx":2812
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatA:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatRG:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatAYUV:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatAYUV:

    /* "cuda/_lib/ccudart/utils.pyx":2815
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatAYUV:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_AYUV;

    /* "cuda/_lib/ccudart/utils.pyx":2814
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatAYUV:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444SemiPlanar:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU444SemiPlanar:

    /* "cuda/_lib/ccudart/utils.pyx":2817
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2816
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatAYUV:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444SemiPlanar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422SemiPlanar:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU422SemiPlanar:

    /* "cuda/_lib/ccudart/utils.pyx":2819
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2818
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422SemiPlanar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420SemiPlanar:

    /* "cuda/_lib/ccudart/utils.pyx":2821
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2820
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_444SemiPlanar:

    /* "cuda/_lib/ccudart/utils.pyx":2823
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2822
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_420SemiPlanar:

    /* "cuda/_lib/ccudart/utils.pyx":2825
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2824
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_444SemiPlanar:

    /* "cuda/_lib/ccudart/utils.pyx":2827
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2826
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_420SemiPlanar:

    /* "cuda/_lib/ccudart/utils.pyx":2829
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatVYUY_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2828
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatVYUY_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatVYUY_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2831
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatVYUY_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_VYUY_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2830
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatVYUY_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatUYVY_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2833
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUYV_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_UYVY_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2832
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatVYUY_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUYV_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUYV_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2835
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUYV_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVYU_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUYV_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2834
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUYV_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVYU_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVYU_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2837
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVYU_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUVA_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVYU_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2836
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUYV_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVYU_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUVA_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUVA_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2839
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUVA_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatAYUV_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUVA_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2838
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVYU_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUVA_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatAYUV_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatAYUV_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2841
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatAYUV_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_AYUV_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2840
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUVA_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatAYUV_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444Planar_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV444Planar_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2843
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2842
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatAYUV_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444Planar_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422Planar_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV422Planar_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2845
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2844
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422Planar_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420Planar_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2847
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2846
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444SemiPlanar_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV444SemiPlanar_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2849
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2848
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444SemiPlanar_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422SemiPlanar_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV422SemiPlanar_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2851
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2850
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422SemiPlanar_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420SemiPlanar_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2853
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2852
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444Planar_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU444Planar_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2855
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2854
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444Planar_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422Planar_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU422Planar_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2857
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2856
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422Planar_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420Planar_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2859
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2858
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444SemiPlanar_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU444SemiPlanar_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2861
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2860
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444SemiPlanar_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422SemiPlanar_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU422SemiPlanar_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2863
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2862
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422SemiPlanar_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420SemiPlanar_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2865
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerRGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2864
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerRGGB:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerRGGB:

    /* "cuda/_lib/ccudart/utils.pyx":2867
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerRGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerBGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_RGGB;

    /* "cuda/_lib/ccudart/utils.pyx":2866
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerRGGB:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerBGGR:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerBGGR:

    /* "cuda/_lib/ccudart/utils.pyx":2869
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerBGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerGRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_BGGR;

    /* "cuda/_lib/ccudart/utils.pyx":2868
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerRGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerBGGR:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerGRBG:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerGRBG:

    /* "cuda/_lib/ccudart/utils.pyx":2871
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerGRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerGBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_GRBG;

    /* "cuda/_lib/ccudart/utils.pyx":2870
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerBGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerGRBG:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerGBRG:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerGBRG:

    /* "cuda/_lib/ccudart/utils.pyx":2873
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerGBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10RGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_GBRG;

    /* "cuda/_lib/ccudart/utils.pyx":2872
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerGRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerGBRG:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10RGGB:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer10RGGB:

    /* "cuda/_lib/ccudart/utils.pyx":2875
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10RGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10BGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER10_RGGB;

    /* "cuda/_lib/ccudart/utils.pyx":2874
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerGBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10RGGB:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10BGGR:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer10BGGR:

    /* "cuda/_lib/ccudart/utils.pyx":2877
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10BGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10GRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER10_BGGR;

    /* "cuda/_lib/ccudart/utils.pyx":2876
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10RGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10BGGR:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10GRBG:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer10GRBG:

    /* "cuda/_lib/ccudart/utils.pyx":2879
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10GRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10GBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER10_GRBG;

    /* "cuda/_lib/ccudart/utils.pyx":2878
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10BGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10GRBG:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10GBRG:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer10GBRG:

    /* "cuda/_lib/ccudart/utils.pyx":2881
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10GBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12RGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER10_GBRG;

    /* "cuda/_lib/ccudart/utils.pyx":2880
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10GRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10GBRG:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12RGGB:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12RGGB:

    /* "cuda/_lib/ccudart/utils.pyx":2883
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12RGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12BGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_RGGB;

    /* "cuda/_lib/ccudart/utils.pyx":2882
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10GBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12RGGB:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12BGGR:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12BGGR:

    /* "cuda/_lib/ccudart/utils.pyx":2885
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12BGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12GRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_BGGR;

    /* "cuda/_lib/ccudart/utils.pyx":2884
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12RGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12BGGR:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12GRBG:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12GRBG:

    /* "cuda/_lib/ccudart/utils.pyx":2887
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12GRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12GBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_GRBG;

    /* "cuda/_lib/ccudart/utils.pyx":2886
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12BGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12GRBG:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12GBRG:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12GBRG:

    /* "cuda/_lib/ccudart/utils.pyx":2889
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12GBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14RGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_GBRG;

    /* "cuda/_lib/ccudart/utils.pyx":2888
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12GRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12GBRG:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14RGGB:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer14RGGB:

    /* "cuda/_lib/ccudart/utils.pyx":2891
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14RGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14BGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER14_RGGB;

    /* "cuda/_lib/ccudart/utils.pyx":2890
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12GBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14RGGB:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14BGGR:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer14BGGR:

    /* "cuda/_lib/ccudart/utils.pyx":2893
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14BGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14GRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER14_BGGR;

    /* "cuda/_lib/ccudart/utils.pyx":2892
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14RGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14BGGR:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14GRBG:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer14GRBG:

    /* "cuda/_lib/ccudart/utils.pyx":2895
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14GRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14GBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER14_GRBG;

    /* "cuda/_lib/ccudart/utils.pyx":2894
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14BGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14GRBG:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14GBRG:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer14GBRG:

    /* "cuda/_lib/ccudart/utils.pyx":2897
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14GBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20RGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER14_GBRG;

    /* "cuda/_lib/ccudart/utils.pyx":2896
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14GRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14GBRG:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20RGGB:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer20RGGB:

    /* "cuda/_lib/ccudart/utils.pyx":2899
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20RGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20BGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER20_RGGB;

    /* "cuda/_lib/ccudart/utils.pyx":2898
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14GBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20RGGB:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20BGGR:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer20BGGR:

    /* "cuda/_lib/ccudart/utils.pyx":2901
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20BGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20GRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER20_BGGR;

    /* "cuda/_lib/ccudart/utils.pyx":2900
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20RGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20BGGR:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20GRBG:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer20GRBG:

    /* "cuda/_lib/ccudart/utils.pyx":2903
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20GRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20GBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER20_GRBG;

    /* "cuda/_lib/ccudart/utils.pyx":2902
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20BGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20GRBG:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20GBRG:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer20GBRG:

    /* "cuda/_lib/ccudart/utils.pyx":2905
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20GBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspRGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER20_GBRG;

    /* "cuda/_lib/ccudart/utils.pyx":2904
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20GRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20GBRG:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspRGGB:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerIspRGGB:

    /* "cuda/_lib/ccudart/utils.pyx":2907
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspRGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspBGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB;

    /* "cuda/_lib/ccudart/utils.pyx":2906
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20GBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspRGGB:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspBGGR:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerIspBGGR:

    /* "cuda/_lib/ccudart/utils.pyx":2909
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspBGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspGRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR;

    /* "cuda/_lib/ccudart/utils.pyx":2908
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspRGGB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspBGGR:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspGRBG:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerIspGRBG:

    /* "cuda/_lib/ccudart/utils.pyx":2911
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspGRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspGBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG;

    /* "cuda/_lib/ccudart/utils.pyx":2910
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspBGGR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspGRBG:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspGBRG:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerIspGBRG:

    /* "cuda/_lib/ccudart/utils.pyx":2913
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspGBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG;

    /* "cuda/_lib/ccudart/utils.pyx":2912
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspGRBG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspGBRG:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444Planar:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU444Planar:

    /* "cuda/_lib/ccudart/utils.pyx":2915
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU444_PLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2914
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspGBRG:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444Planar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422Planar:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU422Planar:

    /* "cuda/_lib/ccudart/utils.pyx":2917
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU422_PLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2916
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422Planar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420Planar:

    /* "cuda/_lib/ccudart/utils.pyx":2919
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerBCCR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_PLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2918
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerBCCR:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerBCCR:

    /* "cuda/_lib/ccudart/utils.pyx":2921
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerBCCR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerRCCB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_BCCR;

    /* "cuda/_lib/ccudart/utils.pyx":2920
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerBCCR:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerRCCB:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerRCCB:

    /* "cuda/_lib/ccudart/utils.pyx":2923
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerRCCB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerCRBC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_RCCB;

    /* "cuda/_lib/ccudart/utils.pyx":2922
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerBCCR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerRCCB:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerCRBC:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerCRBC:

    /* "cuda/_lib/ccudart/utils.pyx":2925
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerCRBC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerCBRC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_CRBC;

    /* "cuda/_lib/ccudart/utils.pyx":2924
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerRCCB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerCRBC:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerCBRC:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerCBRC:

    /* "cuda/_lib/ccudart/utils.pyx":2927
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerCBRC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10CCCC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_CBRC;

    /* "cuda/_lib/ccudart/utils.pyx":2926
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerCRBC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerCBRC:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10CCCC:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer10CCCC:

    /* "cuda/_lib/ccudart/utils.pyx":2929
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10CCCC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12BCCR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER10_CCCC;

    /* "cuda/_lib/ccudart/utils.pyx":2928
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayerCBRC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10CCCC:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12BCCR:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12BCCR:

    /* "cuda/_lib/ccudart/utils.pyx":2931
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12BCCR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12RCCB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_BCCR;

    /* "cuda/_lib/ccudart/utils.pyx":2930
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10CCCC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12BCCR:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12RCCB:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12RCCB:

    /* "cuda/_lib/ccudart/utils.pyx":2933
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12RCCB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CRBC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_RCCB;

    /* "cuda/_lib/ccudart/utils.pyx":2932
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12BCCR:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12RCCB:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CRBC:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12CRBC:

    /* "cuda/_lib/ccudart/utils.pyx":2935
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CRBC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CBRC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_CRBC;

    /* "cuda/_lib/ccudart/utils.pyx":2934
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12RCCB:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CRBC:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CBRC:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12CBRC:

    /* "cuda/_lib/ccudart/utils.pyx":2937
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CBRC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CCCC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_CBRC;

    /* "cuda/_lib/ccudart/utils.pyx":2936
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CRBC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CBRC:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CCCC:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12CCCC:

    /* "cuda/_lib/ccudart/utils.pyx":2939
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CCCC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_CCCC;

    /* "cuda/_lib/ccudart/utils.pyx":2938
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CBRC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CCCC:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY:

    /* "cuda/_lib/ccudart/utils.pyx":2941
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y;

    /* "cuda/_lib/ccudart/utils.pyx":2940
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CCCC:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_2020:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420SemiPlanar_2020:

    /* "cuda/_lib/ccudart/utils.pyx":2943
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020;

    /* "cuda/_lib/ccudart/utils.pyx":2942
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_2020:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_2020:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420SemiPlanar_2020:

    /* "cuda/_lib/ccudart/utils.pyx":2945
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020;

    /* "cuda/_lib/ccudart/utils.pyx":2944
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_2020:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_2020:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420Planar_2020:

    /* "cuda/_lib/ccudart/utils.pyx":2947
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020;

    /* "cuda/_lib/ccudart/utils.pyx":2946
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_2020:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_2020:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420Planar_2020:

    /* "cuda/_lib/ccudart/utils.pyx":2949
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020;

    /* "cuda/_lib/ccudart/utils.pyx":2948
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_2020:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_709:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420SemiPlanar_709:

    /* "cuda/_lib/ccudart/utils.pyx":2951
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709;

    /* "cuda/_lib/ccudart/utils.pyx":2950
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_709:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_709:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420SemiPlanar_709:

    /* "cuda/_lib/ccudart/utils.pyx":2953
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709;

    /* "cuda/_lib/ccudart/utils.pyx":2952
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_709:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_709:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420Planar_709:

    /* "cuda/_lib/ccudart/utils.pyx":2955
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709;

    /* "cuda/_lib/ccudart/utils.pyx":2954
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_709:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_709:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420Planar_709:

    /* "cuda/_lib/ccudart/utils.pyx":2957
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709;

    /* "cuda/_lib/ccudart/utils.pyx":2956
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_709:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_709:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_420SemiPlanar_709:

    /* "cuda/_lib/ccudart/utils.pyx":2959
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709;

    /* "cuda/_lib/ccudart/utils.pyx":2958
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_709:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_2020:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_420SemiPlanar_2020:

    /* "cuda/_lib/ccudart/utils.pyx":2961
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020;

    /* "cuda/_lib/ccudart/utils.pyx":2960
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_2020:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar_2020:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_422SemiPlanar_2020:

    /* "cuda/_lib/ccudart/utils.pyx":2963
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020;

    /* "cuda/_lib/ccudart/utils.pyx":2962
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar_2020:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_422SemiPlanar:

    /* "cuda/_lib/ccudart/utils.pyx":2965
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR;

    /* "cuda/_lib/ccudart/utils.pyx":2964
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar_2020:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar_709:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_422SemiPlanar_709:

    /* "cuda/_lib/ccudart/utils.pyx":2967
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709;

    /* "cuda/_lib/ccudart/utils.pyx":2966
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar_709:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2969
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2968
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar_709:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY_709_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY_709_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2971
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y_709_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2970
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY_709_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2973
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2972
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10_709_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10_709_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2975
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10_709_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2974
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10_709_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2977
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2976
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12_709_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12_709_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2979
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUVA:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12_709_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2978
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12_709_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUVA:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUVA:

    /* "cuda/_lib/ccudart/utils.pyx":2981
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUVA:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVYU:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUVA;

    /* "cuda/_lib/ccudart/utils.pyx":2980
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUVA:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVYU:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVYU:

    /* "cuda/_lib/ccudart/utils.pyx":2983
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVYU:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatVYUY:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVYU;

    /* "cuda/_lib/ccudart/utils.pyx":2982
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYUVA:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVYU:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatVYUY:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatVYUY:

    /* "cuda/_lib/ccudart/utils.pyx":2985
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatVYUY:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_VYUY;

    /* "cuda/_lib/ccudart/utils.pyx":2984
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatYVYU:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatVYUY:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_420SemiPlanar_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2987
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2986
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatVYUY:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2989
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat =  ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2988
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_444SemiPlanar_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2991
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat =  ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2990
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat =  ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2993
 *         cuEglFrame[0].eglColorFormat =  ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2992
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat =  ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_420SemiPlanar_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2995
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2994
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2997
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2996
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_444SemiPlanar_ER:

    /* "cuda/_lib/ccudart/utils.pyx":2999
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER             # <<<<<<<<<<<<<<
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER;

    /* "cuda/_lib/ccudart/utils.pyx":2998
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3001
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorInvalidValue
 */
    (__pyx_v_cuEglFrame[0]).eglColorFormat = __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3000
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar_ER:
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER
 *     elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER
 *     else:
 */
    break;
    default:

    /* "cuda/_lib/ccudart/utils.pyx":3003
 *         cuEglFrame[0].eglColorFormat = ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER
 *     else:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     if eglFrame.frameType == cudaEglFrameTypeArray:
 *         cuEglFrame[0].frameType = ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;
    break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3004
 *     else:
 *         return cudaErrorInvalidValue
 *     if eglFrame.frameType == cudaEglFrameTypeArray:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].frameType = ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY
 *     elif eglFrame.frameType == cudaEglFrameTypePitch:
 */
  switch (__pyx_v_eglFrame.frameType) {
    case __pyx_e_4cuda_7ccudart_cudaEglFrameTypeArray:

    /* "cuda/_lib/ccudart/utils.pyx":3005
 *         return cudaErrorInvalidValue
 *     if eglFrame.frameType == cudaEglFrameTypeArray:
 *         cuEglFrame[0].frameType = ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY             # <<<<<<<<<<<<<<
 *     elif eglFrame.frameType == cudaEglFrameTypePitch:
 *         cuEglFrame[0].frameType = ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH
 */
    (__pyx_v_cuEglFrame[0]).frameType = __pyx_e_4cuda_5ccuda_CU_EGL_FRAME_TYPE_ARRAY;

    /* "cuda/_lib/ccudart/utils.pyx":3004
 *     else:
 *         return cudaErrorInvalidValue
 *     if eglFrame.frameType == cudaEglFrameTypeArray:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].frameType = ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY
 *     elif eglFrame.frameType == cudaEglFrameTypePitch:
 */
    break;
    case __pyx_e_4cuda_7ccudart_cudaEglFrameTypePitch:

    /* "cuda/_lib/ccudart/utils.pyx":3007
 *         cuEglFrame[0].frameType = ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY
 *     elif eglFrame.frameType == cudaEglFrameTypePitch:
 *         cuEglFrame[0].frameType = ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorInvalidValue
 */
    (__pyx_v_cuEglFrame[0]).frameType = __pyx_e_4cuda_5ccuda_CU_EGL_FRAME_TYPE_PITCH;

    /* "cuda/_lib/ccudart/utils.pyx":3006
 *     if eglFrame.frameType == cudaEglFrameTypeArray:
 *         cuEglFrame[0].frameType = ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY
 *     elif eglFrame.frameType == cudaEglFrameTypePitch:             # <<<<<<<<<<<<<<
 *         cuEglFrame[0].frameType = ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH
 *     else:
 */
    break;
    default:

    /* "cuda/_lib/ccudart/utils.pyx":3009
 *         cuEglFrame[0].frameType = ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH
 *     else:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;
    break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2765
 * 
 * 
 * cdef cudaError_t getDriverEglFrame(ccuda.CUeglFrame *cuEglFrame, cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef unsigned int i = 0
 */

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

/* "cuda/_lib/ccudart/utils.pyx":3013
 * 
 * @cython.show_performance_hints(False)
 * cdef cudaError_t getRuntimeEglFrame(cudaEglFrame *eglFrame, ccuda.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef unsigned int i
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_getRuntimeEglFrame(__pyx_t_4cuda_7ccudart_cudaEglFrame *__pyx_v_eglFrame, __pyx_t_4cuda_5ccuda_CUeglFrame __pyx_v_cueglFrame) {
  cudaError_t __pyx_v_err;
  unsigned int __pyx_v_i;
  CUDA_ARRAY3D_DESCRIPTOR_v2 __pyx_v_ad;
  struct cudaPitchedPtr __pyx_v_pPtr;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  unsigned int __pyx_t_1;
  unsigned int __pyx_t_2;
  unsigned int __pyx_t_3;
  unsigned int __pyx_t_4;
  CUarray_format __pyx_t_5;
  cudaError_t __pyx_t_6;
  int __pyx_t_7;
  struct cudaPitchedPtr __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("getRuntimeEglFrame", __pyx_f[0], 3013, 1, __PYX_ERR(0, 3013, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":3014
 * @cython.show_performance_hints(False)
 * cdef cudaError_t getRuntimeEglFrame(cudaEglFrame *eglFrame, ccuda.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef unsigned int i
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 ad
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":3018
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 ad
 *     cdef cudaPitchedPtr pPtr
 *     memset(eglFrame, 0, sizeof(eglFrame[0]))             # <<<<<<<<<<<<<<
 *     memset(&ad, 0, sizeof(ad))
 *     for i in range(cueglFrame.planeCount):
 */
  (void)(memset(__pyx_v_eglFrame, 0, (sizeof((__pyx_v_eglFrame[0])))));

  /* "cuda/_lib/ccudart/utils.pyx":3019
 *     cdef cudaPitchedPtr pPtr
 *     memset(eglFrame, 0, sizeof(eglFrame[0]))
 *     memset(&ad, 0, sizeof(ad))             # <<<<<<<<<<<<<<
 *     for i in range(cueglFrame.planeCount):
 *         ad.Depth = cueglFrame.depth
 */
  (void)(memset((&__pyx_v_ad), 0, (sizeof(__pyx_v_ad))));

  /* "cuda/_lib/ccudart/utils.pyx":3020
 *     memset(eglFrame, 0, sizeof(eglFrame[0]))
 *     memset(&ad, 0, sizeof(ad))
 *     for i in range(cueglFrame.planeCount):             # <<<<<<<<<<<<<<
 *         ad.Depth = cueglFrame.depth
 *         ad.Flags = 0
 */
  __pyx_t_1 = __pyx_v_cueglFrame.planeCount;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":3021
 *     memset(&ad, 0, sizeof(ad))
 *     for i in range(cueglFrame.planeCount):
 *         ad.Depth = cueglFrame.depth             # <<<<<<<<<<<<<<
 *         ad.Flags = 0
 *         ad.Format = cueglFrame.cuFormat
 */
    __pyx_t_4 = __pyx_v_cueglFrame.depth;
    __pyx_v_ad.Depth = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":3022
 *     for i in range(cueglFrame.planeCount):
 *         ad.Depth = cueglFrame.depth
 *         ad.Flags = 0             # <<<<<<<<<<<<<<
 *         ad.Format = cueglFrame.cuFormat
 *         ad.Height = cueglFrame.height
 */
    __pyx_v_ad.Flags = 0;

    /* "cuda/_lib/ccudart/utils.pyx":3023
 *         ad.Depth = cueglFrame.depth
 *         ad.Flags = 0
 *         ad.Format = cueglFrame.cuFormat             # <<<<<<<<<<<<<<
 *         ad.Height = cueglFrame.height
 *         ad.NumChannels = cueglFrame.numChannels
 */
    __pyx_t_5 = __pyx_v_cueglFrame.cuFormat;
    __pyx_v_ad.Format = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":3024
 *         ad.Flags = 0
 *         ad.Format = cueglFrame.cuFormat
 *         ad.Height = cueglFrame.height             # <<<<<<<<<<<<<<
 *         ad.NumChannels = cueglFrame.numChannels
 *         ad.Width = cueglFrame.width
 */
    __pyx_t_4 = __pyx_v_cueglFrame.height;
    __pyx_v_ad.Height = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":3025
 *         ad.Format = cueglFrame.cuFormat
 *         ad.Height = cueglFrame.height
 *         ad.NumChannels = cueglFrame.numChannels             # <<<<<<<<<<<<<<
 *         ad.Width = cueglFrame.width
 * 
 */
    __pyx_t_4 = __pyx_v_cueglFrame.numChannels;
    __pyx_v_ad.NumChannels = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":3026
 *         ad.Height = cueglFrame.height
 *         ad.NumChannels = cueglFrame.numChannels
 *         ad.Width = cueglFrame.width             # <<<<<<<<<<<<<<
 * 
 *         err = getChannelFormatDescFromDriverDesc(&eglFrame[0].planeDesc[i].channelDesc, NULL, NULL, NULL, &ad)
 */
    __pyx_t_4 = __pyx_v_cueglFrame.width;
    __pyx_v_ad.Width = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":3028
 *         ad.Width = cueglFrame.width
 * 
 *         err = getChannelFormatDescFromDriverDesc(&eglFrame[0].planeDesc[i].channelDesc, NULL, NULL, NULL, &ad)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_6 = __pyx_f_4cuda_4_lib_7ccudart_5utils_getChannelFormatDescFromDriverDesc((&((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).channelDesc), NULL, NULL, NULL, (&__pyx_v_ad)); if (unlikely(__pyx_t_6 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3028, __pyx_L1_error)
    __pyx_v_err = __pyx_t_6;

    /* "cuda/_lib/ccudart/utils.pyx":3029
 * 
 *         err = getChannelFormatDescFromDriverDesc(&eglFrame[0].planeDesc[i].channelDesc, NULL, NULL, NULL, &ad)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_7 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_7) {

      /* "cuda/_lib/ccudart/utils.pyx":3030
 *         err = getChannelFormatDescFromDriverDesc(&eglFrame[0].planeDesc[i].channelDesc, NULL, NULL, NULL, &ad)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *         eglFrame[0].planeDesc[i].depth = cueglFrame.depth
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":3029
 * 
 *         err = getChannelFormatDescFromDriverDesc(&eglFrame[0].planeDesc[i].channelDesc, NULL, NULL, NULL, &ad)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":3032
 *             return err
 * 
 *         eglFrame[0].planeDesc[i].depth = cueglFrame.depth             # <<<<<<<<<<<<<<
 *         eglFrame[0].planeDesc[i].numChannels = cueglFrame.numChannels
 *         if i == 0:
 */
    __pyx_t_4 = __pyx_v_cueglFrame.depth;
    ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).depth = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":3033
 * 
 *         eglFrame[0].planeDesc[i].depth = cueglFrame.depth
 *         eglFrame[0].planeDesc[i].numChannels = cueglFrame.numChannels             # <<<<<<<<<<<<<<
 *         if i == 0:
 *             eglFrame[0].planeDesc[i].width = cueglFrame.width
 */
    __pyx_t_4 = __pyx_v_cueglFrame.numChannels;
    ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).numChannels = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":3034
 *         eglFrame[0].planeDesc[i].depth = cueglFrame.depth
 *         eglFrame[0].planeDesc[i].numChannels = cueglFrame.numChannels
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[i].width = cueglFrame.width
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 */
    __pyx_t_7 = (__pyx_v_i == 0);
    if (__pyx_t_7) {

      /* "cuda/_lib/ccudart/utils.pyx":3035
 *         eglFrame[0].planeDesc[i].numChannels = cueglFrame.numChannels
 *         if i == 0:
 *             eglFrame[0].planeDesc[i].width = cueglFrame.width             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 */
      __pyx_t_4 = __pyx_v_cueglFrame.width;
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).width = __pyx_t_4;

      /* "cuda/_lib/ccudart/utils.pyx":3036
 *         if i == 0:
 *             eglFrame[0].planeDesc[i].width = cueglFrame.width
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR or
 */
      __pyx_t_4 = __pyx_v_cueglFrame.height;
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).height = __pyx_t_4;

      /* "cuda/_lib/ccudart/utils.pyx":3037
 *             eglFrame[0].planeDesc[i].width = cueglFrame.width
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch             # <<<<<<<<<<<<<<
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER or
 */
      __pyx_t_4 = __pyx_v_cueglFrame.pitch;
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).pitch = __pyx_t_4;

      /* "cuda/_lib/ccudart/utils.pyx":3034
 *         eglFrame[0].planeDesc[i].depth = cueglFrame.depth
 *         eglFrame[0].planeDesc[i].numChannels = cueglFrame.numChannels
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[i].width = cueglFrame.width
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 */
      goto __pyx_L6;
    }

    /* "cuda/_lib/ccudart/utils.pyx":3038
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR or
 */
    switch (__pyx_v_cueglFrame.eglColorFormat) {
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_PLANAR:
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3039
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_PLANAR:

      /* "cuda/_lib/ccudart/utils.pyx":3040
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3041
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020:

      /* "cuda/_lib/ccudart/utils.pyx":3042
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020:

      /* "cuda/_lib/ccudart/utils.pyx":3043
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709):
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709:

      /* "cuda/_lib/ccudart/utils.pyx":3044
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709):
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709:

      /* "cuda/_lib/ccudart/utils.pyx":3038
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR or
 */
      __pyx_t_7 = 1;
      break;
      default:
      __pyx_t_7 = 0;
      break;
    }
    if (__pyx_t_7) {

      /* "cuda/_lib/ccudart/utils.pyx":3046
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709):
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[i].height = <unsigned int>(cueglFrame.height / 2)
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 */
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).width = ((unsigned int)(((double)__pyx_v_cueglFrame.width) / 2.0));

      /* "cuda/_lib/ccudart/utils.pyx":3047
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709):
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)
 *             eglFrame[0].planeDesc[i].height = <unsigned int>(cueglFrame.height / 2)             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR or
 */
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).height = ((unsigned int)(((double)__pyx_v_cueglFrame.height) / 2.0));

      /* "cuda/_lib/ccudart/utils.pyx":3048
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)
 *             eglFrame[0].planeDesc[i].height = <unsigned int>(cueglFrame.height / 2)
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)             # <<<<<<<<<<<<<<
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER or
 */
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).pitch = ((unsigned int)(((double)__pyx_v_cueglFrame.pitch) / 2.0));

      /* "cuda/_lib/ccudart/utils.pyx":3038
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR or
 */
      goto __pyx_L6;
    }

    /* "cuda/_lib/ccudart/utils.pyx":3049
 *             eglFrame[0].planeDesc[i].height = <unsigned int>(cueglFrame.height / 2)
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR or
 */
    switch (__pyx_v_cueglFrame.eglColorFormat) {
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR:
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3050
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR:

      /* "cuda/_lib/ccudart/utils.pyx":3051
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3052
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR:

      /* "cuda/_lib/ccudart/utils.pyx":3053
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR:

      /* "cuda/_lib/ccudart/utils.pyx":3054
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020:

      /* "cuda/_lib/ccudart/utils.pyx":3055
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020:

      /* "cuda/_lib/ccudart/utils.pyx":3056
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709:

      /* "cuda/_lib/ccudart/utils.pyx":3057
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709:

      /* "cuda/_lib/ccudart/utils.pyx":3058
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709:

      /* "cuda/_lib/ccudart/utils.pyx":3059
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020:

      /* "cuda/_lib/ccudart/utils.pyx":3060
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3061
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3062
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER):
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3063
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER):
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3049
 *             eglFrame[0].planeDesc[i].height = <unsigned int>(cueglFrame.height / 2)
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR or
 */
      __pyx_t_7 = 1;
      break;
      default:
      __pyx_t_7 = 0;
      break;
    }
    if (__pyx_t_7) {

      /* "cuda/_lib/ccudart/utils.pyx":3065
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER):
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[i].height = <unsigned int>(cueglFrame.height / 2)
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 */
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).width = ((unsigned int)(((double)__pyx_v_cueglFrame.width) / 2.0));

      /* "cuda/_lib/ccudart/utils.pyx":3066
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER):
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)
 *             eglFrame[0].planeDesc[i].height = <unsigned int>(cueglFrame.height / 2)             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8
 */
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).height = ((unsigned int)(((double)__pyx_v_cueglFrame.height) / 2.0));

      /* "cuda/_lib/ccudart/utils.pyx":3067
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)
 *             eglFrame[0].planeDesc[i].height = <unsigned int>(cueglFrame.height / 2)
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or
 */
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).pitch = ((unsigned int)(((double)__pyx_v_cueglFrame.pitch) / 2.0));

      /* "cuda/_lib/ccudart/utils.pyx":3068
 *             eglFrame[0].planeDesc[i].height = <unsigned int>(cueglFrame.height / 2)
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8             # <<<<<<<<<<<<<<
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or
 */
      ((__pyx_v_eglFrame[0]).planeDesc[1]).channelDesc.y = 8;

      /* "cuda/_lib/ccudart/utils.pyx":3069
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or
 */
      switch (__pyx_v_cueglFrame.eglColorFormat) {
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR:
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR:

        /* "cuda/_lib/ccudart/utils.pyx":3070
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or
 */
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709:

        /* "cuda/_lib/ccudart/utils.pyx":3071
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or
 */
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020:

        /* "cuda/_lib/ccudart/utils.pyx":3072
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER or
 */
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER:

        /* "cuda/_lib/ccudart/utils.pyx":3073
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER or
 */
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER:

        /* "cuda/_lib/ccudart/utils.pyx":3074
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER):
 */
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER:

        /* "cuda/_lib/ccudart/utils.pyx":3075
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER):
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16
 */
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER:

        /* "cuda/_lib/ccudart/utils.pyx":3077
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER):
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16             # <<<<<<<<<<<<<<
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER or
 */
        ((__pyx_v_eglFrame[0]).planeDesc[1]).channelDesc.y = 16;

        /* "cuda/_lib/ccudart/utils.pyx":3069
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or
 */
        break;
        default: break;
      }

      /* "cuda/_lib/ccudart/utils.pyx":3049
 *             eglFrame[0].planeDesc[i].height = <unsigned int>(cueglFrame.height / 2)
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR or
 */
      goto __pyx_L6;
    }

    /* "cuda/_lib/ccudart/utils.pyx":3078
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER):
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR or
 */
    switch (__pyx_v_cueglFrame.eglColorFormat) {
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV422_PLANAR:
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3079
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER):
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU422_PLANAR:

      /* "cuda/_lib/ccudart/utils.pyx":3080
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER):
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3078
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER):
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR or
 */
      __pyx_t_7 = 1;
      break;
      default:
      __pyx_t_7 = 0;
      break;
    }
    if (__pyx_t_7) {

      /* "cuda/_lib/ccudart/utils.pyx":3082
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER):
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 */
      __pyx_t_4 = __pyx_v_cueglFrame.height;
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).height = __pyx_t_4;

      /* "cuda/_lib/ccudart/utils.pyx":3083
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER):
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR or
 */
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).width = ((unsigned int)(((double)__pyx_v_cueglFrame.width) / 2.0));

      /* "cuda/_lib/ccudart/utils.pyx":3084
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)             # <<<<<<<<<<<<<<
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER or
 */
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).pitch = ((unsigned int)(((double)__pyx_v_cueglFrame.pitch) / 2.0));

      /* "cuda/_lib/ccudart/utils.pyx":3078
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER):
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR or
 */
      goto __pyx_L6;
    }

    /* "cuda/_lib/ccudart/utils.pyx":3085
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR or
 */
    switch (__pyx_v_cueglFrame.eglColorFormat) {
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR:
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3086
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR:

      /* "cuda/_lib/ccudart/utils.pyx":3087
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3088
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020:

      /* "cuda/_lib/ccudart/utils.pyx":3089
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709):
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR:

      /* "cuda/_lib/ccudart/utils.pyx":3090
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709):
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709:

      /* "cuda/_lib/ccudart/utils.pyx":3085
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR or
 */
      __pyx_t_7 = 1;
      break;
      default:
      __pyx_t_7 = 0;
      break;
    }
    if (__pyx_t_7) {

      /* "cuda/_lib/ccudart/utils.pyx":3092
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709):
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 */
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).width = ((unsigned int)(((double)__pyx_v_cueglFrame.width) / 2.0));

      /* "cuda/_lib/ccudart/utils.pyx":3093
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709):
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8
 */
      __pyx_t_4 = __pyx_v_cueglFrame.height;
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).height = __pyx_t_4;

      /* "cuda/_lib/ccudart/utils.pyx":3094
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 or
 */
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).pitch = ((unsigned int)(((double)__pyx_v_cueglFrame.pitch) / 2.0));

      /* "cuda/_lib/ccudart/utils.pyx":3095
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8             # <<<<<<<<<<<<<<
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR or
 */
      ((__pyx_v_eglFrame[0]).planeDesc[1]).channelDesc.y = 8;

      /* "cuda/_lib/ccudart/utils.pyx":3096
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709):
 */
      switch (__pyx_v_cueglFrame.eglColorFormat) {
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020:
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR:

        /* "cuda/_lib/ccudart/utils.pyx":3097
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709):
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16
 */
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709:

        /* "cuda/_lib/ccudart/utils.pyx":3099
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709):
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16             # <<<<<<<<<<<<<<
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER or
 */
        ((__pyx_v_eglFrame[0]).planeDesc[1]).channelDesc.y = 16;

        /* "cuda/_lib/ccudart/utils.pyx":3096
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709):
 */
        break;
        default: break;
      }

      /* "cuda/_lib/ccudart/utils.pyx":3085
 *             eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2)
 *             eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2)
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR or
 */
      goto __pyx_L6;
    }

    /* "cuda/_lib/ccudart/utils.pyx":3100
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709):
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR or
 */
    switch (__pyx_v_cueglFrame.eglColorFormat) {
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV444_PLANAR:
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3101
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER):
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU444_PLANAR:

      /* "cuda/_lib/ccudart/utils.pyx":3102
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER):
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3100
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709):
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR or
 */
      __pyx_t_7 = 1;
      break;
      default:
      __pyx_t_7 = 0;
      break;
    }
    if (__pyx_t_7) {

      /* "cuda/_lib/ccudart/utils.pyx":3104
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER):
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[i].width = cueglFrame.width
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 */
      __pyx_t_4 = __pyx_v_cueglFrame.height;
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).height = __pyx_t_4;

      /* "cuda/_lib/ccudart/utils.pyx":3105
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER):
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 *             eglFrame[0].planeDesc[i].width = cueglFrame.width             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR or
 */
      __pyx_t_4 = __pyx_v_cueglFrame.width;
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).width = __pyx_t_4;

      /* "cuda/_lib/ccudart/utils.pyx":3106
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 *             eglFrame[0].planeDesc[i].width = cueglFrame.width
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch             # <<<<<<<<<<<<<<
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER or
 */
      __pyx_t_4 = __pyx_v_cueglFrame.pitch;
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).pitch = __pyx_t_4;

      /* "cuda/_lib/ccudart/utils.pyx":3100
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709):
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR or
 */
      goto __pyx_L6;
    }

    /* "cuda/_lib/ccudart/utils.pyx":3107
 *             eglFrame[0].planeDesc[i].width = cueglFrame.width
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR or
 */
    switch (__pyx_v_cueglFrame.eglColorFormat) {
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR:
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3108
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR:

      /* "cuda/_lib/ccudart/utils.pyx":3109
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3110
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR:

      /* "cuda/_lib/ccudart/utils.pyx":3111
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR:

      /* "cuda/_lib/ccudart/utils.pyx":3112
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3113
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER or
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3114
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER):
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3115
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER):
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 */
      case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER:

      /* "cuda/_lib/ccudart/utils.pyx":3107
 *             eglFrame[0].planeDesc[i].width = cueglFrame.width
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR or
 */
      __pyx_t_7 = 1;
      break;
      default:
      __pyx_t_7 = 0;
      break;
    }
    if (__pyx_t_7) {

      /* "cuda/_lib/ccudart/utils.pyx":3117
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER):
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[i].width = cueglFrame.width
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 */
      __pyx_t_4 = __pyx_v_cueglFrame.height;
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).height = __pyx_t_4;

      /* "cuda/_lib/ccudart/utils.pyx":3118
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER):
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 *             eglFrame[0].planeDesc[i].width = cueglFrame.width             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8
 */
      __pyx_t_4 = __pyx_v_cueglFrame.width;
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).width = __pyx_t_4;

      /* "cuda/_lib/ccudart/utils.pyx":3119
 *             eglFrame[0].planeDesc[i].height = cueglFrame.height
 *             eglFrame[0].planeDesc[i].width = cueglFrame.width
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch             # <<<<<<<<<<<<<<
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or
 */
      __pyx_t_4 = __pyx_v_cueglFrame.pitch;
      ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).pitch = __pyx_t_4;

      /* "cuda/_lib/ccudart/utils.pyx":3120
 *             eglFrame[0].planeDesc[i].width = cueglFrame.width
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8             # <<<<<<<<<<<<<<
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or
 */
      ((__pyx_v_eglFrame[0]).planeDesc[1]).channelDesc.y = 8;

      /* "cuda/_lib/ccudart/utils.pyx":3121
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or
 */
      switch (__pyx_v_cueglFrame.eglColorFormat) {
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR:
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR:

        /* "cuda/_lib/ccudart/utils.pyx":3122
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER or
 */
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER:

        /* "cuda/_lib/ccudart/utils.pyx":3123
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER or
 */
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER:

        /* "cuda/_lib/ccudart/utils.pyx":3124
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER):
 */
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER:

        /* "cuda/_lib/ccudart/utils.pyx":3125
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER):
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16
 */
        case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER:

        /* "cuda/_lib/ccudart/utils.pyx":3127
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER):
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16             # <<<<<<<<<<<<<<
 *         if cueglFrame.frameType == ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY:
 *             eglFrame[0].frame.pArray[i] = <cudaArray_t>cueglFrame.frame.pArray[i]
 */
        ((__pyx_v_eglFrame[0]).planeDesc[1]).channelDesc.y = 16;

        /* "cuda/_lib/ccudart/utils.pyx":3121
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 *             eglFrame[0].planeDesc[1].channelDesc.y = 8
 *             if (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or
 */
        break;
        default: break;
      }

      /* "cuda/_lib/ccudart/utils.pyx":3107
 *             eglFrame[0].planeDesc[i].width = cueglFrame.width
 *             eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch
 *         elif (cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR or             # <<<<<<<<<<<<<<
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER or
 *               cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR or
 */
    }
    __pyx_L6:;

    /* "cuda/_lib/ccudart/utils.pyx":3128
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER):
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16
 *         if cueglFrame.frameType == ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY:             # <<<<<<<<<<<<<<
 *             eglFrame[0].frame.pArray[i] = <cudaArray_t>cueglFrame.frame.pArray[i]
 *         else:
 */
    __pyx_t_7 = (__pyx_v_cueglFrame.frameType == __pyx_e_4cuda_5ccuda_CU_EGL_FRAME_TYPE_ARRAY);
    if (__pyx_t_7) {

      /* "cuda/_lib/ccudart/utils.pyx":3129
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16
 *         if cueglFrame.frameType == ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY:
 *             eglFrame[0].frame.pArray[i] = <cudaArray_t>cueglFrame.frame.pArray[i]             # <<<<<<<<<<<<<<
 *         else:
 *             pPtr = make_cudaPitchedPtr(cueglFrame.frame.pPitch[i], eglFrame[0].planeDesc[i].pitch,
 */
      ((__pyx_v_eglFrame[0]).frame.pArray[__pyx_v_i]) = ((cudaArray_t)(__pyx_v_cueglFrame.frame.pArray[__pyx_v_i]));

      /* "cuda/_lib/ccudart/utils.pyx":3128
 *                 cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER):
 *                 eglFrame[0].planeDesc[1].channelDesc.y = 16
 *         if cueglFrame.frameType == ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY:             # <<<<<<<<<<<<<<
 *             eglFrame[0].frame.pArray[i] = <cudaArray_t>cueglFrame.frame.pArray[i]
 *         else:
 */
      goto __pyx_L7;
    }

    /* "cuda/_lib/ccudart/utils.pyx":3131
 *             eglFrame[0].frame.pArray[i] = <cudaArray_t>cueglFrame.frame.pArray[i]
 *         else:
 *             pPtr = make_cudaPitchedPtr(cueglFrame.frame.pPitch[i], eglFrame[0].planeDesc[i].pitch,             # <<<<<<<<<<<<<<
 *                     eglFrame[0].planeDesc[i].width, eglFrame[0].planeDesc[i].height)
 *             eglFrame[0].frame.pPitch[i] = pPtr
 */
    /*else*/ {

      /* "cuda/_lib/ccudart/utils.pyx":3132
 *         else:
 *             pPtr = make_cudaPitchedPtr(cueglFrame.frame.pPitch[i], eglFrame[0].planeDesc[i].pitch,
 *                     eglFrame[0].planeDesc[i].width, eglFrame[0].planeDesc[i].height)             # <<<<<<<<<<<<<<
 *             eglFrame[0].frame.pPitch[i] = pPtr
 * 
 */
      __pyx_t_8 = __pyx_f_4cuda_7ccudart_make_cudaPitchedPtr((__pyx_v_cueglFrame.frame.pPitch[__pyx_v_i]), ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).pitch, ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).width, ((__pyx_v_eglFrame[0]).planeDesc[__pyx_v_i]).height); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3131, __pyx_L1_error)
      __pyx_v_pPtr = __pyx_t_8;

      /* "cuda/_lib/ccudart/utils.pyx":3133
 *             pPtr = make_cudaPitchedPtr(cueglFrame.frame.pPitch[i], eglFrame[0].planeDesc[i].pitch,
 *                     eglFrame[0].planeDesc[i].width, eglFrame[0].planeDesc[i].height)
 *             eglFrame[0].frame.pPitch[i] = pPtr             # <<<<<<<<<<<<<<
 * 
 *     eglFrame[0].planeCount = cueglFrame.planeCount
 */
      ((__pyx_v_eglFrame[0]).frame.pPitch[__pyx_v_i]) = __pyx_v_pPtr;
    }
    __pyx_L7:;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3135
 *             eglFrame[0].frame.pPitch[i] = pPtr
 * 
 *     eglFrame[0].planeCount = cueglFrame.planeCount             # <<<<<<<<<<<<<<
 *     if cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar
 */
  __pyx_t_1 = __pyx_v_cueglFrame.planeCount;
  (__pyx_v_eglFrame[0]).planeCount = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":3136
 * 
 *     eglFrame[0].planeCount = cueglFrame.planeCount
 *     if cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR:
 */
  switch (__pyx_v_cueglFrame.eglColorFormat) {
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_PLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3137
 *     eglFrame[0].planeCount = cueglFrame.planeCount
 *     if cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420Planar;

    /* "cuda/_lib/ccudart/utils.pyx":3136
 * 
 *     eglFrame[0].planeCount = cueglFrame.planeCount
 *     if cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3139
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422Planar
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420SemiPlanar;

    /* "cuda/_lib/ccudart/utils.pyx":3138
 *     if cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV422_PLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3141
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422Planar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422SemiPlanar
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV422Planar;

    /* "cuda/_lib/ccudart/utils.pyx":3140
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3143
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422SemiPlanar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444Planar
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV422SemiPlanar;

    /* "cuda/_lib/ccudart/utils.pyx":3142
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV444_PLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3145
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444Planar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444SemiPlanar
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV444Planar;

    /* "cuda/_lib/ccudart/utils.pyx":3144
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3147
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444SemiPlanar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUYV422
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV444SemiPlanar;

    /* "cuda/_lib/ccudart/utils.pyx":3146
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUYV_422:

    /* "cuda/_lib/ccudart/utils.pyx":3149
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUYV422             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY422
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUYV422;

    /* "cuda/_lib/ccudart/utils.pyx":3148
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUYV422
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_UYVY_422:

    /* "cuda/_lib/ccudart/utils.pyx":3151
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUYV422
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY422             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatARGB
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatUYVY422;

    /* "cuda/_lib/ccudart/utils.pyx":3150
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUYV422
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY422
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_ARGB:

    /* "cuda/_lib/ccudart/utils.pyx":3153
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY422
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatARGB             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatRGBA
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatARGB;

    /* "cuda/_lib/ccudart/utils.pyx":3152
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY422
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatARGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_RGBA:

    /* "cuda/_lib/ccudart/utils.pyx":3155
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatARGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatRGBA             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatABGR
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatRGBA;

    /* "cuda/_lib/ccudart/utils.pyx":3154
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatARGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatRGBA
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_ABGR:

    /* "cuda/_lib/ccudart/utils.pyx":3157
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatRGBA
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatABGR             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBGRA
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatABGR;

    /* "cuda/_lib/ccudart/utils.pyx":3156
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatRGBA
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatABGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BGRA:

    /* "cuda/_lib/ccudart/utils.pyx":3159
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatABGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBGRA             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatL
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBGRA;

    /* "cuda/_lib/ccudart/utils.pyx":3158
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatABGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBGRA
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_L:

    /* "cuda/_lib/ccudart/utils.pyx":3161
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBGRA
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatL             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatR
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatL;

    /* "cuda/_lib/ccudart/utils.pyx":3160
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBGRA
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatL
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_R:

    /* "cuda/_lib/ccudart/utils.pyx":3163
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatL
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatR             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatA
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatR;

    /* "cuda/_lib/ccudart/utils.pyx":3162
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatL
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_A:

    /* "cuda/_lib/ccudart/utils.pyx":3165
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatA             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatRG
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatA;

    /* "cuda/_lib/ccudart/utils.pyx":3164
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatA
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_RG:

    /* "cuda/_lib/ccudart/utils.pyx":3167
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatA
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatRG             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatAYUV
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatRG;

    /* "cuda/_lib/ccudart/utils.pyx":3166
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatA
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_AYUV:

    /* "cuda/_lib/ccudart/utils.pyx":3169
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatAYUV             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444SemiPlanar
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatAYUV;

    /* "cuda/_lib/ccudart/utils.pyx":3168
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatAYUV
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3171
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatAYUV
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444SemiPlanar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422SemiPlanar
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU444SemiPlanar;

    /* "cuda/_lib/ccudart/utils.pyx":3170
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatAYUV
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3173
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422SemiPlanar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU422SemiPlanar;

    /* "cuda/_lib/ccudart/utils.pyx":3172
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3175
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420SemiPlanar;

    /* "cuda/_lib/ccudart/utils.pyx":3174
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3177
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_444SemiPlanar;

    /* "cuda/_lib/ccudart/utils.pyx":3176
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3179
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_420SemiPlanar;

    /* "cuda/_lib/ccudart/utils.pyx":3178
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3181
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_444SemiPlanar;

    /* "cuda/_lib/ccudart/utils.pyx":3180
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3183
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatVYUY_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_420SemiPlanar;

    /* "cuda/_lib/ccudart/utils.pyx":3182
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_VYUY_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3185
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatVYUY_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatVYUY_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3184
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatVYUY_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_UYVY_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3187
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatVYUY_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUYV_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatUYVY_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3186
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatVYUY_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUYV_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3189
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUYV_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVYU_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUYV_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3188
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUYV_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVYU_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3191
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUYV_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVYU_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUVA_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVYU_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3190
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUYV_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVYU_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUVA_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3193
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVYU_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUVA_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatAYUV_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUVA_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3192
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVYU_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUVA_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_AYUV_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3195
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUVA_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatAYUV_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444Planar_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatAYUV_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3194
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUVA_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatAYUV_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3197
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatAYUV_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444Planar_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422Planar_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV444Planar_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3196
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatAYUV_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3199
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422Planar_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV422Planar_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3198
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3201
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444SemiPlanar_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420Planar_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3200
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3203
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444SemiPlanar_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422SemiPlanar_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV444SemiPlanar_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3202
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3205
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422SemiPlanar_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV422SemiPlanar_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3204
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3207
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444Planar_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420SemiPlanar_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3206
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3209
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444Planar_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422Planar_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU444Planar_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3208
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3211
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422Planar_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU422Planar_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3210
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3213
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444SemiPlanar_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420Planar_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3212
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3215
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444SemiPlanar_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422SemiPlanar_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU444SemiPlanar_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3214
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3217
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422SemiPlanar_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU422SemiPlanar_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3216
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3219
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerRGGB
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420SemiPlanar_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3218
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_RGGB:

    /* "cuda/_lib/ccudart/utils.pyx":3221
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerRGGB             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerBGGR
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerRGGB;

    /* "cuda/_lib/ccudart/utils.pyx":3220
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerRGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_BGGR:

    /* "cuda/_lib/ccudart/utils.pyx":3223
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerRGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerBGGR             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerGRBG
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerBGGR;

    /* "cuda/_lib/ccudart/utils.pyx":3222
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerRGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerBGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_GRBG:

    /* "cuda/_lib/ccudart/utils.pyx":3225
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerBGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerGRBG             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerGBRG
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerGRBG;

    /* "cuda/_lib/ccudart/utils.pyx":3224
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerBGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerGRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_GBRG:

    /* "cuda/_lib/ccudart/utils.pyx":3227
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerGRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerGBRG             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10RGGB
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerGBRG;

    /* "cuda/_lib/ccudart/utils.pyx":3226
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerGRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerGBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER10_RGGB:

    /* "cuda/_lib/ccudart/utils.pyx":3229
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerGBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10RGGB             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10BGGR
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer10RGGB;

    /* "cuda/_lib/ccudart/utils.pyx":3228
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerGBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10RGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER10_BGGR:

    /* "cuda/_lib/ccudart/utils.pyx":3231
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10RGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10BGGR             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10GRBG
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer10BGGR;

    /* "cuda/_lib/ccudart/utils.pyx":3230
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10RGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10BGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER10_GRBG:

    /* "cuda/_lib/ccudart/utils.pyx":3233
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10BGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10GRBG             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10GBRG
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer10GRBG;

    /* "cuda/_lib/ccudart/utils.pyx":3232
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10BGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10GRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER10_GBRG:

    /* "cuda/_lib/ccudart/utils.pyx":3235
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10GRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10GBRG             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12RGGB
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer10GBRG;

    /* "cuda/_lib/ccudart/utils.pyx":3234
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10GRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10GBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_RGGB:

    /* "cuda/_lib/ccudart/utils.pyx":3237
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10GBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12RGGB             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12BGGR
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12RGGB;

    /* "cuda/_lib/ccudart/utils.pyx":3236
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10GBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12RGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_BGGR:

    /* "cuda/_lib/ccudart/utils.pyx":3239
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12RGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12BGGR             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12GRBG
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12BGGR;

    /* "cuda/_lib/ccudart/utils.pyx":3238
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12RGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12BGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_GRBG:

    /* "cuda/_lib/ccudart/utils.pyx":3241
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12BGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12GRBG             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12GBRG
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12GRBG;

    /* "cuda/_lib/ccudart/utils.pyx":3240
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12BGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12GRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_GBRG:

    /* "cuda/_lib/ccudart/utils.pyx":3243
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12GRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12GBRG             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14RGGB
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12GBRG;

    /* "cuda/_lib/ccudart/utils.pyx":3242
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12GRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12GBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER14_RGGB:

    /* "cuda/_lib/ccudart/utils.pyx":3245
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12GBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14RGGB             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14BGGR
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer14RGGB;

    /* "cuda/_lib/ccudart/utils.pyx":3244
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12GBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14RGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER14_BGGR:

    /* "cuda/_lib/ccudart/utils.pyx":3247
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14RGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14BGGR             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14GRBG
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer14BGGR;

    /* "cuda/_lib/ccudart/utils.pyx":3246
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14RGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14BGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER14_GRBG:

    /* "cuda/_lib/ccudart/utils.pyx":3249
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14BGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14GRBG             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14GBRG
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer14GRBG;

    /* "cuda/_lib/ccudart/utils.pyx":3248
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14BGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14GRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER14_GBRG:

    /* "cuda/_lib/ccudart/utils.pyx":3251
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14GRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14GBRG             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20RGGB
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer14GBRG;

    /* "cuda/_lib/ccudart/utils.pyx":3250
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14GRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14GBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER20_RGGB:

    /* "cuda/_lib/ccudart/utils.pyx":3253
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14GBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20RGGB             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20BGGR
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer20RGGB;

    /* "cuda/_lib/ccudart/utils.pyx":3252
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14GBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20RGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER20_BGGR:

    /* "cuda/_lib/ccudart/utils.pyx":3255
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20RGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20BGGR             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20GRBG
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer20BGGR;

    /* "cuda/_lib/ccudart/utils.pyx":3254
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20RGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20BGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER20_GRBG:

    /* "cuda/_lib/ccudart/utils.pyx":3257
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20BGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20GRBG             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20GBRG
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer20GRBG;

    /* "cuda/_lib/ccudart/utils.pyx":3256
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20BGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20GRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER20_GBRG:

    /* "cuda/_lib/ccudart/utils.pyx":3259
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20GRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20GBRG             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspRGGB
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer20GBRG;

    /* "cuda/_lib/ccudart/utils.pyx":3258
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20GRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20GBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB:

    /* "cuda/_lib/ccudart/utils.pyx":3261
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20GBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspRGGB             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspBGGR
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerIspRGGB;

    /* "cuda/_lib/ccudart/utils.pyx":3260
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20GBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspRGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR:

    /* "cuda/_lib/ccudart/utils.pyx":3263
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspRGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspBGGR             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspGRBG
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerIspBGGR;

    /* "cuda/_lib/ccudart/utils.pyx":3262
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspRGGB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspBGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG:

    /* "cuda/_lib/ccudart/utils.pyx":3265
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspBGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspGRBG             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspGBRG
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerIspGRBG;

    /* "cuda/_lib/ccudart/utils.pyx":3264
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspBGGR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspGRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG:

    /* "cuda/_lib/ccudart/utils.pyx":3267
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspGRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspGBRG             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444Planar
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerIspGBRG;

    /* "cuda/_lib/ccudart/utils.pyx":3266
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspGRBG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspGBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU444_PLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3269
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspGBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444Planar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422Planar
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU444Planar;

    /* "cuda/_lib/ccudart/utils.pyx":3268
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspGBRG
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU422_PLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3271
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422Planar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU422Planar;

    /* "cuda/_lib/ccudart/utils.pyx":3270
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_PLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3273
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerBCCR
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420Planar;

    /* "cuda/_lib/ccudart/utils.pyx":3272
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_BCCR:

    /* "cuda/_lib/ccudart/utils.pyx":3275
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerBCCR             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerRCCB
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerBCCR;

    /* "cuda/_lib/ccudart/utils.pyx":3274
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerBCCR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_RCCB:

    /* "cuda/_lib/ccudart/utils.pyx":3277
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerBCCR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerRCCB             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerCRBC
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerRCCB;

    /* "cuda/_lib/ccudart/utils.pyx":3276
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerBCCR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerRCCB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_CRBC:

    /* "cuda/_lib/ccudart/utils.pyx":3279
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerRCCB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerCRBC             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerCBRC
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerCRBC;

    /* "cuda/_lib/ccudart/utils.pyx":3278
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerRCCB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerCRBC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER_CBRC:

    /* "cuda/_lib/ccudart/utils.pyx":3281
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerCRBC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerCBRC             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10CCCC
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayerCBRC;

    /* "cuda/_lib/ccudart/utils.pyx":3280
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerCRBC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerCBRC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER10_CCCC:

    /* "cuda/_lib/ccudart/utils.pyx":3283
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerCBRC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10CCCC             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12BCCR
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer10CCCC;

    /* "cuda/_lib/ccudart/utils.pyx":3282
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayerCBRC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10CCCC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_BCCR:

    /* "cuda/_lib/ccudart/utils.pyx":3285
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10CCCC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12BCCR             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12RCCB
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12BCCR;

    /* "cuda/_lib/ccudart/utils.pyx":3284
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10CCCC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12BCCR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_RCCB:

    /* "cuda/_lib/ccudart/utils.pyx":3287
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12BCCR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12RCCB             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CRBC
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12RCCB;

    /* "cuda/_lib/ccudart/utils.pyx":3286
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12BCCR
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12RCCB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_CRBC:

    /* "cuda/_lib/ccudart/utils.pyx":3289
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12RCCB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CRBC             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CBRC
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12CRBC;

    /* "cuda/_lib/ccudart/utils.pyx":3288
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12RCCB
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CRBC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_CBRC:

    /* "cuda/_lib/ccudart/utils.pyx":3291
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CRBC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CBRC             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CCCC
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12CBRC;

    /* "cuda/_lib/ccudart/utils.pyx":3290
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CRBC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CBRC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_BAYER12_CCCC:

    /* "cuda/_lib/ccudart/utils.pyx":3293
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CBRC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CCCC             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatBayer12CCCC;

    /* "cuda/_lib/ccudart/utils.pyx":3292
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CBRC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CCCC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y:

    /* "cuda/_lib/ccudart/utils.pyx":3295
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CCCC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_2020
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY;

    /* "cuda/_lib/ccudart/utils.pyx":3294
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CCCC
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020:

    /* "cuda/_lib/ccudart/utils.pyx":3297
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_2020             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_2020
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420SemiPlanar_2020;

    /* "cuda/_lib/ccudart/utils.pyx":3296
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020:

    /* "cuda/_lib/ccudart/utils.pyx":3299
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_2020             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_2020
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420SemiPlanar_2020;

    /* "cuda/_lib/ccudart/utils.pyx":3298
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020:

    /* "cuda/_lib/ccudart/utils.pyx":3301
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_2020             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_2020
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420Planar_2020;

    /* "cuda/_lib/ccudart/utils.pyx":3300
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020:

    /* "cuda/_lib/ccudart/utils.pyx":3303
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_2020             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_709
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420Planar_2020;

    /* "cuda/_lib/ccudart/utils.pyx":3302
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709:

    /* "cuda/_lib/ccudart/utils.pyx":3305
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_709             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_709
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420SemiPlanar_709;

    /* "cuda/_lib/ccudart/utils.pyx":3304
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709:

    /* "cuda/_lib/ccudart/utils.pyx":3307
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_709             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_709
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420SemiPlanar_709;

    /* "cuda/_lib/ccudart/utils.pyx":3306
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709:

    /* "cuda/_lib/ccudart/utils.pyx":3309
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_709             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_709
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUV420Planar_709;

    /* "cuda/_lib/ccudart/utils.pyx":3308
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709:

    /* "cuda/_lib/ccudart/utils.pyx":3311
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_709             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_709
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVU420Planar_709;

    /* "cuda/_lib/ccudart/utils.pyx":3310
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709:

    /* "cuda/_lib/ccudart/utils.pyx":3313
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_709             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_2020
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_420SemiPlanar_709;

    /* "cuda/_lib/ccudart/utils.pyx":3312
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020:

    /* "cuda/_lib/ccudart/utils.pyx":3315
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_2020             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar_2020
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_420SemiPlanar_2020;

    /* "cuda/_lib/ccudart/utils.pyx":3314
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020:

    /* "cuda/_lib/ccudart/utils.pyx":3317
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar_2020             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_422SemiPlanar_2020;

    /* "cuda/_lib/ccudart/utils.pyx":3316
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR:

    /* "cuda/_lib/ccudart/utils.pyx":3319
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar_709
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_422SemiPlanar;

    /* "cuda/_lib/ccudart/utils.pyx":3318
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar_2020
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709:

    /* "cuda/_lib/ccudart/utils.pyx":3321
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar_709             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_422SemiPlanar_709;

    /* "cuda/_lib/ccudart/utils.pyx":3320
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3323
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY_709_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3322
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar_709
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y_709_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3325
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY_709_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY_709_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3324
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3327
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10_709_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3326
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10_709_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3329
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10_709_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10_709_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3328
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3331
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12_709_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3330
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12_709_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3333
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12_709_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUVA
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12_709_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3332
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YUVA:

    /* "cuda/_lib/ccudart/utils.pyx":3335
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUVA             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVYU
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYUVA;

    /* "cuda/_lib/ccudart/utils.pyx":3334
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUVA
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_YVYU:

    /* "cuda/_lib/ccudart/utils.pyx":3337
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUVA
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVYU             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatVYUY
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatYVYU;

    /* "cuda/_lib/ccudart/utils.pyx":3336
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYUVA
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVYU
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_VYUY:

    /* "cuda/_lib/ccudart/utils.pyx":3339
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVYU
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatVYUY             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatVYUY;

    /* "cuda/_lib/ccudart/utils.pyx":3338
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatYVYU
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatVYUY
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3341
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatVYUY
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_420SemiPlanar_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3340
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatVYUY
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3343
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3342
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3345
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_444SemiPlanar_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3344
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3347
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3346
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3349
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_420SemiPlanar_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3348
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3351
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3350
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3353
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar_ER             # <<<<<<<<<<<<<<
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_444SemiPlanar_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3352
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER:

    /* "cuda/_lib/ccudart/utils.pyx":3355
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorInvalidValue
 */
    (__pyx_v_eglFrame[0]).eglColorFormat = __pyx_e_4cuda_7ccudart_cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER;

    /* "cuda/_lib/ccudart/utils.pyx":3354
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER:
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar_ER
 *     elif cueglFrame.eglColorFormat == ccuda.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER:             # <<<<<<<<<<<<<<
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER
 *     else:
 */
    break;
    default:

    /* "cuda/_lib/ccudart/utils.pyx":3357
 *         eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER
 *     else:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     if cueglFrame.frameType == ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY:
 *         eglFrame[0].frameType = cudaEglFrameTypeArray
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;
    break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3358
 *     else:
 *         return cudaErrorInvalidValue
 *     if cueglFrame.frameType == ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY:             # <<<<<<<<<<<<<<
 *         eglFrame[0].frameType = cudaEglFrameTypeArray
 *     elif cueglFrame.frameType == ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH:
 */
  switch (__pyx_v_cueglFrame.frameType) {
    case __pyx_e_4cuda_5ccuda_CU_EGL_FRAME_TYPE_ARRAY:

    /* "cuda/_lib/ccudart/utils.pyx":3359
 *         return cudaErrorInvalidValue
 *     if cueglFrame.frameType == ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY:
 *         eglFrame[0].frameType = cudaEglFrameTypeArray             # <<<<<<<<<<<<<<
 *     elif cueglFrame.frameType == ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH:
 *         eglFrame[0].frameType = cudaEglFrameTypePitch
 */
    (__pyx_v_eglFrame[0]).frameType = __pyx_e_4cuda_7ccudart_cudaEglFrameTypeArray;

    /* "cuda/_lib/ccudart/utils.pyx":3358
 *     else:
 *         return cudaErrorInvalidValue
 *     if cueglFrame.frameType == ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY:             # <<<<<<<<<<<<<<
 *         eglFrame[0].frameType = cudaEglFrameTypeArray
 *     elif cueglFrame.frameType == ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH:
 */
    break;
    case __pyx_e_4cuda_5ccuda_CU_EGL_FRAME_TYPE_PITCH:

    /* "cuda/_lib/ccudart/utils.pyx":3361
 *         eglFrame[0].frameType = cudaEglFrameTypeArray
 *     elif cueglFrame.frameType == ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH:
 *         eglFrame[0].frameType = cudaEglFrameTypePitch             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorInvalidValue
 */
    (__pyx_v_eglFrame[0]).frameType = __pyx_e_4cuda_7ccudart_cudaEglFrameTypePitch;

    /* "cuda/_lib/ccudart/utils.pyx":3360
 *     if cueglFrame.frameType == ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY:
 *         eglFrame[0].frameType = cudaEglFrameTypeArray
 *     elif cueglFrame.frameType == ccuda.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH:             # <<<<<<<<<<<<<<
 *         eglFrame[0].frameType = cudaEglFrameTypePitch
 *     else:
 */
    break;
    default:

    /* "cuda/_lib/ccudart/utils.pyx":3363
 *         eglFrame[0].frameType = cudaEglFrameTypePitch
 *     else:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;
    break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3013
 * 
 * @cython.show_performance_hints(False)
 * cdef cudaError_t getRuntimeEglFrame(cudaEglFrame *eglFrame, ccuda.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef unsigned int i
 */

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

/* "cuda/_lib/ccudart/utils.pyx":3366
 * 
 * 
 * cdef cudaError_t toDriverGraphNodeParams(const cudaGraphNodeParams *rtParams, ccuda.CUgraphNodeParams *driverParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef ccuda.CUcontext context
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverGraphNodeParams(struct cudaGraphNodeParams const *__pyx_v_rtParams, CUgraphNodeParams *__pyx_v_driverParams) {
  cudaError_t __pyx_v_err;
  CUcontext __pyx_v_context;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  cudaError_t __pyx_t_2;
  CUresult __pyx_t_3;
  cudaGraph_t __pyx_t_4;
  cudaEvent_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("toDriverGraphNodeParams", __pyx_f[0], 3366, 1, __PYX_ERR(0, 3366, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":3369
 *     cdef cudaError_t err
 *     cdef ccuda.CUcontext context
 *     memset(driverParams, 0, sizeof(driverParams[0]))             # <<<<<<<<<<<<<<
 * 
 *     if rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeKernel:
 */
  (void)(memset(__pyx_v_driverParams, 0, (sizeof((__pyx_v_driverParams[0])))));

  /* "cuda/_lib/ccudart/utils.pyx":3371
 *     memset(driverParams, 0, sizeof(driverParams[0]))
 * 
 *     if rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeKernel:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_KERNEL
 *         err = toDriverKernelNodeParams(<const cudaKernelNodeParams *>&rtParams[0].kernel, <ccuda.CUDA_KERNEL_NODE_PARAMS *>&driverParams[0].kernel)
 */
  __pyx_t_1 = ((__pyx_v_rtParams[0]).type == cudaGraphNodeTypeKernel);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3372
 * 
 *     if rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeKernel:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_KERNEL             # <<<<<<<<<<<<<<
 *         err = toDriverKernelNodeParams(<const cudaKernelNodeParams *>&rtParams[0].kernel, <ccuda.CUDA_KERNEL_NODE_PARAMS *>&driverParams[0].kernel)
 *         if err != cudaSuccess:
 */
    (__pyx_v_driverParams[0]).type = CU_GRAPH_NODE_TYPE_KERNEL;

    /* "cuda/_lib/ccudart/utils.pyx":3373
 *     if rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeKernel:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_KERNEL
 *         err = toDriverKernelNodeParams(<const cudaKernelNodeParams *>&rtParams[0].kernel, <ccuda.CUDA_KERNEL_NODE_PARAMS *>&driverParams[0].kernel)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverKernelNodeParams(((struct cudaKernelNodeParams const *)(&(__pyx_v_rtParams[0]).kernel)), ((CUDA_KERNEL_NODE_PARAMS *)(&(__pyx_v_driverParams[0]).kernel))); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3373, __pyx_L1_error)
    __pyx_v_err = __pyx_t_2;

    /* "cuda/_lib/ccudart/utils.pyx":3374
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_KERNEL
 *         err = toDriverKernelNodeParams(<const cudaKernelNodeParams *>&rtParams[0].kernel, <ccuda.CUDA_KERNEL_NODE_PARAMS *>&driverParams[0].kernel)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemcpy:
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":3375
 *         err = toDriverKernelNodeParams(<const cudaKernelNodeParams *>&rtParams[0].kernel, <ccuda.CUDA_KERNEL_NODE_PARAMS *>&driverParams[0].kernel)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemcpy:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMCPY
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":3374
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_KERNEL
 *         err = toDriverKernelNodeParams(<const cudaKernelNodeParams *>&rtParams[0].kernel, <ccuda.CUDA_KERNEL_NODE_PARAMS *>&driverParams[0].kernel)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemcpy:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":3371
 *     memset(driverParams, 0, sizeof(driverParams[0]))
 * 
 *     if rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeKernel:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_KERNEL
 *         err = toDriverKernelNodeParams(<const cudaKernelNodeParams *>&rtParams[0].kernel, <ccuda.CUDA_KERNEL_NODE_PARAMS *>&driverParams[0].kernel)
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3376
 *         if err != cudaSuccess:
 *             return err
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemcpy:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMCPY
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 */
  __pyx_t_1 = ((__pyx_v_rtParams[0]).type == cudaGraphNodeTypeMemcpy);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3377
 *             return err
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemcpy:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMCPY             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *         if err != cudaSuccess:
 */
    (__pyx_v_driverParams[0]).type = CU_GRAPH_NODE_TYPE_MEMCPY;

    /* "cuda/_lib/ccudart/utils.pyx":3378
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemcpy:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMCPY
 *         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, 3378, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":3379
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMCPY
 *         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/utils.pyx":3380
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *         err = toDriverMemCopy3DParams(&rtParams[0].memcpy.copyParams, &driverParams[0].memcpy.copyParams)
 */
      __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, 3380, __pyx_L1_error)

      /* "cuda/_lib/ccudart/utils.pyx":3381
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *         err = toDriverMemCopy3DParams(&rtParams[0].memcpy.copyParams, &driverParams[0].memcpy.copyParams)
 *         if err != cudaSuccess:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":3379
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMCPY
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":3382
 *             _setLastError(err)
 *             return err
 *         err = toDriverMemCopy3DParams(&rtParams[0].memcpy.copyParams, &driverParams[0].memcpy.copyParams)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
    __pyx_t_2 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemCopy3DParams((&(__pyx_v_rtParams[0]).memcpy.copyParams), (&(__pyx_v_driverParams[0]).memcpy.copyParams)); if (unlikely(__pyx_t_2 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3382, __pyx_L1_error)
    __pyx_v_err = __pyx_t_2;

    /* "cuda/_lib/ccudart/utils.pyx":3383
 *             return err
 *         err = toDriverMemCopy3DParams(&rtParams[0].memcpy.copyParams, &driverParams[0].memcpy.copyParams)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         driverParams[0].memcpy.copyCtx = context
 */
    __pyx_t_1 = (__pyx_v_err != cudaSuccess);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":3384
 *         err = toDriverMemCopy3DParams(&rtParams[0].memcpy.copyParams, &driverParams[0].memcpy.copyParams)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *         driverParams[0].memcpy.copyCtx = context
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemset:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":3383
 *             return err
 *         err = toDriverMemCopy3DParams(&rtParams[0].memcpy.copyParams, &driverParams[0].memcpy.copyParams)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         driverParams[0].memcpy.copyCtx = context
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":3385
 *         if err != cudaSuccess:
 *             return err
 *         driverParams[0].memcpy.copyCtx = context             # <<<<<<<<<<<<<<
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemset:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMSET
 */
    (__pyx_v_driverParams[0]).memcpy.copyCtx = __pyx_v_context;

    /* "cuda/_lib/ccudart/utils.pyx":3376
 *         if err != cudaSuccess:
 *             return err
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemcpy:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMCPY
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3386
 *             return err
 *         driverParams[0].memcpy.copyCtx = context
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemset:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMSET
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 */
  __pyx_t_1 = ((__pyx_v_rtParams[0]).type == cudaGraphNodeTypeMemset);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3387
 *         driverParams[0].memcpy.copyCtx = context
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemset:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMSET             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *         if err != cudaSuccess:
 */
    (__pyx_v_driverParams[0]).type = CU_GRAPH_NODE_TYPE_MEMSET;

    /* "cuda/_lib/ccudart/utils.pyx":3388
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemset:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMSET
 *         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, 3388, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":3389
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMSET
 *         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/utils.pyx":3390
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *         toDriverMemsetNodeParams(<const cudaMemsetParams *>&rtParams[0].memset, <ccuda.CUDA_MEMSET_NODE_PARAMS *>&driverParams[0].memset)
 */
      __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, 3390, __pyx_L1_error)

      /* "cuda/_lib/ccudart/utils.pyx":3391
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *         toDriverMemsetNodeParams(<const cudaMemsetParams *>&rtParams[0].memset, <ccuda.CUDA_MEMSET_NODE_PARAMS *>&driverParams[0].memset)
 *         driverParams[0].memset.ctx = context
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":3389
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMSET
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":3392
 *             _setLastError(err)
 *             return err
 *         toDriverMemsetNodeParams(<const cudaMemsetParams *>&rtParams[0].memset, <ccuda.CUDA_MEMSET_NODE_PARAMS *>&driverParams[0].memset)             # <<<<<<<<<<<<<<
 *         driverParams[0].memset.ctx = context
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeHost:
 */
    __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverMemsetNodeParams(((struct cudaMemsetParams const *)(&(__pyx_v_rtParams[0]).memset)), ((CUDA_MEMSET_NODE_PARAMS *)(&(__pyx_v_driverParams[0]).memset)));

    /* "cuda/_lib/ccudart/utils.pyx":3393
 *             return err
 *         toDriverMemsetNodeParams(<const cudaMemsetParams *>&rtParams[0].memset, <ccuda.CUDA_MEMSET_NODE_PARAMS *>&driverParams[0].memset)
 *         driverParams[0].memset.ctx = context             # <<<<<<<<<<<<<<
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeHost:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_HOST
 */
    (__pyx_v_driverParams[0]).memset.ctx = __pyx_v_context;

    /* "cuda/_lib/ccudart/utils.pyx":3386
 *             return err
 *         driverParams[0].memcpy.copyCtx = context
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemset:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMSET
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3394
 *         toDriverMemsetNodeParams(<const cudaMemsetParams *>&rtParams[0].memset, <ccuda.CUDA_MEMSET_NODE_PARAMS *>&driverParams[0].memset)
 *         driverParams[0].memset.ctx = context
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeHost:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_HOST
 *         toDriverHostNodeParams(<const cudaHostNodeParams *>&rtParams[0].host, <ccuda.CUDA_HOST_NODE_PARAMS *>&driverParams[0].host)
 */
  __pyx_t_1 = ((__pyx_v_rtParams[0]).type == cudaGraphNodeTypeHost);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3395
 *         driverParams[0].memset.ctx = context
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeHost:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_HOST             # <<<<<<<<<<<<<<
 *         toDriverHostNodeParams(<const cudaHostNodeParams *>&rtParams[0].host, <ccuda.CUDA_HOST_NODE_PARAMS *>&driverParams[0].host)
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeGraph:
 */
    (__pyx_v_driverParams[0]).type = CU_GRAPH_NODE_TYPE_HOST;

    /* "cuda/_lib/ccudart/utils.pyx":3396
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeHost:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_HOST
 *         toDriverHostNodeParams(<const cudaHostNodeParams *>&rtParams[0].host, <ccuda.CUDA_HOST_NODE_PARAMS *>&driverParams[0].host)             # <<<<<<<<<<<<<<
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeGraph:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_GRAPH
 */
    __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverHostNodeParams(((struct cudaHostNodeParams const *)(&(__pyx_v_rtParams[0]).host)), ((CUDA_HOST_NODE_PARAMS *)(&(__pyx_v_driverParams[0]).host)));

    /* "cuda/_lib/ccudart/utils.pyx":3394
 *         toDriverMemsetNodeParams(<const cudaMemsetParams *>&rtParams[0].memset, <ccuda.CUDA_MEMSET_NODE_PARAMS *>&driverParams[0].memset)
 *         driverParams[0].memset.ctx = context
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeHost:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_HOST
 *         toDriverHostNodeParams(<const cudaHostNodeParams *>&rtParams[0].host, <ccuda.CUDA_HOST_NODE_PARAMS *>&driverParams[0].host)
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3397
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_HOST
 *         toDriverHostNodeParams(<const cudaHostNodeParams *>&rtParams[0].host, <ccuda.CUDA_HOST_NODE_PARAMS *>&driverParams[0].host)
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeGraph:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_GRAPH
 *         driverParams[0].graph.graph = rtParams[0].graph.graph
 */
  __pyx_t_1 = ((__pyx_v_rtParams[0]).type == cudaGraphNodeTypeGraph);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3398
 *         toDriverHostNodeParams(<const cudaHostNodeParams *>&rtParams[0].host, <ccuda.CUDA_HOST_NODE_PARAMS *>&driverParams[0].host)
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeGraph:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_GRAPH             # <<<<<<<<<<<<<<
 *         driverParams[0].graph.graph = rtParams[0].graph.graph
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeEmpty:
 */
    (__pyx_v_driverParams[0]).type = CU_GRAPH_NODE_TYPE_GRAPH;

    /* "cuda/_lib/ccudart/utils.pyx":3399
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeGraph:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_GRAPH
 *         driverParams[0].graph.graph = rtParams[0].graph.graph             # <<<<<<<<<<<<<<
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeEmpty:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EMPTY
 */
    __pyx_t_4 = (__pyx_v_rtParams[0]).graph.graph;
    (__pyx_v_driverParams[0]).graph.graph = __pyx_t_4;

    /* "cuda/_lib/ccudart/utils.pyx":3397
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_HOST
 *         toDriverHostNodeParams(<const cudaHostNodeParams *>&rtParams[0].host, <ccuda.CUDA_HOST_NODE_PARAMS *>&driverParams[0].host)
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeGraph:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_GRAPH
 *         driverParams[0].graph.graph = rtParams[0].graph.graph
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3400
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_GRAPH
 *         driverParams[0].graph.graph = rtParams[0].graph.graph
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeEmpty:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EMPTY
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeWaitEvent:
 */
  __pyx_t_1 = ((__pyx_v_rtParams[0]).type == cudaGraphNodeTypeEmpty);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3401
 *         driverParams[0].graph.graph = rtParams[0].graph.graph
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeEmpty:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EMPTY             # <<<<<<<<<<<<<<
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeWaitEvent:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_WAIT_EVENT
 */
    (__pyx_v_driverParams[0]).type = CU_GRAPH_NODE_TYPE_EMPTY;

    /* "cuda/_lib/ccudart/utils.pyx":3400
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_GRAPH
 *         driverParams[0].graph.graph = rtParams[0].graph.graph
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeEmpty:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EMPTY
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeWaitEvent:
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3402
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeEmpty:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EMPTY
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeWaitEvent:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_WAIT_EVENT
 *         driverParams[0].eventWait.event = rtParams[0].eventWait.event
 */
  __pyx_t_1 = ((__pyx_v_rtParams[0]).type == cudaGraphNodeTypeWaitEvent);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3403
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EMPTY
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeWaitEvent:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_WAIT_EVENT             # <<<<<<<<<<<<<<
 *         driverParams[0].eventWait.event = rtParams[0].eventWait.event
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeEventRecord:
 */
    (__pyx_v_driverParams[0]).type = CU_GRAPH_NODE_TYPE_WAIT_EVENT;

    /* "cuda/_lib/ccudart/utils.pyx":3404
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeWaitEvent:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_WAIT_EVENT
 *         driverParams[0].eventWait.event = rtParams[0].eventWait.event             # <<<<<<<<<<<<<<
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeEventRecord:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EVENT_RECORD
 */
    __pyx_t_5 = (__pyx_v_rtParams[0]).eventWait.event;
    (__pyx_v_driverParams[0]).eventWait.event = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":3402
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeEmpty:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EMPTY
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeWaitEvent:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_WAIT_EVENT
 *         driverParams[0].eventWait.event = rtParams[0].eventWait.event
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3405
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_WAIT_EVENT
 *         driverParams[0].eventWait.event = rtParams[0].eventWait.event
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeEventRecord:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EVENT_RECORD
 *         driverParams[0].eventRecord.event = rtParams[0].eventRecord.event
 */
  __pyx_t_1 = ((__pyx_v_rtParams[0]).type == cudaGraphNodeTypeEventRecord);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3406
 *         driverParams[0].eventWait.event = rtParams[0].eventWait.event
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeEventRecord:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EVENT_RECORD             # <<<<<<<<<<<<<<
 *         driverParams[0].eventRecord.event = rtParams[0].eventRecord.event
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreSignal:
 */
    (__pyx_v_driverParams[0]).type = CU_GRAPH_NODE_TYPE_EVENT_RECORD;

    /* "cuda/_lib/ccudart/utils.pyx":3407
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeEventRecord:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EVENT_RECORD
 *         driverParams[0].eventRecord.event = rtParams[0].eventRecord.event             # <<<<<<<<<<<<<<
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreSignal:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL
 */
    __pyx_t_5 = (__pyx_v_rtParams[0]).eventRecord.event;
    (__pyx_v_driverParams[0]).eventRecord.event = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":3405
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_WAIT_EVENT
 *         driverParams[0].eventWait.event = rtParams[0].eventWait.event
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeEventRecord:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EVENT_RECORD
 *         driverParams[0].eventRecord.event = rtParams[0].eventRecord.event
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3408
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EVENT_RECORD
 *         driverParams[0].eventRecord.event = rtParams[0].eventRecord.event
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreSignal:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL
 *         driverParams[0].extSemSignal = (<ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 *>(&rtParams[0].extSemSignal))[0]
 */
  __pyx_t_1 = ((__pyx_v_rtParams[0]).type == cudaGraphNodeTypeExtSemaphoreSignal);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3409
 *         driverParams[0].eventRecord.event = rtParams[0].eventRecord.event
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreSignal:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL             # <<<<<<<<<<<<<<
 *         driverParams[0].extSemSignal = (<ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 *>(&rtParams[0].extSemSignal))[0]
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreWait:
 */
    (__pyx_v_driverParams[0]).type = CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL;

    /* "cuda/_lib/ccudart/utils.pyx":3410
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreSignal:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL
 *         driverParams[0].extSemSignal = (<ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 *>(&rtParams[0].extSemSignal))[0]             # <<<<<<<<<<<<<<
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreWait:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT
 */
    (__pyx_v_driverParams[0]).extSemSignal = (((CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 *)(&(__pyx_v_rtParams[0]).extSemSignal))[0]);

    /* "cuda/_lib/ccudart/utils.pyx":3408
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EVENT_RECORD
 *         driverParams[0].eventRecord.event = rtParams[0].eventRecord.event
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreSignal:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL
 *         driverParams[0].extSemSignal = (<ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 *>(&rtParams[0].extSemSignal))[0]
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3411
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL
 *         driverParams[0].extSemSignal = (<ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 *>(&rtParams[0].extSemSignal))[0]
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreWait:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT
 *         driverParams[0].extSemWait = (<ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 *>&rtParams[0].extSemWait)[0]
 */
  __pyx_t_1 = ((__pyx_v_rtParams[0]).type == cudaGraphNodeTypeExtSemaphoreWait);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3412
 *         driverParams[0].extSemSignal = (<ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 *>(&rtParams[0].extSemSignal))[0]
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreWait:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT             # <<<<<<<<<<<<<<
 *         driverParams[0].extSemWait = (<ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 *>&rtParams[0].extSemWait)[0]
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemAlloc:
 */
    (__pyx_v_driverParams[0]).type = CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT;

    /* "cuda/_lib/ccudart/utils.pyx":3413
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreWait:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT
 *         driverParams[0].extSemWait = (<ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 *>&rtParams[0].extSemWait)[0]             # <<<<<<<<<<<<<<
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemAlloc:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_ALLOC
 */
    (__pyx_v_driverParams[0]).extSemWait = (((CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 *)(&(__pyx_v_rtParams[0]).extSemWait))[0]);

    /* "cuda/_lib/ccudart/utils.pyx":3411
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL
 *         driverParams[0].extSemSignal = (<ccuda.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 *>(&rtParams[0].extSemSignal))[0]
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreWait:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT
 *         driverParams[0].extSemWait = (<ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 *>&rtParams[0].extSemWait)[0]
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3414
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT
 *         driverParams[0].extSemWait = (<ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 *>&rtParams[0].extSemWait)[0]
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemAlloc:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_ALLOC
 *         driverParams[0].alloc = (<ccuda.CUDA_MEM_ALLOC_NODE_PARAMS_v2 *>&rtParams[0].alloc)[0]
 */
  __pyx_t_1 = ((__pyx_v_rtParams[0]).type == cudaGraphNodeTypeMemAlloc);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3415
 *         driverParams[0].extSemWait = (<ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 *>&rtParams[0].extSemWait)[0]
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemAlloc:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_ALLOC             # <<<<<<<<<<<<<<
 *         driverParams[0].alloc = (<ccuda.CUDA_MEM_ALLOC_NODE_PARAMS_v2 *>&rtParams[0].alloc)[0]
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemFree:
 */
    (__pyx_v_driverParams[0]).type = CU_GRAPH_NODE_TYPE_MEM_ALLOC;

    /* "cuda/_lib/ccudart/utils.pyx":3416
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemAlloc:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_ALLOC
 *         driverParams[0].alloc = (<ccuda.CUDA_MEM_ALLOC_NODE_PARAMS_v2 *>&rtParams[0].alloc)[0]             # <<<<<<<<<<<<<<
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemFree:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_FREE
 */
    (__pyx_v_driverParams[0]).alloc = (((CUDA_MEM_ALLOC_NODE_PARAMS_v2 *)(&(__pyx_v_rtParams[0]).alloc))[0]);

    /* "cuda/_lib/ccudart/utils.pyx":3414
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT
 *         driverParams[0].extSemWait = (<ccuda.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 *>&rtParams[0].extSemWait)[0]
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemAlloc:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_ALLOC
 *         driverParams[0].alloc = (<ccuda.CUDA_MEM_ALLOC_NODE_PARAMS_v2 *>&rtParams[0].alloc)[0]
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3417
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_ALLOC
 *         driverParams[0].alloc = (<ccuda.CUDA_MEM_ALLOC_NODE_PARAMS_v2 *>&rtParams[0].alloc)[0]
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemFree:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_FREE
 *         driverParams[0].free.dptr = <ccuda.CUdeviceptr>rtParams[0].free.dptr
 */
  __pyx_t_1 = ((__pyx_v_rtParams[0]).type == cudaGraphNodeTypeMemFree);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3418
 *         driverParams[0].alloc = (<ccuda.CUDA_MEM_ALLOC_NODE_PARAMS_v2 *>&rtParams[0].alloc)[0]
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemFree:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_FREE             # <<<<<<<<<<<<<<
 *         driverParams[0].free.dptr = <ccuda.CUdeviceptr>rtParams[0].free.dptr
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeConditional:
 */
    (__pyx_v_driverParams[0]).type = CU_GRAPH_NODE_TYPE_MEM_FREE;

    /* "cuda/_lib/ccudart/utils.pyx":3419
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemFree:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_FREE
 *         driverParams[0].free.dptr = <ccuda.CUdeviceptr>rtParams[0].free.dptr             # <<<<<<<<<<<<<<
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeConditional:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_CONDITIONAL
 */
    (__pyx_v_driverParams[0]).free.dptr = ((CUdeviceptr)(__pyx_v_rtParams[0]).free.dptr);

    /* "cuda/_lib/ccudart/utils.pyx":3417
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_ALLOC
 *         driverParams[0].alloc = (<ccuda.CUDA_MEM_ALLOC_NODE_PARAMS_v2 *>&rtParams[0].alloc)[0]
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeMemFree:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_FREE
 *         driverParams[0].free.dptr = <ccuda.CUdeviceptr>rtParams[0].free.dptr
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3420
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_FREE
 *         driverParams[0].free.dptr = <ccuda.CUdeviceptr>rtParams[0].free.dptr
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeConditional:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_CONDITIONAL
 *         # RT params mirror the driver params except the RT struct lacks the ctx at the end.
 */
  __pyx_t_1 = ((__pyx_v_rtParams[0]).type == cudaGraphNodeTypeConditional);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3421
 *         driverParams[0].free.dptr = <ccuda.CUdeviceptr>rtParams[0].free.dptr
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeConditional:
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_CONDITIONAL             # <<<<<<<<<<<<<<
 *         # RT params mirror the driver params except the RT struct lacks the ctx at the end.
 *         memcpy(&driverParams[0].conditional, &rtParams[0].conditional, sizeof(rtParams[0].conditional))
 */
    (__pyx_v_driverParams[0]).type = CU_GRAPH_NODE_TYPE_CONDITIONAL;

    /* "cuda/_lib/ccudart/utils.pyx":3423
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_CONDITIONAL
 *         # RT params mirror the driver params except the RT struct lacks the ctx at the end.
 *         memcpy(&driverParams[0].conditional, &rtParams[0].conditional, sizeof(rtParams[0].conditional))             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *         if err != cudaSuccess:
 */
    (void)(memcpy((&(__pyx_v_driverParams[0]).conditional), (&(__pyx_v_rtParams[0]).conditional), (sizeof((__pyx_v_rtParams[0]).conditional))));

    /* "cuda/_lib/ccudart/utils.pyx":3424
 *         # RT params mirror the driver params except the RT struct lacks the ctx at the end.
 *         memcpy(&driverParams[0].conditional, &rtParams[0].conditional, sizeof(rtParams[0].conditional))
 *         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, 3424, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":3425
 *         memcpy(&driverParams[0].conditional, &rtParams[0].conditional, sizeof(rtParams[0].conditional))
 *         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/utils.pyx":3426
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *         if err != cudaSuccess:
 *             _setLastError(err)             # <<<<<<<<<<<<<<
 *             return err
 *         driverParams[0].conditional.ctx = context
 */
      __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, 3426, __pyx_L1_error)

      /* "cuda/_lib/ccudart/utils.pyx":3427
 *         if err != cudaSuccess:
 *             _setLastError(err)
 *             return err             # <<<<<<<<<<<<<<
 *         driverParams[0].conditional.ctx = context
 *     else:
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":3425
 *         memcpy(&driverParams[0].conditional, &rtParams[0].conditional, sizeof(rtParams[0].conditional))
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             _setLastError(err)
 *             return err
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":3428
 *             _setLastError(err)
 *             return err
 *         driverParams[0].conditional.ctx = context             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorInvalidValue
 */
    (__pyx_v_driverParams[0]).conditional.ctx = __pyx_v_context;

    /* "cuda/_lib/ccudart/utils.pyx":3420
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_FREE
 *         driverParams[0].free.dptr = <ccuda.CUdeviceptr>rtParams[0].free.dptr
 *     elif rtParams[0].type == cudaGraphNodeType.cudaGraphNodeTypeConditional:             # <<<<<<<<<<<<<<
 *         driverParams[0].type = ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_CONDITIONAL
 *         # RT params mirror the driver params except the RT struct lacks the ctx at the end.
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3430
 *         driverParams[0].conditional.ctx = context
 *     else:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
  /*else*/ {
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "cuda/_lib/ccudart/utils.pyx":3431
 *     else:
 *         return cudaErrorInvalidValue
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":3366
 * 
 * 
 * cdef cudaError_t toDriverGraphNodeParams(const cudaGraphNodeParams *rtParams, ccuda.CUgraphNodeParams *driverParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     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.utils.toDriverGraphNodeParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":3434
 * 
 * 
 * cdef void toCudartGraphNodeOutParams(const ccuda.CUgraphNodeParams *driverParams, cudaGraphNodeParams *rtParams) noexcept nogil:             # <<<<<<<<<<<<<<
 *     if driverParams[0].type == ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_ALLOC:
 *         rtParams[0].alloc.dptr = <void *>driverParams[0].alloc.dptr
 */

static void __pyx_f_4cuda_4_lib_7ccudart_5utils_toCudartGraphNodeOutParams(CUgraphNodeParams const *__pyx_v_driverParams, struct cudaGraphNodeParams *__pyx_v_rtParams) {
  __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("toCudartGraphNodeOutParams", __pyx_f[0], 3434, 1, __PYX_ERR(0, 3434, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":3435
 * 
 * cdef void toCudartGraphNodeOutParams(const ccuda.CUgraphNodeParams *driverParams, cudaGraphNodeParams *rtParams) noexcept nogil:
 *     if driverParams[0].type == ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_ALLOC:             # <<<<<<<<<<<<<<
 *         rtParams[0].alloc.dptr = <void *>driverParams[0].alloc.dptr
 *     elif driverParams[0].type == ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_CONDITIONAL:
 */
  __pyx_t_1 = ((__pyx_v_driverParams[0]).type == CU_GRAPH_NODE_TYPE_MEM_ALLOC);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3436
 * cdef void toCudartGraphNodeOutParams(const ccuda.CUgraphNodeParams *driverParams, cudaGraphNodeParams *rtParams) noexcept nogil:
 *     if driverParams[0].type == ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_ALLOC:
 *         rtParams[0].alloc.dptr = <void *>driverParams[0].alloc.dptr             # <<<<<<<<<<<<<<
 *     elif driverParams[0].type == ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_CONDITIONAL:
 *         rtParams[0].conditional.phGraph_out = <cudaGraph_t *>driverParams[0].conditional.phGraph_out
 */
    (__pyx_v_rtParams[0]).alloc.dptr = ((void *)(__pyx_v_driverParams[0]).alloc.dptr);

    /* "cuda/_lib/ccudart/utils.pyx":3435
 * 
 * cdef void toCudartGraphNodeOutParams(const ccuda.CUgraphNodeParams *driverParams, cudaGraphNodeParams *rtParams) noexcept nogil:
 *     if driverParams[0].type == ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_ALLOC:             # <<<<<<<<<<<<<<
 *         rtParams[0].alloc.dptr = <void *>driverParams[0].alloc.dptr
 *     elif driverParams[0].type == ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_CONDITIONAL:
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":3437
 *     if driverParams[0].type == ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_ALLOC:
 *         rtParams[0].alloc.dptr = <void *>driverParams[0].alloc.dptr
 *     elif driverParams[0].type == ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_CONDITIONAL:             # <<<<<<<<<<<<<<
 *         rtParams[0].conditional.phGraph_out = <cudaGraph_t *>driverParams[0].conditional.phGraph_out
 * 
 */
  __pyx_t_1 = ((__pyx_v_driverParams[0]).type == CU_GRAPH_NODE_TYPE_CONDITIONAL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3438
 *         rtParams[0].alloc.dptr = <void *>driverParams[0].alloc.dptr
 *     elif driverParams[0].type == ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_CONDITIONAL:
 *         rtParams[0].conditional.phGraph_out = <cudaGraph_t *>driverParams[0].conditional.phGraph_out             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_rtParams[0]).conditional.phGraph_out = ((cudaGraph_t *)(__pyx_v_driverParams[0]).conditional.phGraph_out);

    /* "cuda/_lib/ccudart/utils.pyx":3437
 *     if driverParams[0].type == ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_ALLOC:
 *         rtParams[0].alloc.dptr = <void *>driverParams[0].alloc.dptr
 *     elif driverParams[0].type == ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_CONDITIONAL:             # <<<<<<<<<<<<<<
 *         rtParams[0].conditional.phGraph_out = <cudaGraph_t *>driverParams[0].conditional.phGraph_out
 * 
 */
  }
  __pyx_L3:;

  /* "cuda/_lib/ccudart/utils.pyx":3434
 * 
 * 
 * cdef void toCudartGraphNodeOutParams(const ccuda.CUgraphNodeParams *driverParams, cudaGraphNodeParams *rtParams) noexcept nogil:             # <<<<<<<<<<<<<<
 *     if driverParams[0].type == ccuda.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_ALLOC:
 *         rtParams[0].alloc.dptr = <void *>driverParams[0].alloc.dptr
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_WriteUnraisable("cuda._lib.ccudart.utils.toCudartGraphNodeOutParams", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
}

/* "cuda/_lib/ccudart/utils.pyx":3441
 * 
 * 
 * cdef cudaError_t toDriverKernelNodeParams(const cudaKernelNodeParams nodeParams[0], ccuda.CUDA_KERNEL_NODE_PARAMS *driverNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef ccuda.CUcontext context
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverKernelNodeParams(struct cudaKernelNodeParams const *__pyx_v_nodeParams, CUDA_KERNEL_NODE_PARAMS *__pyx_v_driverNodeParams) {
  cudaError_t __pyx_v_err;
  CUcontext __pyx_v_context;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  CUresult __pyx_t_1;
  int __pyx_t_2;
  cudaError_t __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("toDriverKernelNodeParams", __pyx_f[0], 3441, 1, __PYX_ERR(0, 3441, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":3442
 * 
 * cdef cudaError_t toDriverKernelNodeParams(const cudaKernelNodeParams nodeParams[0], ccuda.CUDA_KERNEL_NODE_PARAMS *driverNodeParams) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUcontext context
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 */
  __pyx_v_err = cudaSuccess;

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

  /* "cuda/_lib/ccudart/utils.pyx":3445
 *     cdef ccuda.CUcontext context
 *     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/utils.pyx":3446
 *     err = <cudaError_t>ccuda._cuCtxGetCurrent(&context)
 *     if err != cudaSuccess:
 *         _setLastError(err)             # <<<<<<<<<<<<<<
 *         return err
 *     driverNodeParams[0].func = <ccuda.CUfunction>nodeParams[0].func
 */
    __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, 3446, __pyx_L1_error)

    /* "cuda/_lib/ccudart/utils.pyx":3447
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 *     driverNodeParams[0].func = <ccuda.CUfunction>nodeParams[0].func
 *     driverNodeParams[0].kern = NULL
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

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

  /* "cuda/_lib/ccudart/utils.pyx":3448
 *         _setLastError(err)
 *         return err
 *     driverNodeParams[0].func = <ccuda.CUfunction>nodeParams[0].func             # <<<<<<<<<<<<<<
 *     driverNodeParams[0].kern = NULL
 *     driverNodeParams[0].ctx = context
 */
  (__pyx_v_driverNodeParams[0]).func = ((CUfunction)(__pyx_v_nodeParams[0]).func);

  /* "cuda/_lib/ccudart/utils.pyx":3449
 *         return err
 *     driverNodeParams[0].func = <ccuda.CUfunction>nodeParams[0].func
 *     driverNodeParams[0].kern = NULL             # <<<<<<<<<<<<<<
 *     driverNodeParams[0].ctx = context
 *     driverNodeParams[0].gridDimX = nodeParams[0].gridDim.x
 */
  (__pyx_v_driverNodeParams[0]).kern = NULL;

  /* "cuda/_lib/ccudart/utils.pyx":3450
 *     driverNodeParams[0].func = <ccuda.CUfunction>nodeParams[0].func
 *     driverNodeParams[0].kern = NULL
 *     driverNodeParams[0].ctx = context             # <<<<<<<<<<<<<<
 *     driverNodeParams[0].gridDimX = nodeParams[0].gridDim.x
 *     driverNodeParams[0].gridDimY = nodeParams[0].gridDim.y
 */
  (__pyx_v_driverNodeParams[0]).ctx = __pyx_v_context;

  /* "cuda/_lib/ccudart/utils.pyx":3451
 *     driverNodeParams[0].kern = NULL
 *     driverNodeParams[0].ctx = context
 *     driverNodeParams[0].gridDimX = nodeParams[0].gridDim.x             # <<<<<<<<<<<<<<
 *     driverNodeParams[0].gridDimY = nodeParams[0].gridDim.y
 *     driverNodeParams[0].gridDimZ = nodeParams[0].gridDim.z
 */
  __pyx_t_4 = (__pyx_v_nodeParams[0]).gridDim.x;
  (__pyx_v_driverNodeParams[0]).gridDimX = __pyx_t_4;

  /* "cuda/_lib/ccudart/utils.pyx":3452
 *     driverNodeParams[0].ctx = context
 *     driverNodeParams[0].gridDimX = nodeParams[0].gridDim.x
 *     driverNodeParams[0].gridDimY = nodeParams[0].gridDim.y             # <<<<<<<<<<<<<<
 *     driverNodeParams[0].gridDimZ = nodeParams[0].gridDim.z
 *     driverNodeParams[0].blockDimX = nodeParams[0].blockDim.x
 */
  __pyx_t_4 = (__pyx_v_nodeParams[0]).gridDim.y;
  (__pyx_v_driverNodeParams[0]).gridDimY = __pyx_t_4;

  /* "cuda/_lib/ccudart/utils.pyx":3453
 *     driverNodeParams[0].gridDimX = nodeParams[0].gridDim.x
 *     driverNodeParams[0].gridDimY = nodeParams[0].gridDim.y
 *     driverNodeParams[0].gridDimZ = nodeParams[0].gridDim.z             # <<<<<<<<<<<<<<
 *     driverNodeParams[0].blockDimX = nodeParams[0].blockDim.x
 *     driverNodeParams[0].blockDimY = nodeParams[0].blockDim.y
 */
  __pyx_t_4 = (__pyx_v_nodeParams[0]).gridDim.z;
  (__pyx_v_driverNodeParams[0]).gridDimZ = __pyx_t_4;

  /* "cuda/_lib/ccudart/utils.pyx":3454
 *     driverNodeParams[0].gridDimY = nodeParams[0].gridDim.y
 *     driverNodeParams[0].gridDimZ = nodeParams[0].gridDim.z
 *     driverNodeParams[0].blockDimX = nodeParams[0].blockDim.x             # <<<<<<<<<<<<<<
 *     driverNodeParams[0].blockDimY = nodeParams[0].blockDim.y
 *     driverNodeParams[0].blockDimZ = nodeParams[0].blockDim.z
 */
  __pyx_t_4 = (__pyx_v_nodeParams[0]).blockDim.x;
  (__pyx_v_driverNodeParams[0]).blockDimX = __pyx_t_4;

  /* "cuda/_lib/ccudart/utils.pyx":3455
 *     driverNodeParams[0].gridDimZ = nodeParams[0].gridDim.z
 *     driverNodeParams[0].blockDimX = nodeParams[0].blockDim.x
 *     driverNodeParams[0].blockDimY = nodeParams[0].blockDim.y             # <<<<<<<<<<<<<<
 *     driverNodeParams[0].blockDimZ = nodeParams[0].blockDim.z
 *     driverNodeParams[0].sharedMemBytes = nodeParams[0].sharedMemBytes
 */
  __pyx_t_4 = (__pyx_v_nodeParams[0]).blockDim.y;
  (__pyx_v_driverNodeParams[0]).blockDimY = __pyx_t_4;

  /* "cuda/_lib/ccudart/utils.pyx":3456
 *     driverNodeParams[0].blockDimX = nodeParams[0].blockDim.x
 *     driverNodeParams[0].blockDimY = nodeParams[0].blockDim.y
 *     driverNodeParams[0].blockDimZ = nodeParams[0].blockDim.z             # <<<<<<<<<<<<<<
 *     driverNodeParams[0].sharedMemBytes = nodeParams[0].sharedMemBytes
 *     driverNodeParams[0].kernelParams = nodeParams[0].kernelParams
 */
  __pyx_t_4 = (__pyx_v_nodeParams[0]).blockDim.z;
  (__pyx_v_driverNodeParams[0]).blockDimZ = __pyx_t_4;

  /* "cuda/_lib/ccudart/utils.pyx":3457
 *     driverNodeParams[0].blockDimY = nodeParams[0].blockDim.y
 *     driverNodeParams[0].blockDimZ = nodeParams[0].blockDim.z
 *     driverNodeParams[0].sharedMemBytes = nodeParams[0].sharedMemBytes             # <<<<<<<<<<<<<<
 *     driverNodeParams[0].kernelParams = nodeParams[0].kernelParams
 *     driverNodeParams[0].extra = nodeParams[0].extra
 */
  __pyx_t_4 = (__pyx_v_nodeParams[0]).sharedMemBytes;
  (__pyx_v_driverNodeParams[0]).sharedMemBytes = __pyx_t_4;

  /* "cuda/_lib/ccudart/utils.pyx":3458
 *     driverNodeParams[0].blockDimZ = nodeParams[0].blockDim.z
 *     driverNodeParams[0].sharedMemBytes = nodeParams[0].sharedMemBytes
 *     driverNodeParams[0].kernelParams = nodeParams[0].kernelParams             # <<<<<<<<<<<<<<
 *     driverNodeParams[0].extra = nodeParams[0].extra
 *     return err
 */
  __pyx_t_5 = (__pyx_v_nodeParams[0]).kernelParams;
  (__pyx_v_driverNodeParams[0]).kernelParams = __pyx_t_5;

  /* "cuda/_lib/ccudart/utils.pyx":3459
 *     driverNodeParams[0].sharedMemBytes = nodeParams[0].sharedMemBytes
 *     driverNodeParams[0].kernelParams = nodeParams[0].kernelParams
 *     driverNodeParams[0].extra = nodeParams[0].extra             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
  __pyx_t_5 = (__pyx_v_nodeParams[0]).extra;
  (__pyx_v_driverNodeParams[0]).extra = __pyx_t_5;

  /* "cuda/_lib/ccudart/utils.pyx":3460
 *     driverNodeParams[0].kernelParams = nodeParams[0].kernelParams
 *     driverNodeParams[0].extra = nodeParams[0].extra
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":3441
 * 
 * 
 * cdef cudaError_t toDriverKernelNodeParams(const cudaKernelNodeParams nodeParams[0], ccuda.CUDA_KERNEL_NODE_PARAMS *driverNodeParams) 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.utils.toDriverKernelNodeParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":3463
 * 
 * 
 * cdef void toDriverHostNodeParams(const cudaHostNodeParams *pRuntimeNodeParams, ccuda.CUDA_HOST_NODE_PARAMS *pDriverNodeParams) noexcept nogil:             # <<<<<<<<<<<<<<
 *     pDriverNodeParams[0].fn = pRuntimeNodeParams[0].fn
 *     pDriverNodeParams[0].userData = pRuntimeNodeParams[0].userData
 */

static void __pyx_f_4cuda_4_lib_7ccudart_5utils_toDriverHostNodeParams(struct cudaHostNodeParams const *__pyx_v_pRuntimeNodeParams, CUDA_HOST_NODE_PARAMS *__pyx_v_pDriverNodeParams) {
  __Pyx_TraceDeclarations
  cudaHostFn_t __pyx_t_1;
  void *__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("toDriverHostNodeParams", __pyx_f[0], 3463, 1, __PYX_ERR(0, 3463, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":3464
 * 
 * cdef void toDriverHostNodeParams(const cudaHostNodeParams *pRuntimeNodeParams, ccuda.CUDA_HOST_NODE_PARAMS *pDriverNodeParams) noexcept nogil:
 *     pDriverNodeParams[0].fn = pRuntimeNodeParams[0].fn             # <<<<<<<<<<<<<<
 *     pDriverNodeParams[0].userData = pRuntimeNodeParams[0].userData
 * 
 */
  __pyx_t_1 = (__pyx_v_pRuntimeNodeParams[0]).fn;
  (__pyx_v_pDriverNodeParams[0]).fn = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":3465
 * cdef void toDriverHostNodeParams(const cudaHostNodeParams *pRuntimeNodeParams, ccuda.CUDA_HOST_NODE_PARAMS *pDriverNodeParams) noexcept nogil:
 *     pDriverNodeParams[0].fn = pRuntimeNodeParams[0].fn
 *     pDriverNodeParams[0].userData = pRuntimeNodeParams[0].userData             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = (__pyx_v_pRuntimeNodeParams[0]).userData;
  (__pyx_v_pDriverNodeParams[0]).userData = __pyx_t_2;

  /* "cuda/_lib/ccudart/utils.pyx":3463
 * 
 * 
 * cdef void toDriverHostNodeParams(const cudaHostNodeParams *pRuntimeNodeParams, ccuda.CUDA_HOST_NODE_PARAMS *pDriverNodeParams) noexcept nogil:             # <<<<<<<<<<<<<<
 *     pDriverNodeParams[0].fn = pRuntimeNodeParams[0].fn
 *     pDriverNodeParams[0].userData = pRuntimeNodeParams[0].userData
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_WriteUnraisable("cuda._lib.ccudart.utils.toDriverHostNodeParams", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
}

/* "cuda/_lib/ccudart/utils.pyx":3469
 * 
 * @cython.show_performance_hints(False)
 * cdef void cudaAsyncNotificationCallbackWrapper(cudaAsyncNotificationInfo_t *info, void *data, cudaAsyncCallbackHandle_t handle) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaAsyncCallbackData *cbData = <cudaAsyncCallbackData *>data
 *     with gil:
 */

static void __pyx_f_4cuda_4_lib_7ccudart_5utils_cudaAsyncNotificationCallbackWrapper(cudaAsyncNotificationInfo_t *__pyx_v_info, void *__pyx_v_data, cudaAsyncCallbackHandle_t __pyx_v_handle) {
  __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaAsyncCallbackData *__pyx_v_cbData;
  __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("cudaAsyncNotificationCallbackWrapper", __pyx_f[0], 3469, 1, __PYX_ERR(0, 3469, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":3470
 * @cython.show_performance_hints(False)
 * cdef void cudaAsyncNotificationCallbackWrapper(cudaAsyncNotificationInfo_t *info, void *data, cudaAsyncCallbackHandle_t handle) nogil:
 *     cdef cudaAsyncCallbackData *cbData = <cudaAsyncCallbackData *>data             # <<<<<<<<<<<<<<
 *     with gil:
 *         cbData.callback(info, cbData.userData, handle)
 */
  __pyx_v_cbData = ((__pyx_t_4cuda_4_lib_7ccudart_5utils_cudaAsyncCallbackData *)__pyx_v_data);

  /* "cuda/_lib/ccudart/utils.pyx":3471
 * cdef void cudaAsyncNotificationCallbackWrapper(cudaAsyncNotificationInfo_t *info, void *data, cudaAsyncCallbackHandle_t handle) nogil:
 *     cdef cudaAsyncCallbackData *cbData = <cudaAsyncCallbackData *>data
 *     with gil:             # <<<<<<<<<<<<<<
 *         cbData.callback(info, cbData.userData, handle)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      /*try:*/ {

        /* "cuda/_lib/ccudart/utils.pyx":3472
 *     cdef cudaAsyncCallbackData *cbData = <cudaAsyncCallbackData *>data
 *     with gil:
 *         cbData.callback(info, cbData.userData, handle)             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_v_cbData->callback(__pyx_v_info, __pyx_v_cbData->userData, __pyx_v_handle);
      }

      /* "cuda/_lib/ccudart/utils.pyx":3471
 * cdef void cudaAsyncNotificationCallbackWrapper(cudaAsyncNotificationInfo_t *info, void *data, cudaAsyncCallbackHandle_t handle) nogil:
 *     cdef cudaAsyncCallbackData *cbData = <cudaAsyncCallbackData *>data
 *     with gil:             # <<<<<<<<<<<<<<
 *         cbData.callback(info, cbData.userData, handle)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cuda/_lib/ccudart/utils.pyx":3469
 * 
 * @cython.show_performance_hints(False)
 * cdef void cudaAsyncNotificationCallbackWrapper(cudaAsyncNotificationInfo_t *info, void *data, cudaAsyncCallbackHandle_t handle) nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaAsyncCallbackData *cbData = <cudaAsyncCallbackData *>data
 *     with gil:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":3475
 * 
 * 
 * cdef cudaError_t DeviceRegisterAsyncNotificationCommon(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaAsyncCallbackData *cbData = NULL
 *     cdef cudaError_t err = cudaSuccess
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_DeviceRegisterAsyncNotificationCommon(int __pyx_v_device, cudaAsyncCallback __pyx_v_callbackFunc, void *__pyx_v_userData, cudaAsyncCallbackHandle_t *__pyx_v_callback) {
  __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaAsyncCallbackData *__pyx_v_cbData;
  cudaError_t __pyx_v_err;
  cudaError_t __pyx_r;
  __Pyx_TraceDeclarations
  int __pyx_t_1;
  CUresult __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("DeviceRegisterAsyncNotificationCommon", __pyx_f[0], 3475, 1, __PYX_ERR(0, 3475, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":3476
 * 
 * cdef cudaError_t DeviceRegisterAsyncNotificationCommon(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaAsyncCallbackData *cbData = NULL             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cbData = <cudaAsyncCallbackData *>malloc(sizeof(cbData[0]))
 */
  __pyx_v_cbData = NULL;

  /* "cuda/_lib/ccudart/utils.pyx":3477
 * cdef cudaError_t DeviceRegisterAsyncNotificationCommon(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaAsyncCallbackData *cbData = NULL
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cbData = <cudaAsyncCallbackData *>malloc(sizeof(cbData[0]))
 * 
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":3478
 *     cdef cudaAsyncCallbackData *cbData = NULL
 *     cdef cudaError_t err = cudaSuccess
 *     cbData = <cudaAsyncCallbackData *>malloc(sizeof(cbData[0]))             # <<<<<<<<<<<<<<
 * 
 *     if cbData == NULL:
 */
  __pyx_v_cbData = ((__pyx_t_4cuda_4_lib_7ccudart_5utils_cudaAsyncCallbackData *)malloc((sizeof((__pyx_v_cbData[0])))));

  /* "cuda/_lib/ccudart/utils.pyx":3480
 *     cbData = <cudaAsyncCallbackData *>malloc(sizeof(cbData[0]))
 * 
 *     if cbData == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorMemoryAllocation
 * 
 */
  __pyx_t_1 = (__pyx_v_cbData == NULL);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3481
 * 
 *     if cbData == NULL:
 *         return cudaErrorMemoryAllocation             # <<<<<<<<<<<<<<
 * 
 *     cbData.callback = callbackFunc
 */
    __pyx_r = cudaErrorMemoryAllocation;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":3480
 *     cbData = <cudaAsyncCallbackData *>malloc(sizeof(cbData[0]))
 * 
 *     if cbData == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorMemoryAllocation
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":3483
 *         return cudaErrorMemoryAllocation
 * 
 *     cbData.callback = callbackFunc             # <<<<<<<<<<<<<<
 *     cbData.userData = userData
 *     err = <cudaError_t>ccuda._cuDeviceRegisterAsyncNotification(<ccuda.CUdevice>device, <ccuda.CUasyncCallback>cudaAsyncNotificationCallbackWrapper, <void*>cbData, <ccuda.CUasyncCallbackHandle*>callback)
 */
  __pyx_v_cbData->callback = __pyx_v_callbackFunc;

  /* "cuda/_lib/ccudart/utils.pyx":3484
 * 
 *     cbData.callback = callbackFunc
 *     cbData.userData = userData             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDeviceRegisterAsyncNotification(<ccuda.CUdevice>device, <ccuda.CUasyncCallback>cudaAsyncNotificationCallbackWrapper, <void*>cbData, <ccuda.CUasyncCallbackHandle*>callback)
 *     if err != cudaSuccess:
 */
  __pyx_v_cbData->userData = __pyx_v_userData;

  /* "cuda/_lib/ccudart/utils.pyx":3485
 *     cbData.callback = callbackFunc
 *     cbData.userData = userData
 *     err = <cudaError_t>ccuda._cuDeviceRegisterAsyncNotification(<ccuda.CUdevice>device, <ccuda.CUasyncCallback>cudaAsyncNotificationCallbackWrapper, <void*>cbData, <ccuda.CUasyncCallbackHandle*>callback)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         free(cbData)
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceRegisterAsyncNotification(((CUdevice)__pyx_v_device), ((CUasyncCallback)__pyx_f_4cuda_4_lib_7ccudart_5utils_cudaAsyncNotificationCallbackWrapper), ((void *)__pyx_v_cbData), ((CUasyncCallbackHandle *)__pyx_v_callback)); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3485, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/utils.pyx":3486
 *     cbData.userData = userData
 *     err = <cudaError_t>ccuda._cuDeviceRegisterAsyncNotification(<ccuda.CUdevice>device, <ccuda.CUasyncCallback>cudaAsyncNotificationCallbackWrapper, <void*>cbData, <ccuda.CUasyncCallbackHandle*>callback)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         free(cbData)
 * 
 */
  __pyx_t_1 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":3487
 *     err = <cudaError_t>ccuda._cuDeviceRegisterAsyncNotification(<ccuda.CUdevice>device, <ccuda.CUasyncCallback>cudaAsyncNotificationCallbackWrapper, <void*>cbData, <ccuda.CUasyncCallbackHandle*>callback)
 *     if err != cudaSuccess:
 *         free(cbData)             # <<<<<<<<<<<<<<
 * 
 *     m_global._asyncCallbackDataMap[callback[0]] = cbData
 */
    free(__pyx_v_cbData);

    /* "cuda/_lib/ccudart/utils.pyx":3486
 *     cbData.userData = userData
 *     err = <cudaError_t>ccuda._cuDeviceRegisterAsyncNotification(<ccuda.CUdevice>device, <ccuda.CUasyncCallback>cudaAsyncNotificationCallbackWrapper, <void*>cbData, <ccuda.CUasyncCallbackHandle*>callback)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         free(cbData)
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":3489
 *         free(cbData)
 * 
 *     m_global._asyncCallbackDataMap[callback[0]] = cbData             # <<<<<<<<<<<<<<
 * 
 *     return err
 */
  (__pyx_v_4cuda_4_lib_7ccudart_5utils_m_global->_asyncCallbackDataMap[(__pyx_v_callback[0])]) = __pyx_v_cbData;

  /* "cuda/_lib/ccudart/utils.pyx":3491
 *     m_global._asyncCallbackDataMap[callback[0]] = cbData
 * 
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t DeviceUnregisterAsyncNotificationCommon(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":3475
 * 
 * 
 * cdef cudaError_t DeviceRegisterAsyncNotificationCommon(int device, cudaAsyncCallback callbackFunc, void* userData, cudaAsyncCallbackHandle_t* callback) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaAsyncCallbackData *cbData = 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.utils.DeviceRegisterAsyncNotificationCommon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":3493
 *     return err
 * 
 * cdef cudaError_t DeviceUnregisterAsyncNotificationCommon(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceUnregisterAsyncNotification(<ccuda.CUdevice>device, <ccuda.CUasyncCallbackHandle>callback)
 */

static cudaError_t __pyx_f_4cuda_4_lib_7ccudart_5utils_DeviceUnregisterAsyncNotificationCommon(int __pyx_v_device, cudaAsyncCallbackHandle_t __pyx_v_callback) {
  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("DeviceUnregisterAsyncNotificationCommon", __pyx_f[0], 3493, 1, __PYX_ERR(0, 3493, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":3494
 * 
 * cdef cudaError_t DeviceUnregisterAsyncNotificationCommon(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     err = <cudaError_t>ccuda._cuDeviceUnregisterAsyncNotification(<ccuda.CUdevice>device, <ccuda.CUasyncCallbackHandle>callback)
 *     if err != cudaSuccess:
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":3495
 * cdef cudaError_t DeviceUnregisterAsyncNotificationCommon(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil:
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceUnregisterAsyncNotification(<ccuda.CUdevice>device, <ccuda.CUasyncCallbackHandle>callback)             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         _setLastError(err)
 */
  __pyx_t_1 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceUnregisterAsyncNotification(((CUdevice)__pyx_v_device), ((CUasyncCallbackHandle)__pyx_v_callback)); if (unlikely(__pyx_t_1 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3495, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/utils.pyx":3496
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceUnregisterAsyncNotification(<ccuda.CUdevice>device, <ccuda.CUasyncCallbackHandle>callback)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  __pyx_t_2 = (__pyx_v_err != cudaSuccess);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":3497
 *     err = <cudaError_t>ccuda._cuDeviceUnregisterAsyncNotification(<ccuda.CUdevice>device, <ccuda.CUasyncCallbackHandle>callback)
 *     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, 3497, __pyx_L1_error)

    /* "cuda/_lib/ccudart/utils.pyx":3498
 *     if err != cudaSuccess:
 *         _setLastError(err)
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     free(m_global._asyncCallbackDataMap[callback])
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":3496
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceUnregisterAsyncNotification(<ccuda.CUdevice>device, <ccuda.CUasyncCallbackHandle>callback)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         _setLastError(err)
 *         return err
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":3500
 *         return err
 * 
 *     free(m_global._asyncCallbackDataMap[callback])             # <<<<<<<<<<<<<<
 *     m_global._asyncCallbackDataMap.erase(callback)
 * 
 */
  free((__pyx_v_4cuda_4_lib_7ccudart_5utils_m_global->_asyncCallbackDataMap[__pyx_v_callback]));

  /* "cuda/_lib/ccudart/utils.pyx":3501
 * 
 *     free(m_global._asyncCallbackDataMap[callback])
 *     m_global._asyncCallbackDataMap.erase(callback)             # <<<<<<<<<<<<<<
 * 
 *     return err
 */
  (void)(__pyx_v_4cuda_4_lib_7ccudart_5utils_m_global->_asyncCallbackDataMap.erase(__pyx_v_callback));

  /* "cuda/_lib/ccudart/utils.pyx":3503
 *     m_global._asyncCallbackDataMap.erase(callback)
 * 
 *     return err             # <<<<<<<<<<<<<<
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":3493
 *     return err
 * 
 * cdef cudaError_t DeviceUnregisterAsyncNotificationCommon(int device, cudaAsyncCallbackHandle_t callback) except ?cudaErrorCallRequiresNewerDriver nogil:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     err = <cudaError_t>ccuda._cuDeviceUnregisterAsyncNotification(<ccuda.CUdevice>device, <ccuda.CUasyncCallbackHandle>callback)
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cuda._lib.ccudart.utils.DeviceUnregisterAsyncNotificationCommon", __pyx_clineno, __pyx_lineno, __pyx_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 struct __pyx_vtabstruct_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal __pyx_vtable_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal;

static PyObject *__pyx_tp_new_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)o);
  p->__pyx_vtab = __pyx_vtabptr_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal;
  new((void*)&(p->_asyncCallbackDataMap)) std::map<cudaAsyncCallbackHandle_t,__pyx_t_4cuda_4_lib_7ccudart_5utils_cudaAsyncCallbackData *> ();
  if (unlikely(__pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal(PyObject *o) {
  struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *p = (struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(p->_asyncCallbackDataMap);
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyMethodDef __pyx_methods_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal[] = {
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_6__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal},
  {Py_tp_methods, (void *)__pyx_methods_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal},
  {Py_tp_new, (void *)__pyx_tp_new_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal},
  {0, 0},
};
static PyType_Spec __pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal_spec = {
  "cuda._lib.ccudart.utils.cudaPythonGlobal",
  sizeof(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal_slots,
};
#else

static PyTypeObject __pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal = {
  PyVarObject_HEAD_INIT(0, 0)
  "cuda._lib.ccudart.utils.""cudaPythonGlobal", /*tp_name*/
  sizeof(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

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_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
    {&__pyx_n_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 1},
    {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 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_cudaPythonGlobal, __pyx_k_cudaPythonGlobal, sizeof(__pyx_k_cudaPythonGlobal), 0, 0, 1, 1},
    {&__pyx_n_s_cudaPythonGlobal___reduce_cython, __pyx_k_cudaPythonGlobal___reduce_cython, sizeof(__pyx_k_cudaPythonGlobal___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_cudaPythonGlobal___setstate_cyth, __pyx_k_cudaPythonGlobal___setstate_cyth, sizeof(__pyx_k_cudaPythonGlobal___setstate_cyth), 0, 0, 1, 1},
    {&__pyx_n_s_cuda__lib_ccudart_utils, __pyx_k_cuda__lib_ccudart_utils, sizeof(__pyx_k_cuda__lib_ccudart_utils), 0, 0, 1, 1},
    {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
    {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
    {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
    {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
    {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
    {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
    {&__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_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
    {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 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_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
    {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
    {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
    {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
    {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
    {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
    {&__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, 66, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __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);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);
  __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);
  __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### 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_5utils_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("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_ExportFunction("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_ExportFunction("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_ExportFunction("_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_ExportFunction("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_ExportFunction("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_ExportFunction("streamAddHostCallbackCommon", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_5utils_streamAddHostCallbackCommon, "cudaError_t (cudaStream_t, cudaHostFn_t, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("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_ExportFunction("streamGetCaptureInfoCommon_v3", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_5utils_streamGetCaptureInfoCommon_v3, "cudaError_t (cudaStream_t, enum cudaStreamCaptureStatus *, unsigned PY_LONG_LONG *, cudaGraph_t *, cudaGraphNode_t const **, cudaGraphEdgeData const **, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("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_ExportFunction("copyFromHost2D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromHost2D, "cudaError_t (cudaArray_const_t, size_t, size_t, char const *, size_t, size_t, size_t, CUstream, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("copyFromDevice2D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromDevice2D, "cudaError_t (CUmemorytype, cudaArray_const_t, size_t, size_t, char const *, size_t, size_t, size_t, size_t, CUstream, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("copyToHost2D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_5utils_copyToHost2D, "cudaError_t (cudaArray_const_t, size_t, size_t, char *, size_t, size_t, size_t, CUstream, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("copyToDevice2D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_5utils_copyToDevice2D, "cudaError_t (CUmemorytype, cudaArray_const_t, size_t, size_t, char const *, size_t, size_t, size_t, size_t, CUstream, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("copyToArray2D", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_5utils_copyToArray2D, "cudaError_t (cudaArray_const_t, size_t, size_t, cudaArray_t, size_t, size_t, size_t, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("memsetPtr", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_5utils_memsetPtr, "cudaError_t (char *, int, size_t, cudaStream_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("memset2DPtr", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_5utils_memset2DPtr, "cudaError_t (char *, size_t, int, size_t, size_t, cudaStream_t, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("copyFromHost", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromHost, "cudaError_t (cudaArray_const_t, size_t, size_t, char const *, size_t, CUstream, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("copyFromDevice", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_5utils_copyFromDevice, "cudaError_t (CUmemorytype, cudaArray_const_t, size_t, size_t, char const *, size_t, size_t, CUstream, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("copyToHost", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_5utils_copyToHost, "cudaError_t (cudaArray_const_t, size_t, size_t, char *, size_t, CUstream, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("copyToDevice", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_5utils_copyToDevice, "cudaError_t (CUmemorytype, cudaArray_const_t, size_t, size_t, char const *, size_t, size_t, CUstream, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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_ExportFunction("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)
  if (__Pyx_ExportFunction("DeviceRegisterAsyncNotificationCommon", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_5utils_DeviceRegisterAsyncNotificationCommon, "cudaError_t (int, cudaAsyncCallback, void *, cudaAsyncCallbackHandle_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("DeviceUnregisterAsyncNotificationCommon", (void (*)(void))__pyx_f_4cuda_4_lib_7ccudart_5utils_DeviceUnregisterAsyncNotificationCommon, "cudaError_t (int, cudaAsyncCallbackHandle_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_vtabptr_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal = &__pyx_vtable_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal;
  __pyx_vtable_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal.lazyInitDriver = (cudaError_t (*)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *))__pyx_f_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_lazyInitDriver;
  __pyx_vtable_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal.lazyInitContextState = (cudaError_t (*)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *))__pyx_f_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_lazyInitContextState;
  __pyx_vtable_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal.getDevice = (struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *(*)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *, int))__pyx_f_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_getDevice;
  __pyx_vtable_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal.getDeviceFromDriver = (struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *(*)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *, CUdevice))__pyx_f_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_getDeviceFromDriver;
  __pyx_vtable_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal.getDeviceFromPrimaryCtx = (struct __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaPythonDevice *(*)(struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *, CUcontext))__pyx_f_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_getDeviceFromPrimaryCtx;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal_spec, NULL); if (unlikely(!__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal)) __PYX_ERR(0, 36, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal_spec, __pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  #else
  __pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal = &__pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal->tp_dictoffset && __pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal, __pyx_vtabptr_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cudaPythonGlobal, (PyObject *) __pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

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.ccudart"); 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, "cudaMalloc", (void (**)(void))&__pyx_f_4cuda_7ccudart_cudaMalloc, "cudaError_t (void **, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "cudaFree", (void (**)(void))&__pyx_f_4cuda_7ccudart_cudaFree, "cudaError_t (void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "cudaMemcpyToArray", (void (**)(void))&__pyx_f_4cuda_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_ImportFunction_3_0_7(__pyx_t_1, "cudaMemcpyFromArray", (void (**)(void))&__pyx_f_4cuda_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_ImportFunction_3_0_7(__pyx_t_1, "make_cudaPitchedPtr", (void (**)(void))&__pyx_f_4cuda_7ccudart_make_cudaPitchedPtr, "struct cudaPitchedPtr (void *, size_t, size_t, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __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, "cuDevicePrimaryCtxRelease", (void (**)(void))&__pyx_f_4cuda_5ccuda_cuDevicePrimaryCtxRelease, "CUresult (CUdevice)") < 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, "_cuInit", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuInit, "CUresult (unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceGet", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGet, "CUresult (CUdevice *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceGetCount", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetCount, "CUresult (int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceGetName", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetName, "CUresult (char *, int, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceGetUuid", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetUuid, "CUresult (CUuuid *, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceTotalMem_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceTotalMem_v2, "CUresult (size_t *, 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, "_cuDevicePrimaryCtxRetain", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxRetain, "CUresult (CUcontext *, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDevicePrimaryCtxReset_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxReset_v2, "CUresult (CUdevice)") < 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, "_cuCtxGetApiVersion", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetApiVersion, "CUresult (CUcontext, unsigned int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemAllocPitch_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemAllocPitch_v2, "CUresult (CUdeviceptr *, size_t *, size_t, size_t, unsigned int)") < 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, "_cuDeviceRegisterAsyncNotification", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceRegisterAsyncNotification, "CUresult (CUdevice, CUasyncCallback, void *, CUasyncCallbackHandle *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuDeviceUnregisterAsyncNotification", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceUnregisterAsyncNotification, "CUresult (CUdevice, CUasyncCallbackHandle)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemcpy", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy, "CUresult (CUdeviceptr, CUdeviceptr, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemcpyHtoD_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyHtoD_v2, "CUresult (CUdeviceptr, void const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemcpyDtoH_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyDtoH_v2, "CUresult (void *, CUdeviceptr, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemcpyDtoD_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyDtoD_v2, "CUresult (CUdeviceptr, CUdeviceptr, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemcpy2DUnaligned_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy2DUnaligned_v2, "CUresult (CUDA_MEMCPY2D const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemcpy3D_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy3D_v2, "CUresult (CUDA_MEMCPY3D const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemcpy3DPeer", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy3DPeer, "CUresult (CUDA_MEMCPY3D_PEER const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemcpyAsync", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyAsync, "CUresult (CUdeviceptr, CUdeviceptr, size_t, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemcpyHtoDAsync_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyHtoDAsync_v2, "CUresult (CUdeviceptr, void const *, size_t, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemcpyDtoHAsync_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyDtoHAsync_v2, "CUresult (void *, CUdeviceptr, size_t, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemcpyDtoDAsync_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpyDtoDAsync_v2, "CUresult (CUdeviceptr, CUdeviceptr, size_t, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemcpy2DAsync_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy2DAsync_v2, "CUresult (CUDA_MEMCPY2D const *, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemcpy3DAsync_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy3DAsync_v2, "CUresult (CUDA_MEMCPY3D const *, CUstream)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuMemcpy3DPeerAsync", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMemcpy3DPeerAsync, "CUresult (CUDA_MEMCPY3D_PEER const *, 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, "_cuArray3DCreate_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuArray3DCreate_v2, "CUresult (CUarray *, CUDA_ARRAY3D_DESCRIPTOR const *)") < 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, "_cuMipmappedArrayCreate", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuMipmappedArrayCreate, "CUresult (CUmipmappedArray *, CUDA_ARRAY3D_DESCRIPTOR const *, unsigned int)") < 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, "_cuStreamAddCallback", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamAddCallback, "CUresult (CUstream, CUstreamCallback, void *, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamGetCaptureInfo_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetCaptureInfo_v2, "CUresult (CUstream, CUstreamCaptureStatus *, cuuint64_t *, CUgraph *, CUgraphNode const **, size_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_7(__pyx_t_1, "_cuStreamGetCaptureInfo_v3", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetCaptureInfo_v3, "CUresult (CUstream, CUstreamCaptureStatus *, cuuint64_t *, CUgraph *, CUgraphNode const **, CUgraphEdgeData const **, size_t *)") < 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)
  __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_utils(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_utils},
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "utils",
      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 initutils(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initutils(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_utils(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_utils(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_utils(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 'utils' 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("utils", __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 "utils" 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_utils(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__utils) {
    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.utils")) {
      if (unlikely((PyDict_SetItemString(modules, "cuda._lib.ccudart.utils", __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)
  if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_type_import_code();
  (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_utils(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_cudaPythonGlobal___reduce_cython, NULL, __pyx_n_s_cuda__lib_ccudart_utils, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_cudaPythonGlobal___setstate_cyth, NULL, __pyx_n_s_cuda__lib_ccudart_utils, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cuda/_lib/ccudart/utils.pyx":139
 *         return NULL
 * 
 * cdef cudaPythonGlobal m_global = cudaPythonGlobal()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_XGOTREF((PyObject *)__pyx_v_4cuda_4_lib_7ccudart_5utils_m_global);
  __Pyx_DECREF_SET(__pyx_v_4cuda_4_lib_7ccudart_5utils_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/utils.pyx":1
 * # Copyright 2021-2024 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.utils", __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.utils");
  }
  __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;
}

/* TupleAndListFromArray */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        Py_INCREF(__pyx_empty_tuple);
        return __pyx_empty_tuple;
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
    for (i = 0; i < n; i++)
    {
        if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;  // error
            return kwvalues[i];
        }
    }
    return NULL;  // not found (no exception set)
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
    PyObject *dict;
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kw,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
        Py_ssize_t kwsize;
#if CYTHON_ASSUME_SAFE_MACROS
        kwsize = PyTuple_GET_SIZE(kw);
#else
        kwsize = PyTuple_Size(kw);
        if (kwsize < 0) return 0;
#endif
        if (unlikely(kwsize == 0))
            return 1;
        if (!kw_allowed) {
#if CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kw, 0);
#else
            key = PyTuple_GetItem(kw, pos);
            if (!key) return 0;
#endif
            goto invalid_keyword;
        }
#if PY_VERSION_HEX < 0x03090000
        for (pos = 0; pos < kwsize; pos++) {
#if CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kw, pos);
#else
            key = PyTuple_GetItem(kw, pos);
            if (!key) return 0;
#endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
        }
#endif
        return 1;
    }
    while (PyDict_Next(kw, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if (!kw_allowed && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    #if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_TypeError,
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* Profile */
#if CYTHON_PROFILE
static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
                                   PyFrameObject** frame,
                                   PyThreadState* tstate,
                                   const char *funcname,
                                   const char *srcfile,
                                   int firstlineno) {
    PyObject *type, *value, *traceback;
    int retval;
    if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
        if (*code == NULL) {
            *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
            if (*code == NULL) return 0;
        }
        *frame = PyFrame_New(
            tstate,                          /*PyThreadState *tstate*/
            *code,                           /*PyCodeObject *code*/
            __pyx_d,                  /*PyObject *globals*/
            0                                /*PyObject *locals*/
        );
        if (*frame == NULL) return 0;
        if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
            Py_INCREF(Py_None);
            (*frame)->f_trace = Py_None;
        }
#if PY_VERSION_HEX < 0x030400B1
    } else {
        (*frame)->f_tstate = tstate;
#endif
    }
    __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
    retval = 1;
    __Pyx_EnterTracing(tstate);
    __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
    #if CYTHON_TRACE
    if (tstate->c_tracefunc)
        retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
    if (retval && tstate->c_profilefunc)
    #endif
        retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
    __Pyx_LeaveTracing(tstate);
    if (retval) {
        __Pyx_ErrRestoreInState(tstate, type, value, traceback);
        return __Pyx_IsTracing(tstate, 0, 0) && retval;
    } else {
        Py_XDECREF(type);
        Py_XDECREF(value);
        Py_XDECREF(traceback);
        return -1;
    }
}
static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
    PyCodeObject *py_code = 0;
#if PY_MAJOR_VERSION >= 3
    py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
    if (likely(py_code)) {
        py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
    }
#else
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    py_funcname = PyString_FromString(funcname);
    if (unlikely(!py_funcname)) goto bad;
    py_srcfile = PyString_FromString(srcfile);
    if (unlikely(!py_srcfile)) goto bad;
    py_code = PyCode_New(
        0,
        0,
        0,
        CO_OPTIMIZED | CO_NEWLOCALS,
        __pyx_empty_bytes,     /*PyObject *code,*/
        __pyx_empty_tuple,     /*PyObject *consts,*/
        __pyx_empty_tuple,     /*PyObject *names,*/
        __pyx_empty_tuple,     /*PyObject *varnames,*/
        __pyx_empty_tuple,     /*PyObject *freevars,*/
        __pyx_empty_tuple,     /*PyObject *cellvars,*/
        py_srcfile,       /*PyObject *filename,*/
        py_funcname,      /*PyObject *name,*/
        firstlineno,
        __pyx_empty_bytes      /*PyObject *lnotab*/
    );
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
#endif
    return py_code;
}
#endif

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
    else state = (PyGILState_STATE)0;
#endif
    CYTHON_UNUSED_VAR(clineno);
    CYTHON_UNUSED_VAR(lineno);
    CYTHON_UNUSED_VAR(filename);
    CYTHON_MAYBE_UNUSED_VAR(nogil);
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

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

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    __Pyx_PyThreadState_declare
    CYTHON_UNUSED_VAR(cause);
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
      #if PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
      #elif CYTHON_FAST_THREAD_STATE
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#else
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject *const *kwvalues,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
    while (1) {
        Py_XDECREF(key); key = NULL;
        Py_XDECREF(value); value = NULL;
        if (kwds_is_tuple) {
            Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(kwds);
#else
            size = PyTuple_Size(kwds);
            if (size < 0) goto bad;
#endif
            if (pos >= size) break;
#if CYTHON_AVOID_BORROWED_REFS
            key = __Pyx_PySequence_ITEM(kwds, pos);
            if (!key) goto bad;
#elif CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kwds, pos);
#else
            key = PyTuple_GetItem(kwds, pos);
            if (!key) goto bad;
#endif
            value = kwvalues[pos];
            pos++;
        }
        else
        {
            if (!PyDict_Next(kwds, &pos, &key, &value)) break;
#if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(key);
#endif
        }
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(value); // transfer ownership of value to values
            Py_DECREF(key);
#endif
            key = NULL;
            value = NULL;
            continue;
        }
#if !CYTHON_AVOID_BORROWED_REFS
        Py_INCREF(key);
#endif
        Py_INCREF(value);
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
                    value = NULL;  // ownership transferred to values
#endif
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key)
                );
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
                    value = NULL; // ownership transferred to values
#endif
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    Py_XDECREF(key);
    Py_XDECREF(value);
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    #if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_TypeError,
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    Py_XDECREF(key);
    Py_XDECREF(value);
    return -1;
}

/* FixUpExtensionType */
#if CYTHON_USE_TYPE_SPECS
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
#else
    const PyType_Slot *slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
        int changed = 0;
#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
        const
#endif
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
#if PY_VERSION_HEX < 0x030900b1
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
#if PY_VERSION_HEX >= 0x030800b4
                    type->tp_vectorcall_offset = memb->offset;
#else
                    type->tp_print = (printfunc) memb->offset;
#endif
                    changed = 1;
                }
#endif
#else
                if ((0));
#endif
#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
                        Py_DECREF(descr);
                        return -1;
                    }
                    Py_DECREF(descr);
                    changed = 1;
                }
#endif
            }
            memb++;
        }
        if (changed)
            PyType_Modified(type);
    }
#endif
    return 0;
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
        return NULL;
    }
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
        return NULL;
    }
    #endif
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    #endif
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    #endif
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectFastCall */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    #if PY_VERSION_HEX < 0x030800B1
    #if CYTHON_FAST_PYCCALL
    if (PyCFunction_Check(func)) {
        if (kwargs) {
            return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
        } else {
            return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
        }
    }
    #if PY_VERSION_HEX >= 0x030700A1
    if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
        return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
    }
    #endif
    #endif
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
    }
    #endif
    #endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL
        #if PY_VERSION_HEX < 0x03090000
        vectorcallfunc f = _PyVectorcall_Function(func);
        #else
        vectorcallfunc f = PyVectorcall_Function(func);
        #endif
        if (f) {
            return f(func, args, (size_t)nargs, NULL);
        }
        #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
        if (__Pyx_CyFunction_CheckExact(func)) {
            __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
            if (f) return f(func, args, (size_t)nargs, NULL);
        }
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* PyObjectCallNoArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectCallOneArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    __Pyx_TypeName type_name;
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#elif PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* ValidateBasesTuple */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
    Py_ssize_t i, n;
#if CYTHON_ASSUME_SAFE_MACROS
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (n < 0) return -1;
#endif
    for (i = 1; i < n; i++)
    {
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        PyTypeObject *b;
#if PY_MAJOR_VERSION < 3
        if (PyClass_Check(b0))
        {
            PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
                         PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (dictoffset == 0)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
            b_dictoffset = b->tp_dictoffset;
#else
            PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
            if (!py_b_dictoffset) goto dictoffset_return;
            b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
            Py_DECREF(py_b_dictoffset);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                {
                    __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
                    PyErr_Format(PyExc_TypeError,
                        "extension type '%.200s' has no __dict__ slot, "
                        "but base type '" __Pyx_FMT_TYPENAME "' has: "
                        "either add 'cdef dict __dict__' to the extension type "
                        "or add '__slots__ = [...]' to the base type",
                        type_name, b_name);
                    __Pyx_DECREF_TypeName(b_name);
                }
#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
        gc = PyImport_GetModule(__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#endif
}

/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, attr_name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(attr_name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PyObject_GenericGetAttr */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* SetVTable */
static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
    if (unlikely(!ob))
        goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0))
#else
    if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0))
#endif
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

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

/* MergeVTables */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_MergeVtables(PyTypeObject *type) {
    int i;
    void** base_vtables;
    __Pyx_TypeName tp_base_name;
    __Pyx_TypeName base_name;
    void* unknown = (void*)-1;
    PyObject* bases = type->tp_bases;
    int base_depth = 0;
    {
        PyTypeObject* base = type->tp_base;
        while (base) {
            base_depth += 1;
            base = base->tp_base;
        }
    }
    base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1));
    base_vtables[0] = unknown;
    for (i = 1; i < PyTuple_GET_SIZE(bases); i++) {
        void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i)));
        if (base_vtable != NULL) {
            int j;
            PyTypeObject* base = type->tp_base;
            for (j = 0; j < base_depth; j++) {
                if (base_vtables[j] == unknown) {
                    base_vtables[j] = __Pyx_GetVtable(base);
                    base_vtables[j + 1] = unknown;
                }
                if (base_vtables[j] == base_vtable) {
                    break;
                } else if (base_vtables[j] == NULL) {
                    goto bad;
                }
                base = base->tp_base;
            }
        }
    }
    PyErr_Clear();
    free(base_vtables);
    return 0;
bad:
    tp_base_name = __Pyx_PyType_GetName(type->tp_base);
    base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i));
    PyErr_Format(PyExc_TypeError,
        "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
    __Pyx_DECREF_TypeName(tp_base_name);
    __Pyx_DECREF_TypeName(base_name);
    free(base_vtables);
    return -1;
}
#endif

/* SetupReduce */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_getstate = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
    PyObject *getstate = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
        if (!object_getstate && PyErr_Occurred()) {
            goto __PYX_BAD;
        }
#endif
        if (object_getstate != getstate) {
            goto __PYX_GOOD;
        }
    }
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
            if (likely(reduce_cython)) {
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred()) {
        __Pyx_TypeName type_obj_name =
            __Pyx_PyType_GetName((PyTypeObject*)type_obj);
        PyErr_Format(PyExc_RuntimeError,
            "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
        __Pyx_DECREF_TypeName(type_obj_name);
    }
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
    Py_XDECREF(object_getstate);
    Py_XDECREF(getstate);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}
#endif

/* FetchSharedCythonModule */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
}

/* FetchCommonType */
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t basicsize,
                               Py_ssize_t expected_basicsize) {
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
#if !CYTHON_USE_TYPE_SPECS
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* abi_module;
    const char* object_name;
    PyTypeObject *cached_type = NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    object_name = strrchr(type->tp_name, '.');
    object_name = object_name ? object_name+1 : type->tp_name;
    cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        if (__Pyx_VerifyCachedType(
              (PyObject *)cached_type,
              object_name,
              cached_type->tp_basicsize,
              type->tp_basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    if (PyType_Ready(type) < 0) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
        goto bad;
    Py_INCREF(type);
    cached_type = type;
done:
    Py_DECREF(abi_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#else
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module, *cached_type = NULL;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    cached_type = PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        Py_ssize_t basicsize;
#if CYTHON_COMPILING_IN_LIMITED_API
        PyObject *py_basicsize;
        py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
        if (unlikely(!py_basicsize)) goto bad;
        basicsize = PyLong_AsSsize_t(py_basicsize);
        Py_DECREF(py_basicsize);
        py_basicsize = 0;
        if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
#else
        basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
#endif
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              basicsize,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    CYTHON_UNUSED_VAR(module);
    cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
done:
    Py_DECREF(abi_module);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#endif

/* PyVectorcallFastCallDict */
#if CYTHON_METH_FASTCALL
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i, pos;
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (PyDict_Next(kw, &pos, &key, &value)) {
        keys_are_strings &= Py_TYPE(key)->tp_flags;
        Py_INCREF(key);
        Py_INCREF(value);
        PyTuple_SET_ITEM(kwnames, i, key);
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
        return vc(func, args, nargs, NULL);
    }
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
    if (__Pyx_CyFunction_Check(func)) {
        return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_Py_XDECREF_SET(
        __Pyx_CyFunction_GetClassObj(f),
            ((classobj) ? __Pyx_NewRef(classobj) : NULL));
#else
    __Pyx_Py_XDECREF_SET(
        ((PyCMethodObject *) (f))->mm_class,
        (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
#endif
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
{
    CYTHON_UNUSED_VAR(closure);
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
        if (unlikely(!op->func_doc)) return NULL;
#else
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
#endif
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#elif PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_dict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_tuple;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_kwdict;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->func_annotations;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    int is_coroutine;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
#if PY_VERSION_HEX >= 0x03050000
    if (is_coroutine) {
        PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(marker);
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(op->func_is_coroutine)) {
            return __Pyx_NewRef(op->func_is_coroutine);
        }
ignore:
        PyErr_Clear();
    }
#endif
    op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
    return __Pyx_NewRef(op->func_is_coroutine);
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_GetAttrString(op->func, "__module__");
}
static int
__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_SetAttrString(op->func, "__module__", value);
}
#endif
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
#if !CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
#if CYTHON_USE_TYPE_SPECS
    {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#if CYTHON_METH_FASTCALL
#if CYTHON_BACKPORT_VECTORCALL
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
#if !CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#endif
#endif
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    CYTHON_UNUSED_VAR(args);
#if PY_MAJOR_VERSION >= 3
    Py_INCREF(m->func_qualname);
    return m->func_qualname;
#else
    return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
#endif
    if (unlikely(op == NULL))
        return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
    if (unlikely(!op->func)) return NULL;
#endif
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
#if !CYTHON_COMPILING_IN_LIMITED_API
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
#endif
    Py_XINCREF(closure);
    op->func_closure = closure;
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_XINCREF(module);
    cf->m_module = module;
#endif
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_classobj = NULL;
#else
    ((PyCMethodObject*)op)->mm_class = NULL;
#endif
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults_size = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
#if PY_VERSION_HEX < 0x030900B1
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    __Pyx_PyHeapTypeObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
#endif
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_is_coroutine);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    PyObject *py_name = NULL;
    PyCFunction meth;
    int flags;
    meth = PyCFunction_GetFunction(f);
    if (unlikely(!meth)) return NULL;
    flags = PyCFunction_GetFlags(f);
    if (unlikely(flags < 0)) return NULL;
#else
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    int flags = f->m_ml->ml_flags;
#endif
    Py_ssize_t size;
    switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
#if CYTHON_COMPILING_IN_LIMITED_API
            py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
            if (!py_name) return NULL;
            PyErr_Format(PyExc_TypeError,
                "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                py_name, size);
            Py_DECREF(py_name);
#else
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
#endif
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
#if CYTHON_COMPILING_IN_LIMITED_API
            py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
            if (!py_name) return NULL;
            PyErr_Format(PyExc_TypeError,
                "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                py_name, size);
            Py_DECREF(py_name);
#else
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
#endif
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
    if (!py_name) return NULL;
    PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
                 py_name);
    Py_DECREF(py_name);
#else
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
#endif
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *self, *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
    if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
    self = ((PyCFunctionObject*)func)->m_self;
#endif
    result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
#if CYTHON_ASSUME_SAFE_MACROS
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(!argc) < 0) return NULL;
#endif
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
#if PY_MAJOR_VERSION > 2
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
#else
            PyErr_SetString(PyExc_TypeError,
                            "unbound method needs an argument");
#endif
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
                         ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
        PyErr_Format(PyExc_TypeError,
                     "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
}
#endif
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
#else
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
#if !CYTHON_METH_FASTCALL
    0,
#elif CYTHON_BACKPORT_VECTORCALL
    (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
#else
    offsetof(PyCFunctionObject, vectorcall),
#endif
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_PyMethod_New,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if __PYX_NEED_TP_PRINT_SLOT
    0,
#endif
#if PY_VERSION_HEX >= 0x030C0000
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
    0,
#endif
};
#endif
static int __pyx_CyFunction_init(PyObject *module) {
#if CYTHON_USE_TYPE_SPECS
    __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
#else
    CYTHON_UNUSED_VAR(module);
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
#endif
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    m->defaults_size = size;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

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

/* CIntFromPy */
static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
#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 PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(unsigned int) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (unsigned 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(unsigned 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(unsigned int) > 1 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT)) {
                                return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                            }
                        }
                        break;
                    case 3:
                        if ((8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT)) {
                                return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                            }
                        }
                        break;
                    case 4:
                        if ((8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(unsigned 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(unsigned int) >= 4 * PyLong_SHIFT)) {
                                return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned 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 (unsigned int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if ((sizeof(unsigned int) <= sizeof(unsigned long))) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            if (__Pyx_PyLong_IsCompact(x)) {
                __PYX_VERIFY_RETURN_INT(unsigned 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(unsigned int) - 1 > 1 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) {
                                return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                            }
                        }
                        break;
                    case 2:
                        if ((8 * sizeof(unsigned int) > 1 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) {
                                return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                            }
                        }
                        break;
                    case -3:
                        if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) {
                                return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                            }
                        }
                        break;
                    case 3:
                        if ((8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                            } else if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) {
                                return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                            }
                        }
                        break;
                    case -4:
                        if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(unsigned 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(unsigned int) - 1 > 4 * PyLong_SHIFT)) {
                                return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                            }
                        }
                        break;
                    case 4:
                        if ((8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) {
                            if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                                __PYX_VERIFY_RETURN_INT(unsigned 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(unsigned int) - 1 > 4 * PyLong_SHIFT)) {
                                return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                            }
                        }
                        break;
                }
            }
#endif
            if ((sizeof(unsigned int) <= sizeof(long))) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(unsigned int) <= sizeof(PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
            unsigned 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 (unsigned int) -1;
                }
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
                if (Py_SIZE(x) == 0)
                    return (unsigned int) 0;
                is_negative = Py_SIZE(x) < 0;
#else
                {
                    int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                    if (unlikely(result < 0))
                        return (unsigned 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 (unsigned int) -1;
                } else {
                    stepval = __Pyx_NewRef(v);
                }
                val = (unsigned 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(unsigned 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 |= ((unsigned 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(unsigned int) * 8) - bits - (is_unsigned ? 0 : 1);
                if (unlikely(idigit >= (1L << remaining_bits)))
                    goto raise_overflow;
                val |= ((unsigned int) idigit) << bits;
            #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
            unpacking_done:
            #endif
                if (!is_unsigned) {
                    if (unlikely(val & (((unsigned int) 1) << (sizeof(unsigned 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 (unsigned int) -1;
        }
    } else {
        unsigned int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (unsigned int) -1;
        val = __Pyx_PyInt_As_unsigned_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned int");
    return (unsigned int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned int");
    return (unsigned int) -1;
}

/* 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__5);
    }
    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 */
