/* Generated by Cython 0.29.32 */

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

#ifndef __cplusplus
  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
#endif
#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #else
    #define CYTHON_INLINE inline
  #endif
#endif
template<typename T>
void __Pyx_call_destructor(T& x) {
    x.~T();
}
template<typename T>
class __Pyx_FakeReference {
  public:
    __Pyx_FakeReference() : ptr(NULL) { }
    __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
    T *operator->() { return ptr; }
    T *operator&() { return ptr; }
    operator T&() { return *ptr; }
    template<typename U> bool operator ==(U other) { return *ptr == other; }
    template<typename U> bool operator !=(U other) { return *ptr != other; }
  private:
    T *ptr;
};

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

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

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

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

#define __PYX_HAVE__cuda___lib__ccudart__utils
#define __PYX_HAVE_API__cuda___lib__ccudart__utils
/* Early includes */
#include "driver_types.h"
#include <stdint.h>
#include "cuda_runtime.h"
#include <string.h>
#include <stdlib.h>
#include "cuda.h"
#include "cudaProfiler.h"
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

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

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


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

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


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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* "cuda/ccuda.pxd":2704
 *     CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 2
 * 
 * ctypedef CUGLmap_flags_enum CUGLmap_flags             # <<<<<<<<<<<<<<
 * 
 * cdef CUresult cuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags) nogil except ?CUDA_ERROR_NOT_FOUND
 */
typedef enum __pyx_t_4cuda_5ccuda_CUGLmap_flags_enum __pyx_t_4cuda_5ccuda_CUGLmap_flags;
struct __pyx_t_4cuda_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;

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

/* "cuda/_lib/ccudart/utils.pyx":14
 * 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":23
 *     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":27
 *     void *userData
 * 
 * ctypedef cudaStreamCallbackData_st cudaStreamCallbackData             # <<<<<<<<<<<<<<
 * 
 * cdef class cudaPythonGlobal:
 */
typedef __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamCallbackData_st __pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamCallbackData;

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



/* "cuda/_lib/ccudart/utils.pyx":29
 * ctypedef cudaStreamCallbackData_st cudaStreamCallbackData
 * 
 * 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;

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

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

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

/* 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 *kwdict, const char* function_name, int kw_allowed);

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

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

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

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

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

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

/* 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(PyObject *dict, void *vtable);

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

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

/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED 1
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_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 {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    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;
    PyObject *func_classobj;
    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;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_Check(obj)  (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
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(void);

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

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, 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_FAST_PYCALL
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
#if PY_VERSION_HEX >= 0x030b00a6
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
  #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 // CYTHON_FAST_PYCALL
#endif

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

/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

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

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

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

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

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

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

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

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

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

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

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

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

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

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

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

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

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 '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__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)(CUstream, CUstreamCaptureStatus *, cuuint64_t *); /*proto*/
static CUresult (*__pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetCaptureInfo_v2)(CUstream, CUstreamCaptureStatus *, cuuint64_t *, CUgraph *, CUgraphNode const **, size_t *); /*proto*/

/* Module declarations from 'cuda._lib.ccudart.utils' */
static PyTypeObject *__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal = 0;
static struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *__pyx_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 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_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 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*/
#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' */
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_TypeError;
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_reduce[] = "__reduce__";
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_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_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_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__";
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_cudaPythonGlobal;
static PyObject *__pyx_n_s_cudaPythonGlobal___reduce_cython;
static PyObject *__pyx_n_s_cudaPythonGlobal___setstate_cyth;
static PyObject *__pyx_n_s_cuda__lib_ccudart_utils;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_test;
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*/
static PyObject *__pyx_codeobj_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_codeobj__3;
/* Late includes */

/* "cuda/_lib/ccudart/utils.pyx":30
 * 
 * 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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && 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
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_TraceCall("__cinit__", __pyx_f[0], 30, 0, __PYX_ERR(0, 30, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":31
 * 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":32
 *     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":33
 *         self._lazyInitDriver = False
 *         self._numDevices = 0
 *         self._deviceList = NULL             # <<<<<<<<<<<<<<
 *         self._CUDART_VERSION = CUDART_VERSION
 * 
 */
  __pyx_v_self->_deviceList = NULL;

  /* "cuda/_lib/ccudart/utils.pyx":34
 *         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":30
 * 
 * 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);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":36
 *         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) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __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) {
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);
  __Pyx_TraceCall("__dealloc__", __pyx_f[0], 36, 0, __PYX_ERR(0, 36, __pyx_L1_error));

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

    /* "cuda/_lib/ccudart/utils.pyx":38
 *     def __dealloc__(self):
 *         if self._deviceList is not NULL:
 *             free(self._deviceList)             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t lazyInitDriver(self) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
    free(__pyx_v_self->_deviceList);

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

  /* "cuda/_lib/ccudart/utils.pyx":36
 *         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);
  __Pyx_RefNannyFinishContext();
}

/* "cuda/_lib/ccudart/utils.pyx":40
 *             free(self._deviceList)
 * 
 *     cdef cudaError_t lazyInitDriver(self) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *         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
  int __pyx_t_1;
  CUresult __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;
  __Pyx_TraceCall("lazyInitDriver", __pyx_f[0], 40, 1, __PYX_ERR(0, 40, __pyx_L1_error));

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

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

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

  /* "cuda/_lib/ccudart/utils.pyx":44
 *             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":45
 * 
 *         cdef cudaError_t err = cudaSuccess
 *         err = <cudaError_t>ccuda._cuInit(0)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuInit(0); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 45, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_2);

  /* "cuda/_lib/ccudart/utils.pyx":46
 *         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_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":47
 *         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":46
 *         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":48
 *         if err != cudaSuccess:
 *             return err
 *         err = <cudaError_t>ccuda._cuDeviceGetCount(&self._numDevices)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
  __pyx_t_2 = __pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetCount((&__pyx_v_self->_numDevices)); if (unlikely(__pyx_t_2 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 48, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_2);

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

    /* "cuda/_lib/ccudart/utils.pyx":50
 *         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":49
 *             return err
 *         err = <cudaError_t>ccuda._cuDeviceGetCount(&self._numDevices)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":52
 *             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":53
 * 
 *         self._deviceList = <cudaPythonDevice *>calloc(self._numDevices, sizeof(cudaPythonDevice))
 *         if self._deviceList == NULL:             # <<<<<<<<<<<<<<
 *             return cudaErrorMemoryAllocation
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->_deviceList == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":54
 *         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":53
 * 
 *         self._deviceList = <cudaPythonDevice *>calloc(self._numDevices, sizeof(cudaPythonDevice))
 *         if self._deviceList == NULL:             # <<<<<<<<<<<<<<
 *             return cudaErrorMemoryAllocation
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":56
 *             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":57
 * 
 *         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, 57, __pyx_L1_error)
    __pyx_v_err = __pyx_t_6;

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

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

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

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

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

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

/* "cuda/_lib/ccudart/utils.pyx":64
 *         self._lazyInitDriver = True
 * 
 *     cdef cudaError_t lazyInitContextState(self) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *         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;
  __Pyx_TraceCall("lazyInitContextState", __pyx_f[0], 64, 1, __PYX_ERR(0, 64, __pyx_L1_error));

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

  /* "cuda/_lib/ccudart/utils.pyx":69
 *         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, 69, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":71
 *         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":70
 * 
 *         err = self.lazyInitDriver()
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":73
 *             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, 73, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

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

    /* "cuda/_lib/ccudart/utils.pyx":75
 *         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":74
 * 
 *         err = <cudaError_t>ccuda._cuCtxGetCurrent(&driverContext)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         device = self.getDeviceFromPrimaryCtx(driverContext)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":76
 *         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":79
 * 
 *         # 1. Context + device
 *         if driverContext != NULL and device != NULL:             # <<<<<<<<<<<<<<
 *             err = initPrimaryContext(device)
 *             if err != cudaSuccess:
 */
  __pyx_t_4 = ((__pyx_v_driverContext != NULL) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_device != NULL) != 0);
  __pyx_t_2 = __pyx_t_4;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":80
 *         # 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, 80, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

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

      /* "cuda/_lib/ccudart/utils.pyx":82
 *             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":81
 *         if driverContext != NULL and device != NULL:
 *             err = initPrimaryContext(device)
 *             if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *                 return err
 * 
 */
    }

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

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

    /* "cuda/_lib/ccudart/utils.pyx":89
 *             # 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, 89, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

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

      /* "cuda/_lib/ccudart/utils.pyx":91
 *             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":90
 *             # then return immediately
 *             err = <cudaError_t>ccuda._cuCtxGetApiVersion(driverContext, &version)
 *             if err == cudaErrorContextIsDestroyed:             # <<<<<<<<<<<<<<
 *                 return cudaErrorIncompatibleDriverContext
 *             elif err != cudaSuccess:
 */
    }

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

      /* "cuda/_lib/ccudart/utils.pyx":93
 *                 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":92
 *             if err == cudaErrorContextIsDestroyed:
 *                 return cudaErrorIncompatibleDriverContext
 *             elif err != cudaSuccess:             # <<<<<<<<<<<<<<
 *                 return err
 *             elif version < 3020:
 */
    }

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

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

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

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

    /* "cuda/_lib/ccudart/utils.pyx":86
 *         # 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":103
 *         # 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":104
 *         # 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, 104, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":106
 *         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":105
 *         device = self.getDevice(0)
 *         err = initPrimaryContext(device)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = <cudaError_t> ccuda._cuCtxSetCurrent(device.primaryContext)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":107
 *         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, 107, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_3);

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

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

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

/* "cuda/_lib/ccudart/utils.pyx":110
 *         return err
 * 
 *     cdef cudaPythonDevice* getDevice(self, int deviceOrdinal) 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;
  __Pyx_TraceCall("getDevice", __pyx_f[0], 110, 1, __PYX_ERR(0, 110, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":111
 * 
 *     cdef cudaPythonDevice* getDevice(self, int deviceOrdinal) nogil:
 *         if deviceOrdinal < 0 or deviceOrdinal >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *             return NULL
 *         return &self._deviceList[deviceOrdinal]
 */
  __pyx_t_2 = ((__pyx_v_deviceOrdinal < 0) != 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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":112
 *     cdef cudaPythonDevice* getDevice(self, int deviceOrdinal) 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":111
 * 
 *     cdef cudaPythonDevice* getDevice(self, int deviceOrdinal) nogil:
 *         if deviceOrdinal < 0 or deviceOrdinal >= m_global._numDevices:             # <<<<<<<<<<<<<<
 *             return NULL
 *         return &self._deviceList[deviceOrdinal]
 */
  }

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

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

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

/* "cuda/_lib/ccudart/utils.pyx":115
 *         return &self._deviceList[deviceOrdinal]
 * 
 *     cdef cudaPythonDevice* getDeviceFromDriver(self, ccuda.CUdevice driverDevice) 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;
  __Pyx_TraceCall("getDeviceFromDriver", __pyx_f[0], 115, 1, __PYX_ERR(0, 115, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":116
 * 
 *     cdef cudaPythonDevice* getDeviceFromDriver(self, ccuda.CUdevice driverDevice) 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":117
 *     cdef cudaPythonDevice* getDeviceFromDriver(self, ccuda.CUdevice driverDevice) 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) != 0);
    if (__pyx_t_4) {

      /* "cuda/_lib/ccudart/utils.pyx":118
 *         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":117
 *     cdef cudaPythonDevice* getDeviceFromDriver(self, ccuda.CUdevice driverDevice) nogil:
 *         for i in range(self._numDevices):
 *             if self._deviceList[i].driverDevice == driverDevice:             # <<<<<<<<<<<<<<
 *                 return &self._deviceList[i]
 *         return NULL
 */
    }
  }

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

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

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

/* "cuda/_lib/ccudart/utils.pyx":121
 *         return NULL
 * 
 *     cdef cudaPythonDevice* getDeviceFromPrimaryCtx(self, ccuda.CUcontext context) 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;
  __Pyx_TraceCall("getDeviceFromPrimaryCtx", __pyx_f[0], 121, 1, __PYX_ERR(0, 121, __pyx_L1_error));

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

    /* "cuda/_lib/ccudart/utils.pyx":123
 *     cdef cudaPythonDevice* getDeviceFromPrimaryCtx(self, ccuda.CUcontext context) 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":122
 * 
 *     cdef cudaPythonDevice* getDeviceFromPrimaryCtx(self, ccuda.CUcontext context) nogil:
 *         if context == NULL:             # <<<<<<<<<<<<<<
 *             return NULL
 *         for i in range(self._numDevices):
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":124
 *         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":125
 *             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) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":126
 *         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":125
 *             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":127
 *             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":121
 *         return NULL
 * 
 *     cdef cudaPythonDevice* getDeviceFromPrimaryCtx(self, ccuda.CUcontext context) nogil:             # <<<<<<<<<<<<<<
 *         if context == NULL:
 *             return NULL
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cuda._lib.ccudart.utils.cudaPythonGlobal.getDeviceFromPrimaryCtx", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
  __pyx_r = 0;
  __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, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __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)__pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_5__reduce_cython__, METH_NOARGS, __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, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj_)
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
  __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_XDECREF(__pyx_t_1);
  __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, PyObject *__pyx_v___pyx_state); /*proto*/
static char __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)__pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_7__setstate_cython__, METH_O, __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, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __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), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceFrameInit(__pyx_codeobj__3)
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
  __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_XDECREF(__pyx_t_1);
  __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":132
 * 
 * 
 * cdef cudaError_t initDevice(cudaPythonDevice *device, int deviceOrdinal) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     # 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;
  __Pyx_TraceCall("initDevice", __pyx_f[0], 132, 1, __PYX_ERR(0, 132, __pyx_L1_error));

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

  /* "cuda/_lib/ccudart/utils.pyx":136
 *     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":138
 *     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":141
 * 
 *     # 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, 141, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":143
 *     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":142
 *     # ccuda.CUdevice driverDevice
 *     err = ccuda._cuDeviceGet(&device[0].driverDevice, deviceOrdinal)
 *     if err != ccuda.cudaError_enum.CUDA_SUCCESS:             # <<<<<<<<<<<<<<
 *         return cudaErrorInitializationError
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":146
 * 
 *     # 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, 146, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":148
 *     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":147
 *     # 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":150
 *         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, 150, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":152
 *     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":151
 * 
 *     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":154
 *         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, 154, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":156
 *     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":155
 * 
 *     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":158
 *         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, 158, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":160
 *     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":159
 * 
 *     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":162
 *         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, 162, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":164
 *     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":163
 * 
 *     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":166
 *         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, 166, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":168
 *     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":167
 * 
 *     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":170
 *         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, 170, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":172
 *     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":171
 * 
 *     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":174
 *         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, 174, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":176
 *     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":175
 * 
 *     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":178
 *         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, 178, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":180
 *     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":179
 * 
 *     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":182
 *         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, 182, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":184
 *     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":183
 * 
 *     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":186
 *         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, 186, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":188
 *     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":187
 * 
 *     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":190
 *         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, 190, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":192
 *     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":191
 * 
 *     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":194
 *         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, 194, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":196
 *     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":195
 * 
 *     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":198
 *         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, 198, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":200
 *     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":199
 * 
 *     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":202
 *         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, 202, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":204
 *     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":203
 * 
 *     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":206
 *         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, 206, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":208
 *     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":207
 * 
 *     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":210
 *         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, 210, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":212
 *     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":211
 * 
 *     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":214
 *         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, 214, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":216
 *     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":215
 * 
 *     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":218
 *         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, 218, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":220
 *     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":219
 * 
 *     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":222
 *         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, 222, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":224
 *     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":223
 * 
 *     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":226
 *         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, 226, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":228
 *     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":227
 * 
 *     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":230
 *         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, 230, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":232
 *     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":231
 * 
 *     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":234
 *         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, 234, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":236
 *     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":235
 * 
 *     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":238
 *         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, 238, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":240
 *     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":239
 * 
 *     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":242
 *         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, 242, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":244
 *     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":243
 * 
 *     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":246
 *         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, 246, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":248
 *     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":247
 * 
 *     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":250
 *         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, 250, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":252
 *     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":251
 * 
 *     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":254
 *         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, 254, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":256
 *     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":255
 * 
 *     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":258
 *         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, 258, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":260
 *     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":259
 * 
 *     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":262
 *         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, 262, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":264
 *     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":263
 * 
 *     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":266
 *         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, 266, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":268
 *     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":267
 * 
 *     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":270
 *         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, 270, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":272
 *     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":271
 * 
 *     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":274
 *         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, 274, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":276
 *     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":275
 * 
 *     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":278
 *         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, 278, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":280
 *     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":279
 * 
 *     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":282
 *         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, 282, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":284
 *     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":283
 * 
 *     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":286
 *         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, 286, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":288
 *     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":287
 * 
 *     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":290
 *         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, 290, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":292
 *     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":291
 * 
 *     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":294
 *         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, 294, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":296
 *     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":295
 * 
 *     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":298
 *         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, 298, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":300
 *     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":299
 * 
 *     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":302
 *         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, 302, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":304
 *     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":303
 * 
 *     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":306
 *         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, 306, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":308
 *     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":307
 * 
 *     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":310
 *         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, 310, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":312
 *     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":311
 * 
 *     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":314
 *         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, 314, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":316
 *     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":315
 * 
 *     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":318
 *         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, 318, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":320
 *     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":319
 * 
 *     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":322
 *         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, 322, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":324
 *     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":323
 * 
 *     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":326
 *         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, 326, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":328
 *     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":327
 * 
 *     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":330
 *         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, 330, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":332
 *     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":331
 * 
 *     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":334
 *         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, 334, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":336
 *     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":335
 * 
 *     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":338
 *         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, 338, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":340
 *     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":339
 * 
 *     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":342
 *         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, 342, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":344
 *     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":343
 * 
 *     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":346
 *         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, 346, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":348
 *     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":347
 * 
 *     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":350
 *         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, 350, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":352
 *     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":351
 * 
 *     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":354
 *         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, 354, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":356
 *     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":355
 * 
 *     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":358
 *         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, 358, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":360
 *     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":359
 * 
 *     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":362
 *         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, 362, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":364
 *     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":363
 * 
 *     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":366
 *         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, 366, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":368
 *     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":367
 * 
 *     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":370
 *         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, 370, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":372
 *     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":371
 * 
 *     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":374
 *         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, 374, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":376
 *     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":375
 * 
 *     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":378
 *         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, 378, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":380
 *     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":379
 * 
 *     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":382
 *         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, 382, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":384
 *     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":383
 * 
 *     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":386
 *         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, 386, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":388
 *     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":387
 * 
 *     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":390
 *         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, 390, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":392
 *     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":391
 * 
 *     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":394
 *         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, 394, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":396
 *     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":395
 * 
 *     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":399
 * 
 *     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, 399, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":401
 *     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":400
 *     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":402
 *     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":405
 * 
 *     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, 405, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":407
 *     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":406
 *     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":408
 *     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":411
 * 
 *     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, 411, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":413
 *     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":412
 *     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":414
 *     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":417
 * 
 *     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, 417, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":419
 *     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":418
 *     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":420
 *     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":423
 * 
 *     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, 423, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":425
 *     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":424
 *     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":426
 *     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":428
 *     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, 428, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":430
 *     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":429
 * 
 *     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":432
 *         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, 432, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":434
 *     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":433
 * 
 *     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":436
 *         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, 436, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":438
 *     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":437
 * 
 *     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":441
 * 
 *     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, 441, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":443
 *     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":442
 *     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":444
 *     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":446
 *     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, 446, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":448
 *     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":447
 * 
 *     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":450
 *         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, 450, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":452
 *     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":451
 * 
 *     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":454
 *         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, 454, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":456
 *     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":455
 * 
 *     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":458
 *         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, 458, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":460
 *     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":459
 * 
 *     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":462
 *         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, 462, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":464
 *     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":463
 * 
 *     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":466
 *         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, 466, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":468
 *     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":467
 * 
 *     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":470
 *         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, 470, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":472
 *     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":471
 * 
 *     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":475
 * 
 *     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, 475, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":477
 *     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":476
 *     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":478
 *     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":480
 *     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, 480, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":482
 *     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":481
 * 
 *     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":485
 * 
 *     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, 485, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":487
 *     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":486
 *     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":488
 *     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":489
 *         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, 489, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":491
 *     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":490
 *     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":492
 *     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, 492, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":494
 *     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":493
 *         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":495
 *     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, 495, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":497
 *     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":496
 *         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":498
 *     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, 498, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":500
 *     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":499
 *         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":501
 *     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, 501, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":503
 *     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":502
 *         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":504
 *     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, 504, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":506
 *     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":505
 *         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":507
 *     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, 507, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":509
 *     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":508
 *         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":510
 *     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, 510, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":512
 *     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":511
 *         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":513
 *     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, 513, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":515
 *     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":514
 *         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":516
 *     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, 516, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":518
 *     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":517
 *         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":519
 *     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, 519, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":521
 *     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":520
 *         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":522
 *     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, 522, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":524
 *     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":523
 *         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":525
 *     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, 525, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":527
 *     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":526
 *         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":528
 *     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, 528, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":530
 *     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":529
 *         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":531
 *     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, 531, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":533
 *     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":532
 *         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":534
 *     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, 534, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":536
 *     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":535
 *         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":538
 *         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, 538, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":540
 *     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":539
 * 
 *     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":541
 *     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, 541, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":543
 *     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":542
 *         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":544
 *     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, 544, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":546
 *     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":545
 *         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":549
 * 
 *     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, 549, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":551
 *     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":550
 *     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":552
 *     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":554
 *     device[0].deviceProperties.reservedSharedMemPerBlock = reservedSharedMemPerBlock
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

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

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

/* "cuda/_lib/ccudart/utils.pyx":557
 * 
 * 
 * cdef cudaError_t initPrimaryContext(cudaPythonDevice *device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("initPrimaryContext", __pyx_f[0], 557, 1, __PYX_ERR(0, 557, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":558
 * 
 * cdef cudaError_t initPrimaryContext(cudaPythonDevice *device) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":562
 *     # 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":563
 *     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, 563, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_2);

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

      /* "cuda/_lib/ccudart/utils.pyx":565
 *         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, 565, __pyx_L1_error)
      __pyx_v_err = ((cudaError_t)__pyx_t_2);

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

        /* "cuda/_lib/ccudart/utils.pyx":567
 *             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":566
 *         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":568
 *             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":564
 *     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":569
 *                 return err
 *             device[0].primaryContextRetained = False
 *         elif err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":570
 *             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":569
 *                 return err
 *             device[0].primaryContextRetained = False
 *         elif err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }
    __pyx_L4:;

    /* "cuda/_lib/ccudart/utils.pyx":562
 *     # 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":573
 * 
 *     # 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)) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":574
 *     # 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, 574, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_2);

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

      /* "cuda/_lib/ccudart/utils.pyx":576
 *         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":575
 *     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":577
 *         if err != cudaSuccess:
 *             return err
 *         device[0].primaryContextRetained = True             # <<<<<<<<<<<<<<
 *     return err
 * 
 */
    (__pyx_v_device[0]).primaryContextRetained = 1;

    /* "cuda/_lib/ccudart/utils.pyx":573
 * 
 *     # 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":578
 *             return err
 *         device[0].primaryContextRetained = True
 *     return err             # <<<<<<<<<<<<<<
 * 
 * cdef cudaError_t resetPrimaryContext(cudaPythonDevice* device) nogil except ?cudaErrorCallRequiresNewerDriver:
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

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

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

/* "cuda/_lib/ccudart/utils.pyx":580
 *     return err
 * 
 * cdef cudaError_t resetPrimaryContext(cudaPythonDevice* device) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("resetPrimaryContext", __pyx_f[0], 580, 1, __PYX_ERR(0, 580, __pyx_L1_error));

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

  /* "cuda/_lib/ccudart/utils.pyx":584
 *     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, 584, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

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

      /* "cuda/_lib/ccudart/utils.pyx":587
 *     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, 587, __pyx_L1_error)
      __pyx_v_err = ((cudaError_t)__pyx_t_1);

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

        /* "cuda/_lib/ccudart/utils.pyx":589
 *             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":588
 *         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":590
 *             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":586
 *     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":591
 *                 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, 591, __pyx_L1_error)

    /* "cuda/_lib/ccudart/utils.pyx":592
 *             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":585
 * 
 *     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":594
 *         return cudaSuccess
 *     elif err == cudaErrorDeviceUninitialized:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     else:
 *         return err
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

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

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

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

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

/* "cuda/_lib/ccudart/utils.pyx":599
 * 
 * 
 * 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", 0);
  __Pyx_TraceCall("globalGetInstance", __pyx_f[0], 599, 0, __PYX_ERR(0, 599, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":600
 * 
 * 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":599
 * 
 * 
 * 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":603
 * 
 * 
 * cdef cudaError_t _setLastError(cudaError_t err) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("_setLastError", __pyx_f[0], 603, 1, __PYX_ERR(0, 603, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":604
 * 
 * cdef cudaError_t _setLastError(cudaError_t err) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         m_global._lastError = err
 * 
 */
  __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":605
 * cdef cudaError_t _setLastError(cudaError_t err) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":604
 * 
 * cdef cudaError_t _setLastError(cudaError_t err) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         m_global._lastError = err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":603
 * 
 * 
 * cdef cudaError_t _setLastError(cudaError_t err) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if err != cudaSuccess:
 *         m_global._lastError = err
 */

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

/* "cuda/_lib/ccudart/utils.pyx":608
 * 
 * 
 * cdef int case_desc(const cudaChannelFormatDesc* d, int x, int y, int z, int w, int f) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("case_desc", __pyx_f[0], 608, 1, __PYX_ERR(0, 608, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":609
 * 
 * cdef int case_desc(const cudaChannelFormatDesc* d, int x, int y, int z, int w, int f) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":608
 * 
 * 
 * cdef int case_desc(const cudaChannelFormatDesc* d, int x, int y, int z, int w, int f) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.utils.case_desc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":612
 * 
 * 
 * cdef cudaError_t getDescInfo(const cudaChannelFormatDesc* d, int *numberOfChannels, ccuda.CUarray_format *format) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     # 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;
  __Pyx_TraceCall("getDescInfo", __pyx_f[0], 612, 1, __PYX_ERR(0, 612, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":614
 * cdef cudaError_t getDescInfo(const cudaChannelFormatDesc* d, int *numberOfChannels, ccuda.CUarray_format *format) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     # 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) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":615
 *     # 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) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":614
 * cdef cudaError_t getDescInfo(const cudaChannelFormatDesc* d, int *numberOfChannels, ccuda.CUarray_format *format) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     # 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 != 0);
  if (__pyx_t_3) {

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

      /* "cuda/_lib/ccudart/utils.pyx":617
 *                   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":616
 *     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":614
 * cdef cudaError_t getDescInfo(const cudaChannelFormatDesc* d, int *numberOfChannels, ccuda.CUarray_format *format) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     # 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":618
 *         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) != 0) != 0);
  if (__pyx_t_3) {

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

      /* "cuda/_lib/ccudart/utils.pyx":620
 *     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":619
 *             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":618
 *         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":621
 *         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) != 0) != 0);
  if (__pyx_t_3) {

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

      /* "cuda/_lib/ccudart/utils.pyx":623
 *     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":622
 *             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":621
 *         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":624
 *         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) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L18_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":625
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1,
 */
  __pyx_t_2 = ((__pyx_t_1 == cudaChannelFormatKindSignedNormalized8X2) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L18_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":624
 *         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) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L18_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":627
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4,):
 */
  __pyx_t_2 = ((__pyx_t_1 == cudaChannelFormatKindUnsignedNormalized8X1) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L18_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":624
 *         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) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L18_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":629
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4,):             # <<<<<<<<<<<<<<
 *         if (d[0].x != 8):
 *             return cudaErrorInvalidChannelDescriptor
 */
  __pyx_t_2 = ((__pyx_t_1 == cudaChannelFormatKindUnsignedNormalized8X4) != 0);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L18_bool_binop_done:;

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

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

      /* "cuda/_lib/ccudart/utils.pyx":631
 *                     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":630
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4,):
 *         if (d[0].x != 8):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1,
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":624
 *         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":632
 *         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) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L25_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":633
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1,
 */
  __pyx_t_3 = ((__pyx_t_1 == cudaChannelFormatKindSignedNormalized16X2) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L25_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":632
 *         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) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L25_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":635
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4,):
 */
  __pyx_t_3 = ((__pyx_t_1 == cudaChannelFormatKindUnsignedNormalized16X1) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L25_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":632
 *         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) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L25_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":637
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4,):             # <<<<<<<<<<<<<<
 *         if (d[0].x != 16):
 *             return cudaErrorInvalidChannelDescriptor
 */
  __pyx_t_3 = ((__pyx_t_1 == cudaChannelFormatKindUnsignedNormalized16X4) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L25_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":632
 *         if (d[0].x != 8):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4,
 */
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

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

      /* "cuda/_lib/ccudart/utils.pyx":639
 *                     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":638
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4,):
 *         if (d[0].x != 16):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1,
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":632
 *         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":640
 *         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) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":641
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB,
 */
  __pyx_t_2 = ((__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed1SRGB) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":640
 *         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) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":643
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB,
 */
  __pyx_t_2 = ((__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed2SRGB) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":640
 *         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) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":645
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4,
 */
  __pyx_t_2 = ((__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed3SRGB) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":640
 *         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) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":647
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5,
 */
  __pyx_t_2 = ((__pyx_t_1 == cudaChannelFormatKindSignedBlockCompressed4) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":640
 *         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) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":649
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5,
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB,):
 */
  __pyx_t_2 = ((__pyx_t_1 == cudaChannelFormatKindSignedBlockCompressed5) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":640
 *         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) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L32_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":651
 *                     cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB,):             # <<<<<<<<<<<<<<
 *         if (d[0].x != 8):
 *             return cudaErrorInvalidChannelDescriptor
 */
  __pyx_t_2 = ((__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed7SRGB) != 0);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L32_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":640
 *         if (d[0].x != 16):
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1,             # <<<<<<<<<<<<<<
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2,
 */
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

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

      /* "cuda/_lib/ccudart/utils.pyx":653
 *                     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":652
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7,
 *                     cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB,):
 *         if (d[0].x != 8):             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":640
 *         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":654
 *         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) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L45_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":655
 *             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) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L45_bool_binop_done:;

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

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

      /* "cuda/_lib/ccudart/utils.pyx":657
 *                     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":656
 *     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":654
 *         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":659
 *             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":664
 *     # 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) != 0);
  if (!__pyx_t_2) {
    goto __pyx_L54_next_or;
  } else {
  }
  __pyx_t_2 = (((__pyx_v_d[0]).y != (__pyx_v_d[0]).x) != 0);
  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":665
 *     # 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) != 0);
  if (!__pyx_t_2) {
    goto __pyx_L56_next_or;
  } else {
  }
  __pyx_t_2 = (((__pyx_v_d[0]).z != (__pyx_v_d[0]).y) != 0);
  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":666
 *     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) != 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) != 0);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L53_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":664
 *     # 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":667
 *         ((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":664
 *     # 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":668
 *         ((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, 668, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":669
 *         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":670
 *     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":668
 *         ((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":671
 *         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, 671, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":672
 *         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":673
 *     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":671
 *         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":674
 *         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, 674, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":675
 *         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":676
 *     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":674
 *         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":677
 *         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, 677, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":678
 *         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":679
 *     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":677
 *         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":680
 *         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, 680, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":681
 *         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":682
 *     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":680
 *         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":683
 *         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, 683, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":684
 *         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":685
 *     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":683
 *         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":686
 *         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, 686, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":687
 *         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":688
 *     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":686
 *         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":689
 *         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, 689, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":690
 *         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":691
 *     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":689
 *         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":692
 *         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, 692, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":693
 *         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":694
 *     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":692
 *         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":695
 *         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, 695, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":696
 *         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":697
 *     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":695
 *         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":698
 *         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, 698, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":699
 *         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":700
 *     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":698
 *         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":701
 *         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, 701, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":702
 *         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":703
 *     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":701
 *         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":704
 *         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, 704, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":705
 *         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":706
 *     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":704
 *         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":707
 *         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, 707, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":708
 *         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":709
 *     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":707
 *         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":710
 *         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, 710, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":711
 *         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":712
 *     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":710
 *         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":713
 *         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, 713, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":714
 *         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":715
 *     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":713
 *         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":716
 *         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, 716, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":717
 *         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":718
 *     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":716
 *         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":719
 *         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, 719, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":720
 *         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":721
 *     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":719
 *         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":722
 *         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, 722, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":723
 *         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":724
 *     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":722
 *         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":725
 *         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, 725, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":726
 *         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":727
 *     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":725
 *         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":728
 *         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, 728, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":729
 *         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":730
 *     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":728
 *         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":731
 *         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, 731, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":732
 *         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":733
 *     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":731
 *         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":734
 *         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, 734, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":735
 *         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":736
 *     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":734
 *         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":737
 *         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, 737, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":738
 *         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":739
 *     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":737
 *         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":740
 *         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, 740, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":741
 *         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":742
 *     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":740
 *         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":743
 *         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, 743, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":744
 *         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":745
 *     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":743
 *         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":746
 *         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, 746, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":747
 *         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":748
 *     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":746
 *         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":749
 *         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, 749, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":750
 *         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":751
 *     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":749
 *         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":752
 *         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, 752, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":753
 *         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":754
 *     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":752
 *         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":755
 *         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, 755, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":756
 *         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":757
 *     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":755
 *         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":758
 *         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, 758, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":759
 *         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":760
 *     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":758
 *         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":761
 *         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, 761, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":762
 *         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":763
 *     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":761
 *         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":764
 *         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, 764, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":765
 *         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":766
 *     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":764
 *         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":767
 *         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, 767, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":768
 *         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":769
 *     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":767
 *         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":770
 *         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, 770, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":771
 *         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":772
 *     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":770
 *         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":773
 *         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, 773, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":774
 *         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":775
 *     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":773
 *         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":776
 *         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, 776, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":777
 *         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":778
 *     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":776
 *         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":779
 *         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, 779, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":780
 *         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":781
 *     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":779
 *         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":782
 *         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, 782, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":783
 *         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":784
 *     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":782
 *         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":785
 *         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, 785, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":786
 *         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":787
 *     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":785
 *         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":788
 *         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, 788, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":789
 *         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":790
 *     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":788
 *         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":791
 *         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, 791, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":792
 *         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":793
 *     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":791
 *         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":794
 *         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, 794, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":795
 *         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":796
 *     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":794
 *         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":797
 *         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, 797, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":798
 *         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":799
 *     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":797
 *         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":800
 *         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, 800, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":801
 *         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":802
 *     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":800
 *         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":803
 *         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, 803, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":804
 *         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":805
 *     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":803
 *         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":806
 *         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, 806, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":807
 *         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":808
 *     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":806
 *         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":810
 *         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":812
 *         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) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L61_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":813
 * 
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,             # <<<<<<<<<<<<<<
 *                   cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 *         if numberOfChannels[0] != 3:
 */
  __pyx_t_2 = ((__pyx_t_1 == cudaChannelFormatKindUnsignedBlockCompressed6H) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L61_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":812
 *         return cudaErrorInvalidChannelDescriptor
 * 
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,             # <<<<<<<<<<<<<<
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,
 *                   cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 */
  __pyx_t_2 = ((__pyx_t_1 == cudaChannelFormatKindSignedBlockCompressed6H) != 0);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L61_bool_binop_done:;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":815
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,
 *                   cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 *         if numberOfChannels[0] != 3:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     else:
 */
    __pyx_t_2 = (((__pyx_v_numberOfChannels[0]) != 3) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":816
 *                   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":815
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,
 *                   cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 *         if numberOfChannels[0] != 3:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidChannelDescriptor
 *     else:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":812
 *         return cudaErrorInvalidChannelDescriptor
 * 
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,             # <<<<<<<<<<<<<<
 *                   cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H,
 *                   cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,):
 */
    goto __pyx_L60;
  }

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

      /* "cuda/_lib/ccudart/utils.pyx":819
 *     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":818
 *             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":820
 *         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":612
 * 
 * 
 * cdef cudaError_t getDescInfo(const cudaChannelFormatDesc* d, int *numberOfChannels, ccuda.CUarray_format *format) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     # Check validity
 *     if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSigned,
 */

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

/* "cuda/_lib/ccudart/utils.pyx":824
 * 
 * #TODO: Check return type of this method CUDA_CB
 * cdef void cudaStreamRtCallbackWrapper(ccuda.CUstream stream, ccuda.CUresult status, void *data) nogil except+:             # <<<<<<<<<<<<<<
 *     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
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_RefNannySetupContext("cudaStreamRtCallbackWrapper", 1);
  __Pyx_TraceCall("cudaStreamRtCallbackWrapper", __pyx_f[0], 824, 1, __PYX_ERR(0, 824, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":825
 * #TODO: Check return type of this method CUDA_CB
 * cdef void cudaStreamRtCallbackWrapper(ccuda.CUstream stream, ccuda.CUresult status, void *data) nogil except+:
 *     cdef cudaStreamCallbackData *cbData = <cudaStreamCallbackData *>data             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = <cudaError_t>status
 *     with gil:
 */
  /*try:*/ {
    __pyx_v_cbData = ((__pyx_t_4cuda_4_lib_7ccudart_5utils_cudaStreamCallbackData *)__pyx_v_data);

    /* "cuda/_lib/ccudart/utils.pyx":826
 * cdef void cudaStreamRtCallbackWrapper(ccuda.CUstream stream, ccuda.CUresult status, void *data) nogil except+:
 *     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":827
 *     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":828
 *     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":827
 *     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_L8;
          }
          __pyx_L8:;
        }
    }

    /* "cuda/_lib/ccudart/utils.pyx":829
 *     with gil:
 *         cbData.callback(stream, err, cbData.userData)
 *     free(cbData)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free(__pyx_v_cbData);
  }

  /* "cuda/_lib/ccudart/utils.pyx":825
 * #TODO: Check return type of this method CUDA_CB
 * cdef void cudaStreamRtCallbackWrapper(ccuda.CUstream stream, ccuda.CUresult status, void *data) nogil except+:
 *     cdef cudaStreamCallbackData *cbData = <cudaStreamCallbackData *>data             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = <cudaError_t>status
 *     with gil:
 */
  /*finally:*/ {
    /*normal exit:*/{
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L5;
    }
    __pyx_L5:;
  }

  /* "cuda/_lib/ccudart/utils.pyx":824
 * 
 * #TODO: Check return type of this method CUDA_CB
 * cdef void cudaStreamRtCallbackWrapper(ccuda.CUstream stream, ccuda.CUresult status, void *data) nogil except+:             # <<<<<<<<<<<<<<
 *     cdef cudaStreamCallbackData *cbData = <cudaStreamCallbackData *>data
 *     cdef cudaError_t err = <cudaError_t>status
 */

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

/* "cuda/_lib/ccudart/utils.pyx":832
 * 
 * 
 * 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;
  __Pyx_TraceCall("streamAddCallbackCommon", __pyx_f[0], 832, 1, __PYX_ERR(0, 832, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":838
 *   unsigned int flags
 * ) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if callback == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_1 = ((__pyx_v_callback == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":839
 * ) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if callback == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaStreamCallbackData *cbData = NULL
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":838
 *   unsigned int flags
 * ) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if callback == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":841
 *         return cudaErrorInvalidValue
 * 
 *     cdef cudaStreamCallbackData *cbData = NULL             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cbData = <cudaStreamCallbackData *>malloc(sizeof(cbData[0]))
 */
  __pyx_v_cbData = NULL;

  /* "cuda/_lib/ccudart/utils.pyx":843
 *     cdef cudaStreamCallbackData *cbData = NULL
 *     cdef cudaError_t err
 *     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":845
 *     cbData = <cudaStreamCallbackData *>malloc(sizeof(cbData[0]))
 * 
 *     if cbData == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorMemoryAllocation
 * 
 */
  __pyx_t_1 = ((__pyx_v_cbData == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":846
 * 
 *     if cbData == NULL:
 *         return cudaErrorMemoryAllocation             # <<<<<<<<<<<<<<
 * 
 *     cbData.callback = callback
 */
    __pyx_r = cudaErrorMemoryAllocation;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":845
 *     cbData = <cudaStreamCallbackData *>malloc(sizeof(cbData[0]))
 * 
 *     if cbData == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorMemoryAllocation
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":848
 *         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":849
 * 
 *     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":850
 *     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, 850, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_2);

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

    /* "cuda/_lib/ccudart/utils.pyx":852
 *     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":851
 *     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":853
 *     if err != cudaSuccess:
 *         free(cbData)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":832
 * 
 * 
 * cdef cudaError_t streamAddCallbackCommon(             # <<<<<<<<<<<<<<
 *   cudaStream_t stream,
 *   cudaStreamCallback_t callback,
 */

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

/* "cuda/_lib/ccudart/utils.pyx":856
 * 
 * 
 * cdef cudaError_t toRuntimeStreamCaptureStatus(ccuda.CUstreamCaptureStatus driverCaptureStatus, cudaStreamCaptureStatus *runtimeStatus) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("toRuntimeStreamCaptureStatus", __pyx_f[0], 856, 1, __PYX_ERR(0, 856, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":857
 * 
 * cdef cudaError_t toRuntimeStreamCaptureStatus(ccuda.CUstreamCaptureStatus driverCaptureStatus, cudaStreamCaptureStatus *runtimeStatus) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":858
 * cdef cudaError_t toRuntimeStreamCaptureStatus(ccuda.CUstreamCaptureStatus driverCaptureStatus, cudaStreamCaptureStatus *runtimeStatus) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":857
 * 
 * cdef cudaError_t toRuntimeStreamCaptureStatus(ccuda.CUstreamCaptureStatus driverCaptureStatus, cudaStreamCaptureStatus *runtimeStatus) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":860
 *         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":859
 *     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":862
 *         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":861
 *     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":864
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusInvalidated
 *     else:
 *          return cudaErrorUnknown             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
    __pyx_r = cudaErrorUnknown;
    goto __pyx_L0;
    break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":865
 *     else:
 *          return cudaErrorUnknown
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":856
 * 
 * 
 * cdef cudaError_t toRuntimeStreamCaptureStatus(ccuda.CUstreamCaptureStatus driverCaptureStatus, cudaStreamCaptureStatus *runtimeStatus) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if driverCaptureStatus == ccuda.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_NONE:
 *         runtimeStatus[0] = cudaStreamCaptureStatus.cudaStreamCaptureStatusNone
 */

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

/* "cuda/_lib/ccudart/utils.pyx":868
 * 
 * 
 * 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;
  int __pyx_t_2;
  CUresult __pyx_t_3;
  cudaError_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("streamGetCaptureInfoCommon", __pyx_f[0], 868, 1, __PYX_ERR(0, 868, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":878
 *     cdef cudaError_t err
 * 
 *     if captureStatus_out == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_1 = ((__pyx_v_captureStatus_out == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":879
 * 
 *     if captureStatus_out == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUstreamCaptureStatus driverCaptureStatus
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":878
 *     cdef cudaError_t err
 * 
 *     if captureStatus_out == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":883
 *     cdef ccuda.CUstreamCaptureStatus driverCaptureStatus
 * 
 *     if graph_out or dependencies_out or numDependencies_out:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuStreamGetCaptureInfo_v2(stream, &driverCaptureStatus, <ccuda.cuuint64_t*>id_out,
 *                 graph_out, dependencies_out, numDependencies_out)
 */
  __pyx_t_2 = (__pyx_v_graph_out != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_dependencies_out != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_numDependencies_out != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":884
 * 
 *     if graph_out or dependencies_out or numDependencies_out:
 *         err = <cudaError_t>ccuda._cuStreamGetCaptureInfo_v2(stream, &driverCaptureStatus, <ccuda.cuuint64_t*>id_out,             # <<<<<<<<<<<<<<
 *                 graph_out, dependencies_out, numDependencies_out)
 *         if err != cudaSuccess:
 */
    __pyx_t_3 = __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_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 884, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":886
 *         err = <cudaError_t>ccuda._cuStreamGetCaptureInfo_v2(stream, &driverCaptureStatus, <ccuda.cuuint64_t*>id_out,
 *                 graph_out, dependencies_out, numDependencies_out)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     else:
 */
    __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":887
 *                 graph_out, dependencies_out, numDependencies_out)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *     else:
 *         err = <cudaError_t>ccuda._cuStreamGetCaptureInfo(stream, &driverCaptureStatus, <ccuda.cuuint64_t*>id_out)
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":886
 *         err = <cudaError_t>ccuda._cuStreamGetCaptureInfo_v2(stream, &driverCaptureStatus, <ccuda.cuuint64_t*>id_out,
 *                 graph_out, dependencies_out, numDependencies_out)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     else:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":883
 *     cdef ccuda.CUstreamCaptureStatus driverCaptureStatus
 * 
 *     if graph_out or dependencies_out or numDependencies_out:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuStreamGetCaptureInfo_v2(stream, &driverCaptureStatus, <ccuda.cuuint64_t*>id_out,
 *                 graph_out, dependencies_out, numDependencies_out)
 */
    goto __pyx_L4;
  }

  /* "cuda/_lib/ccudart/utils.pyx":889
 *             return err
 *     else:
 *         err = <cudaError_t>ccuda._cuStreamGetCaptureInfo(stream, &driverCaptureStatus, <ccuda.cuuint64_t*>id_out)             # <<<<<<<<<<<<<<
 *         if err != cudaSuccess:
 *             return err
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetCaptureInfo(__pyx_v_stream, (&__pyx_v_driverCaptureStatus), ((cuuint64_t *)__pyx_v_id_out)); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 889, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":890
 *     else:
 *         err = <cudaError_t>ccuda._cuStreamGetCaptureInfo(stream, &driverCaptureStatus, <ccuda.cuuint64_t*>id_out)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":891
 *         err = <cudaError_t>ccuda._cuStreamGetCaptureInfo(stream, &driverCaptureStatus, <ccuda.cuuint64_t*>id_out)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 * 
 *     return toRuntimeStreamCaptureStatus(driverCaptureStatus, captureStatus_out)
 */
      __pyx_r = __pyx_v_err;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":890
 *     else:
 *         err = <cudaError_t>ccuda._cuStreamGetCaptureInfo(stream, &driverCaptureStatus, <ccuda.cuuint64_t*>id_out)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }
  }
  __pyx_L4:;

  /* "cuda/_lib/ccudart/utils.pyx":893
 *             return err
 * 
 *     return toRuntimeStreamCaptureStatus(driverCaptureStatus, captureStatus_out)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __pyx_f_4cuda_4_lib_7ccudart_5utils_toRuntimeStreamCaptureStatus(__pyx_v_driverCaptureStatus, __pyx_v_captureStatus_out); if (unlikely(__pyx_t_4 == ((cudaError_t)cudaErrorCallRequiresNewerDriver) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 893, __pyx_L1_error)
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":868
 * 
 * 
 * cdef cudaError_t streamGetCaptureInfoCommon(             # <<<<<<<<<<<<<<
 *   cudaStream_t stream,
 *   cudaStreamCaptureStatus* captureStatus_out,
 */

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

/* "cuda/_lib/ccudart/utils.pyx":896
 * 
 * 
 * cdef ccuda.CUDA_MEMCPY3D_v2 memCopy3DInit(ccuda.CUmemorytype_enum dstType, ccuda.CUmemorytype_enum srcType) 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;
  __Pyx_TraceCall("memCopy3DInit", __pyx_f[0], 896, 1, __PYX_ERR(0, 896, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":898
 * cdef ccuda.CUDA_MEMCPY3D_v2 memCopy3DInit(ccuda.CUmemorytype_enum dstType, ccuda.CUmemorytype_enum srcType) 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":899
 *     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":900
 *     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":901
 *     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":902
 *     cp.srcMemoryType = srcType
 *     cp.WidthInBytes = 0
 *     cp.Height = 1             # <<<<<<<<<<<<<<
 *     cp.Depth = 1
 *     return cp
 */
  __pyx_v_cp.Height = 1;

  /* "cuda/_lib/ccudart/utils.pyx":903
 *     cp.WidthInBytes = 0
 *     cp.Height = 1
 *     cp.Depth = 1             # <<<<<<<<<<<<<<
 *     return cp
 * 
 */
  __pyx_v_cp.Depth = 1;

  /* "cuda/_lib/ccudart/utils.pyx":904
 *     cp.Height = 1
 *     cp.Depth = 1
 *     return cp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_cp;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":896
 * 
 * 
 * cdef ccuda.CUDA_MEMCPY3D_v2 memCopy3DInit(ccuda.CUmemorytype_enum dstType, ccuda.CUmemorytype_enum srcType) nogil:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cp
 *     memset(&cp, 0, sizeof(cp))
 */

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

/* "cuda/_lib/ccudart/utils.pyx":907
 * 
 * 
 * cdef ccuda.CUDA_MEMCPY2D_v2 memCopy2DInit(ccuda.CUmemorytype_enum dstType, ccuda.CUmemorytype_enum srcType) 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;
  __Pyx_TraceCall("memCopy2DInit", __pyx_f[0], 907, 1, __PYX_ERR(0, 907, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":909
 * cdef ccuda.CUDA_MEMCPY2D_v2 memCopy2DInit(ccuda.CUmemorytype_enum dstType, ccuda.CUmemorytype_enum srcType) 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":910
 *     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":911
 *     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":912
 *     cp.dstMemoryType = dstType
 *     cp.srcMemoryType = srcType
 *     cp.WidthInBytes = 0             # <<<<<<<<<<<<<<
 *     cp.Height = 1
 *     return cp
 */
  __pyx_v_cp.WidthInBytes = 0;

  /* "cuda/_lib/ccudart/utils.pyx":913
 *     cp.srcMemoryType = srcType
 *     cp.WidthInBytes = 0
 *     cp.Height = 1             # <<<<<<<<<<<<<<
 *     return cp
 * 
 */
  __pyx_v_cp.Height = 1;

  /* "cuda/_lib/ccudart/utils.pyx":914
 *     cp.WidthInBytes = 0
 *     cp.Height = 1
 *     return cp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_cp;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":907
 * 
 * 
 * cdef ccuda.CUDA_MEMCPY2D_v2 memCopy2DInit(ccuda.CUmemorytype_enum dstType, ccuda.CUmemorytype_enum srcType) nogil:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY2D_v2 cp
 *     memset(&cp, 0, sizeof(cp))
 */

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

/* "cuda/_lib/ccudart/utils.pyx":917
 * 
 * 
 * cdef cudaError_t bytesPerElement(size_t *bytes, int numberOfChannels, ccuda.CUarray_format format) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("bytesPerElement", __pyx_f[0], 917, 1, __PYX_ERR(0, 917, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":918
 * 
 * cdef cudaError_t bytesPerElement(size_t *bytes, int numberOfChannels, ccuda.CUarray_format format) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":919
 * cdef cudaError_t bytesPerElement(size_t *bytes, int numberOfChannels, ccuda.CUarray_format format) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":921
 *                   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":922
 *                   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":918
 * 
 * cdef cudaError_t bytesPerElement(size_t *bytes, int numberOfChannels, ccuda.CUarray_format format) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":923
 *         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":924
 *         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":926
 *                     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":927
 *                     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":923
 *         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":928
 *         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":929
 *         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":931
 *                     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":932
 *                     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":928
 *         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":933
 *         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":935
 *     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":936
 *                     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":933
 *         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":937
 *         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":938
 *         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":939
 *     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":941
 *                     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":942
 *                     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":937
 *         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":943
 *         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":944
 *         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":945
 *     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":947
 *                     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":948
 *                     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":943
 *         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":949
 *         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":951
 *     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":952
 *                     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":949
 *         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":953
 *         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":954
 *         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":955
 *     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":956
 *                     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":957
 *                     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":958
 *                     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":959
 *                     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":960
 *                     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":961
 *                     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":963
 *                     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":964
 *                     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":953
 *         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":965
 *         bytes[0] = 16
 *         return cudaSuccess
 *     return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaErrorInvalidChannelDescriptor;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":917
 * 
 * 
 * cdef cudaError_t bytesPerElement(size_t *bytes, int numberOfChannels, ccuda.CUarray_format format) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if format in (ccuda.CU_AD_FORMAT_FLOAT,
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT32,
 */

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

/* "cuda/_lib/ccudart/utils.pyx":968
 * 
 * 
 * cdef cudaError_t getChannelFormatDescFromDriverDesc(             # <<<<<<<<<<<<<<
 *     cudaChannelFormatDesc* pRuntimeDesc, size_t* pDepth, size_t* pHeight, size_t* pWidth,
 *     const ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2* pDriverDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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;
  __Pyx_TraceCall("getChannelFormatDescFromDriverDesc", __pyx_f[0], 968, 1, __PYX_ERR(0, 968, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":972
 *     const ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2* pDriverDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 * 
 *     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":973
 * 
 *     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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":974
 *     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":975
 *     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":973
 * 
 *     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":976
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":977
 *         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":978
 *     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":976
 *         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":979
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":980
 *         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":981
 *     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":979
 *         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":982
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":983
 *         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":984
 *     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":982
 *         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":985
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":986
 *         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":987
 *     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":985
 *         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":988
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":989
 *         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":990
 *     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":988
 *         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":991
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":992
 *         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":993
 *     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":991
 *         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":994
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":995
 *         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":996
 *     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":994
 *         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":997
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":998
 *         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":999
 *     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":997
 *         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":1000
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1001
 *         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":1002
 *     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":1000
 *         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":1003
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1004
 *         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":1005
 *     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":1003
 *         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":1006
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1007
 *         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":1008
 *     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":1006
 *         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":1009
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1010
 *         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":1011
 *     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":1009
 *         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":1012
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1013
 *         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":1014
 *     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":1012
 *         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":1015
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1016
 *         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":1017
 *     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":1015
 *         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":1018
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1019
 *         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":1020
 *     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":1018
 *         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":1021
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1022
 *         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":1023
 *     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":1021
 *         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":1024
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1025
 *         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":1026
 *     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":1024
 *         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":1027
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1028
 *         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":1029
 *     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":1027
 *         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":1030
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1031
 *         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":1032
 *     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":1030
 *         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":1033
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1034
 *         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":1035
 *     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":1033
 *         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":1036
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1037
 *         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":1038
 *     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":1036
 *         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":1039
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1040
 *         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":1041
 *     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":1039
 *         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":1042
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1043
 *         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":1044
 *     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":1042
 *         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":1045
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1046
 *         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":1047
 *     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":1045
 *         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":1048
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1049
 *         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":1050
 *     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":1048
 *         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":1051
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1052
 *         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":1053
 *     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":1051
 *         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":1054
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1055
 *         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":1056
 *     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":1054
 *         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":1057
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1058
 *         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":1059
 *     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":1057
 *         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":1060
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1061
 *         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":1062
 *     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":1060
 *         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":1063
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1064
 *         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":1065
 *     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":1063
 *         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":1066
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1067
 *         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":1068
 *     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":1066
 *         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":1069
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1070
 *         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":1071
 *     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":1069
 *         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":1072
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1073
 *         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":1074
 *     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":1072
 *         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":1075
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1076
 *         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":1077
 *     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":1075
 *         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":1079
 *         channel_size = 8
 *     else:
 *         return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 * 
 *     # populate bits per channel
 */
  /*else*/ {
    __pyx_r = cudaErrorInvalidChannelDescriptor;
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "cuda/_lib/ccudart/utils.pyx":1082
 * 
 *     # 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":1083
 *     # 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":1084
 *     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":1085
 *     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":1087
 *     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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1088
 * 
 *     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":1087
 *     pRuntimeDesc[0].w = 0
 * 
 *     if pDriverDesc[0].NumChannels >= 4:             # <<<<<<<<<<<<<<
 *         pRuntimeDesc[0].w = channel_size
 *     if pDriverDesc[0].NumChannels >= 3:
 */
  }

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

    /* "cuda/_lib/ccudart/utils.pyx":1090
 *         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":1089
 *     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":1091
 *     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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1092
 *         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":1091
 *     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":1093
 *     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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1094
 *         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":1093
 *     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":1096
 *         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) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_t_2 != 3) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_t_2 != 2) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_t_2 != 1) != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L9_bool_binop_done:;
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":1097
 * 
 *     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":1096
 *         pRuntimeDesc[0].x = channel_size
 * 
 *     if pDriverDesc[0].NumChannels not in (4, 3, 2, 1):             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidChannelDescriptor
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1100
 * 
 *     # populate dimensions
 *     if pDepth != NULL:             # <<<<<<<<<<<<<<
 *         pDepth[0]  = pDriverDesc[0].Depth
 *     if pHeight != NULL:
 */
  __pyx_t_3 = ((__pyx_v_pDepth != NULL) != 0);
  if (__pyx_t_3) {

    /* "cuda/_lib/ccudart/utils.pyx":1101
 *     # 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":1100
 * 
 *     # populate dimensions
 *     if pDepth != NULL:             # <<<<<<<<<<<<<<
 *         pDepth[0]  = pDriverDesc[0].Depth
 *     if pHeight != NULL:
 */
  }

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

    /* "cuda/_lib/ccudart/utils.pyx":1103
 *         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":1102
 *     if pDepth != NULL:
 *         pDepth[0]  = pDriverDesc[0].Depth
 *     if pHeight != NULL:             # <<<<<<<<<<<<<<
 *         pHeight[0] = pDriverDesc[0].Height
 *     if pWidth != NULL:
 */
  }

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

    /* "cuda/_lib/ccudart/utils.pyx":1105
 *         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":1104
 *     if pHeight != NULL:
 *         pHeight[0] = pDriverDesc[0].Height
 *     if pWidth != NULL:             # <<<<<<<<<<<<<<
 *         pWidth[0]  = pDriverDesc[0].Width
 *     return cudaSuccess
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1106
 *     if pWidth != NULL:
 *         pWidth[0]  = pDriverDesc[0].Width
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":968
 * 
 * 
 * cdef cudaError_t getChannelFormatDescFromDriverDesc(             # <<<<<<<<<<<<<<
 *     cudaChannelFormatDesc* pRuntimeDesc, size_t* pDepth, size_t* pHeight, size_t* pWidth,
 *     const ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2* pDriverDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1109
 * 
 * 
 * cdef cudaError_t getArrayBlockExtent(cudaExtent *blockExtent, ccuda.CUarray_format format) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("getArrayBlockExtent", __pyx_f[0], 1109, 1, __PYX_ERR(0, 1109, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1110
 * 
 * cdef cudaError_t getArrayBlockExtent(cudaExtent *blockExtent, ccuda.CUarray_format format) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":1111
 * cdef cudaError_t getArrayBlockExtent(cudaExtent *blockExtent, ccuda.CUarray_format format) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":1112
 *     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":1113
 *                   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":1114
 *                   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":1115
 *                   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":1116
 *                   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":1117
 *                   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":1118
 *                   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":1119
 *                   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":1120
 *                   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":1121
 *                   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":1122
 *                   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":1123
 *                   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":1124
 *                   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":1125
 *                   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":1126
 *                   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":1127
 *                   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":1128
 *                   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":1129
 *                   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":1131
 *                   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":1132
 *                   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":1133
 *         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":1110
 * 
 * cdef cudaError_t getArrayBlockExtent(cudaExtent *blockExtent, ccuda.CUarray_format format) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":1134
 *         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":1135
 *         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":1136
 *     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":1137
 *                     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":1138
 *                     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":1139
 *                     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":1140
 *                     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":1141
 *                     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":1142
 *                     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":1143
 *                     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":1144
 *                     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":1145
 *                     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":1146
 *                     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":1148
 *                     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":1149
 *                     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":1150
 *         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":1134
 *         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":1152
 *         blockExtent[0].depth = 1
 *     else:
 *         return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
    __pyx_r = cudaErrorInvalidChannelDescriptor;
    goto __pyx_L0;
    break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1153
 *     else:
 *         return cudaErrorInvalidChannelDescriptor
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1109
 * 
 * 
 * cdef cudaError_t getArrayBlockExtent(cudaExtent *blockExtent, ccuda.CUarray_format format) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if format in (ccuda.CU_AD_FORMAT_FLOAT,
 *                   ccuda.CU_AD_FORMAT_UNSIGNED_INT32,
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1156
 * 
 * 
 * cdef cudaError_t getLocalState(cudaArrayLocalState *state, cudaArray_const_t thisArray) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaExtent compBlockExtent
 */

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;
  __Pyx_TraceCall("getLocalState", __pyx_f[0], 1156, 1, __PYX_ERR(0, 1156, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1160
 *     cdef cudaExtent compBlockExtent
 * 
 *     arrayState.array = <ccuda.CUarray>thisArray             # <<<<<<<<<<<<<<
 *     compBlockExtent.width = 1
 *     compBlockExtent.height = 1
 */
  __pyx_v_arrayState.array = ((CUarray)__pyx_v_thisArray);

  /* "cuda/_lib/ccudart/utils.pyx":1161
 * 
 *     arrayState.array = <ccuda.CUarray>thisArray
 *     compBlockExtent.width = 1             # <<<<<<<<<<<<<<
 *     compBlockExtent.height = 1
 *     compBlockExtent.depth = 1
 */
  __pyx_v_compBlockExtent.width = 1;

  /* "cuda/_lib/ccudart/utils.pyx":1162
 *     arrayState.array = <ccuda.CUarray>thisArray
 *     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":1163
 *     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":1165
 *     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":1166
 *     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, 1166, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

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

    /* "cuda/_lib/ccudart/utils.pyx":1168
 *     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":1167
 *     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":1169
 *     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, 1169, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

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

    /* "cuda/_lib/ccudart/utils.pyx":1171
 *     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":1170
 *         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":1172
 *     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, 1172, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

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

    /* "cuda/_lib/ccudart/utils.pyx":1174
 *     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":1173
 *         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":1175
 *     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, 1175, __pyx_L1_error)
  __pyx_v_err = __pyx_t_3;

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

    /* "cuda/_lib/ccudart/utils.pyx":1177
 *     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":1176
 *         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":1178
 *     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, 1178, __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":1180
 *     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":1181
 * 
 *     state[0] = arrayState
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1156
 * 
 * 
 * cdef cudaError_t getLocalState(cudaArrayLocalState *state, cudaArray_const_t thisArray) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaExtent compBlockExtent
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1184
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     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;
  __Pyx_TraceCall("copyFromHost2D", __pyx_f[0], 1184, 1, __PYX_ERR(0, 1184, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1187
 *     cdef cudaError_t err
 *     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":1188
 *     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, 1188, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":1190
 *     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":1189
 *     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":1191
 *     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":1193
 *     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":1194
 * 
 *     cp.dstArray      = arrayState.array
 *     cp.dstXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *     cp.dstY          = hOffset
 * 
 */
  __pyx_v_cp.dstXInBytes = __pyx_v_wOffset;

  /* "cuda/_lib/ccudart/utils.pyx":1195
 *     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":1197
 *     cp.dstY          = hOffset
 * 
 *     cp.srcHost       = src             # <<<<<<<<<<<<<<
 *     cp.srcPitch      = spitch
 *     cp.srcXInBytes   = 0
 */
  __pyx_v_cp.srcHost = __pyx_v_src;

  /* "cuda/_lib/ccudart/utils.pyx":1198
 * 
 *     cp.srcHost       = src
 *     cp.srcPitch      = spitch             # <<<<<<<<<<<<<<
 *     cp.srcXInBytes   = 0
 *     cp.srcY          = 0
 */
  __pyx_v_cp.srcPitch = __pyx_v_spitch;

  /* "cuda/_lib/ccudart/utils.pyx":1199
 *     cp.srcHost       = src
 *     cp.srcPitch      = spitch
 *     cp.srcXInBytes   = 0             # <<<<<<<<<<<<<<
 *     cp.srcY          = 0
 * 
 */
  __pyx_v_cp.srcXInBytes = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1200
 *     cp.srcPitch      = spitch
 *     cp.srcXInBytes   = 0
 *     cp.srcY          = 0             # <<<<<<<<<<<<<<
 * 
 *     cp.Height        = height
 */
  __pyx_v_cp.srcY = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1202
 *     cp.srcY          = 0
 * 
 *     cp.Height        = height             # <<<<<<<<<<<<<<
 *     cp.WidthInBytes  = width
 * 
 */
  __pyx_v_cp.Height = __pyx_v_height;

  /* "cuda/_lib/ccudart/utils.pyx":1203
 * 
 *     cp.Height        = height
 *     cp.WidthInBytes  = width             # <<<<<<<<<<<<<<
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 */
  __pyx_v_cp.WidthInBytes = __pyx_v_width;

  /* "cuda/_lib/ccudart/utils.pyx":1205
 *     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, 1205, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1206
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1184
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     cdef cudaArrayLocalState arrayState
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1209
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 */

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;
  __Pyx_TraceCall("copyFromDevice2D", __pyx_f[0], 1209, 1, __PYX_ERR(0, 1209, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1213
 *     cdef cudaError_t err
 *     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":1214
 *     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, 1214, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":1216
 *     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":1215
 *     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":1217
 *     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":1219
 *     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":1220
 * 
 *     cp.dstArray      = arrayState.array
 *     cp.dstXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *     cp.dstY          = hOffset
 * 
 */
  __pyx_v_cp.dstXInBytes = __pyx_v_wOffset;

  /* "cuda/_lib/ccudart/utils.pyx":1221
 *     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":1223
 *     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":1224
 * 
 *     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":1225
 *     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, 1225, __pyx_L1_error)
  }
  __pyx_v_cp.srcXInBytes = (__pyx_v_srcOffset % __pyx_v_spitch);

  /* "cuda/_lib/ccudart/utils.pyx":1226
 *     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, 1226, __pyx_L1_error)
  }
  __pyx_v_cp.srcY = ((size_t)(((double)__pyx_v_srcOffset) / ((double)__pyx_v_spitch)));

  /* "cuda/_lib/ccudart/utils.pyx":1228
 *     cp.srcY          = <size_t>(srcOffset / spitch)
 * 
 *     cp.Height        = height             # <<<<<<<<<<<<<<
 *     cp.WidthInBytes  = width
 * 
 */
  __pyx_v_cp.Height = __pyx_v_height;

  /* "cuda/_lib/ccudart/utils.pyx":1229
 * 
 *     cp.Height        = height
 *     cp.WidthInBytes  = width             # <<<<<<<<<<<<<<
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 */
  __pyx_v_cp.WidthInBytes = __pyx_v_width;

  /* "cuda/_lib/ccudart/utils.pyx":1231
 *     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, 1231, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1232
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1233
 *     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":1232
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

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

  /* "cuda/_lib/ccudart/utils.pyx":1209
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1238
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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;
  __Pyx_TraceCall("copyToHost2D", __pyx_f[0], 1238, 1, __PYX_ERR(0, 1238, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1242
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 *     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":1243
 *     cdef cudaError_t err
 *     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, 1243, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":1245
 *     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":1244
 *     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":1246
 *     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":1248
 *     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":1249
 * 
 *     cp.dstHost       = dst
 *     cp.dstPitch      = dpitch             # <<<<<<<<<<<<<<
 *     cp.dstXInBytes   = 0
 *     cp.dstY          = 0
 */
  __pyx_v_cp.dstPitch = __pyx_v_dpitch;

  /* "cuda/_lib/ccudart/utils.pyx":1250
 *     cp.dstHost       = dst
 *     cp.dstPitch      = dpitch
 *     cp.dstXInBytes   = 0             # <<<<<<<<<<<<<<
 *     cp.dstY          = 0
 * 
 */
  __pyx_v_cp.dstXInBytes = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1251
 *     cp.dstPitch      = dpitch
 *     cp.dstXInBytes   = 0
 *     cp.dstY          = 0             # <<<<<<<<<<<<<<
 * 
 *     cp.srcArray      = arrayState.array
 */
  __pyx_v_cp.dstY = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1253
 *     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":1254
 * 
 *     cp.srcArray      = arrayState.array
 *     cp.srcXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *     cp.srcY          = hOffset
 * 
 */
  __pyx_v_cp.srcXInBytes = __pyx_v_wOffset;

  /* "cuda/_lib/ccudart/utils.pyx":1255
 *     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":1257
 *     cp.srcY          = hOffset
 * 
 *     cp.Height        = height             # <<<<<<<<<<<<<<
 *     cp.WidthInBytes  = width
 * 
 */
  __pyx_v_cp.Height = __pyx_v_height;

  /* "cuda/_lib/ccudart/utils.pyx":1258
 * 
 *     cp.Height        = height
 *     cp.WidthInBytes  = width             # <<<<<<<<<<<<<<
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 */
  __pyx_v_cp.WidthInBytes = __pyx_v_width;

  /* "cuda/_lib/ccudart/utils.pyx":1260
 *     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, 1260, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1261
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1262
 *     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":1261
 * 
 *     err = driverMemcpy3D(&cp, stream, async)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

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

  /* "cuda/_lib/ccudart/utils.pyx":1238
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaArrayLocalState arrayState
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1267
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 * 
 */

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;
  __Pyx_TraceCall("copyToDevice2D", __pyx_f[0], 1267, 1, __PYX_ERR(0, 1267, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1272
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 *     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 cudaError_t err
 *     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(type, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  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(type, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 * 
 */
    __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(type, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1276
 *     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":1278
 *     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":1279
 * 
 *     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":1280
 *     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, 1280, __pyx_L1_error)
  }
  __pyx_v_cp.dstXInBytes = (__pyx_v_dstOffset % __pyx_v_dpitch);

  /* "cuda/_lib/ccudart/utils.pyx":1281
 *     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, 1281, __pyx_L1_error)
  }
  __pyx_v_cp.dstY = ((size_t)(((double)__pyx_v_dstOffset) / ((double)__pyx_v_dpitch)));

  /* "cuda/_lib/ccudart/utils.pyx":1283
 *     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":1284
 * 
 *     cp.srcArray      = arrayState.array
 *     cp.srcXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *     cp.srcY          = hOffset
 * 
 */
  __pyx_v_cp.srcXInBytes = __pyx_v_wOffset;

  /* "cuda/_lib/ccudart/utils.pyx":1285
 *     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":1287
 *     cp.srcY          = hOffset
 * 
 *     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) != 0);
  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":1267
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 * 
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1297
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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;
  __Pyx_TraceCall("copyToArray2D", __pyx_f[0], 1297, 1, __PYX_ERR(0, 1297, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1301
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 *     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
 *     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_ARRAY, ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY)
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  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_ARRAY, 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_ARRAY, 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_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":1307
 *     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":1308
 * 
 *     cp.dstArray      = <ccuda.CUarray>dst
 *     cp.dstXInBytes   = wOffsetDst             # <<<<<<<<<<<<<<
 *     cp.dstY          = hOffsetDst
 * 
 */
  __pyx_v_cp.dstXInBytes = __pyx_v_wOffsetDst;

  /* "cuda/_lib/ccudart/utils.pyx":1309
 *     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":1311
 *     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":1312
 * 
 *     cp.srcArray      = arrayState.array
 *     cp.srcXInBytes   = wOffsetSrc             # <<<<<<<<<<<<<<
 *     cp.srcY          = hOffsetSrc
 * 
 */
  __pyx_v_cp.srcXInBytes = __pyx_v_wOffsetSrc;

  /* "cuda/_lib/ccudart/utils.pyx":1313
 *     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":1315
 *     cp.srcY          = hOffsetSrc
 * 
 *     cp.Height        = height             # <<<<<<<<<<<<<<
 *     cp.WidthInBytes  = width
 * 
 */
  __pyx_v_cp.Height = __pyx_v_height;

  /* "cuda/_lib/ccudart/utils.pyx":1316
 * 
 *     cp.Height        = height
 *     cp.WidthInBytes  = width             # <<<<<<<<<<<<<<
 * 
 *     err = driverMemcpy3D(&cp, NULL, False)
 */
  __pyx_v_cp.WidthInBytes = __pyx_v_width;

  /* "cuda/_lib/ccudart/utils.pyx":1318
 *     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, 1318, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1319
 * 
 *     err = driverMemcpy3D(&cp, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1320
 *     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":1319
 * 
 *     err = driverMemcpy3D(&cp, NULL, False)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

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

  /* "cuda/_lib/ccudart/utils.pyx":1297
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaArrayLocalState arrayState
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1325
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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;
  __Pyx_TraceCall("copyToArray", __pyx_f[0], 1325, 1, __PYX_ERR(0, 1325, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1329
 *     cdef void *tmp
 *     cdef cudaError_t err
 *     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, 1329, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1330
 *     cdef cudaError_t err
 *     err = cudaMalloc(&tmp, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1331
 *     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":1330
 *     cdef cudaError_t err
 *     err = cudaMalloc(&tmp, count)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1333
 *         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, 1333, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":1335
 *     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":1334
 * 
 *     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":1336
 *     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, 1336, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":1338
 *     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":1337
 *         return err
 *     err = cudaMemcpyToArray(dst, wOffsetDst, hOffsetDst, tmp, count, cudaMemcpyDeviceToDevice)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     err = cudaFree(tmp)
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1339
 *     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, 1339, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1340
 *         return err
 *     err = cudaFree(tmp)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     return cudaSuccess
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

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

    /* "cuda/_lib/ccudart/utils.pyx":1340
 *         return err
 *     err = cudaFree(tmp)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     return cudaSuccess
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1342
 *     if err != cudaSuccess:
 *         return err
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1325
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef void *tmp
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1345
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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;
  __Pyx_TraceCall("memcpyArrayToArray", __pyx_f[0], 1345, 1, __PYX_ERR(0, 1345, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1348
 *                                     cudaArray_const_t src, size_t hOffsetSrc, size_t wOffsetSrc,
 *                                     size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if count == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if kind != cudaMemcpyDeviceToDevice and kind != cudaMemcpyDefault:
 */
  __pyx_t_1 = ((__pyx_v_count == 0) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1349
 *                                     size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if count == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 *     if kind != cudaMemcpyDeviceToDevice and kind != cudaMemcpyDefault:
 *         return cudaErrorInvalidMemcpyDirection
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1348
 *                                     cudaArray_const_t src, size_t hOffsetSrc, size_t wOffsetSrc,
 *                                     size_t count, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if count == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if kind != cudaMemcpyDeviceToDevice and kind != cudaMemcpyDefault:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1350
 *     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":1351
 *         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":1350
 *     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":1352
 *     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, 1352, __pyx_L1_error)
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1345
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1355
 * 
 * 
 * cdef cudaError_t getChannelDesc(cudaArray_const_t thisArray, cudaChannelFormatDesc *outDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 */

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;
  __Pyx_TraceCall("getChannelDesc", __pyx_f[0], 1355, 1, __PYX_ERR(0, 1355, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1358
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 *     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":1359
 *     cdef cudaError_t err
 *     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, 1359, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":1361
 *     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":1360
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     outDesc[0] = arrayState.desc
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1362
 *     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":1363
 *         return err
 *     outDesc[0] = arrayState.desc
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1355
 * 
 * 
 * cdef cudaError_t getChannelDesc(cudaArray_const_t thisArray, cudaChannelFormatDesc *outDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1366
 * 
 * 
 * cdef cudaError_t getFormat(cudaArray_const_t thisArray, int &numberOfChannels, ccuda.CUarray_format *format) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 */

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;
  __Pyx_TraceCall("getFormat", __pyx_f[0], 1366, 1, __PYX_ERR(0, 1366, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1369
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 *     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":1370
 *     cdef cudaError_t err
 *     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, 1370, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":1372
 *     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":1371
 *     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":1373
 *     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, 1373, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1366
 * 
 * 
 * cdef cudaError_t getFormat(cudaArray_const_t thisArray, int &numberOfChannels, ccuda.CUarray_format *format) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1376
 * 
 * 
 * cdef cudaError_t getDriverResDescFromResDesc(ccuda.CUDA_RESOURCE_DESC *rdDst, const cudaResourceDesc *rdSrc,             # <<<<<<<<<<<<<<
 *                                              ccuda.CUDA_TEXTURE_DESC *tdDst, const cudaTextureDesc_v2 *tdSrc,
 *                                              ccuda.CUDA_RESOURCE_VIEW_DESC *rvdDst, const cudaResourceViewDesc *rvdSrc) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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_v2 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;
  __Pyx_TraceCall("getDriverResDescFromResDesc", __pyx_f[0], 1376, 1, __PYX_ERR(0, 1376, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1379
 *                                              ccuda.CUDA_TEXTURE_DESC *tdDst, const cudaTextureDesc_v2 *tdSrc,
 *                                              ccuda.CUDA_RESOURCE_VIEW_DESC *rvdDst, const cudaResourceViewDesc *rvdSrc) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef int i = 0             # <<<<<<<<<<<<<<
 *     cdef int numChannels = 0
 *     cdef ccuda.CUarray_format format
 */
  __pyx_v_i = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1380
 *                                              ccuda.CUDA_RESOURCE_VIEW_DESC *rvdDst, const cudaResourceViewDesc *rvdSrc) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":1382
 *     cdef int numChannels = 0
 *     cdef ccuda.CUarray_format format
 *     cdef ccuda.CUarray hArray = NULL             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 *     i = 0
 */
  __pyx_v_hArray = NULL;

  /* "cuda/_lib/ccudart/utils.pyx":1384
 *     cdef ccuda.CUarray hArray = NULL
 *     cdef cudaError_t err
 *     i = 0             # <<<<<<<<<<<<<<
 * 
 *     memset(rdDst, 0, sizeof(rdDst[0]))
 */
  __pyx_v_i = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1386
 *     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":1388
 *     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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1389
 * 
 *     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":1390
 *     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":1391
 *         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, 1391, __pyx_L1_error)
    __pyx_v_err = __pyx_t_2;

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

      /* "cuda/_lib/ccudart/utils.pyx":1393
 *         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":1392
 *         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":1388
 *     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":1394
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1395
 *             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":1396
 *     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":1397
 *         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, 1397, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

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

      /* "cuda/_lib/ccudart/utils.pyx":1399
 *         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":1398
 *         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":1400
 *         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, 1400, __pyx_L1_error)
    __pyx_v_err = __pyx_t_2;

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

      /* "cuda/_lib/ccudart/utils.pyx":1402
 *         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":1401
 *             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":1394
 *         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":1403
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1404
 *             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":1405
 *     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":1406
 *         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":1407
 *         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, 1407, __pyx_L1_error)
    __pyx_v_err = __pyx_t_2;

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

      /* "cuda/_lib/ccudart/utils.pyx":1409
 *         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":1408
 *         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":1410
 *         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":1411
 *             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":1403
 *         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":1412
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1413
 *         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":1414
 *     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":1415
 *         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":1416
 *         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":1417
 *         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":1418
 *         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, 1418, __pyx_L1_error)
    __pyx_v_err = __pyx_t_2;

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

      /* "cuda/_lib/ccudart/utils.pyx":1420
 *         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":1419
 *         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":1421
 *         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":1422
 *             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":1412
 *         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":1424
 *         rdDst[0].res.pitch2D.numChannels  = numChannels
 *     else:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "cuda/_lib/ccudart/utils.pyx":1427
 * 
 * 
 *     rdDst[0].flags = 0             # <<<<<<<<<<<<<<
 * 
 *     if tdDst and tdSrc:
 */
  (__pyx_v_rdDst[0]).flags = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1429
 *     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":1430
 * 
 *     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":1432
 *         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) != 0);
      if (!__pyx_t_1) break;

      /* "cuda/_lib/ccudart/utils.pyx":1433
 * 
 *         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":1434
 *         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":1436
 *             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":1437
 * 
 *         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":1438
 *         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":1439
 *         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":1440
 *         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":1441
 *         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":1442
 *         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":1443
 *         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) != 0);
      if (!__pyx_t_1) break;

      /* "cuda/_lib/ccudart/utils.pyx":1444
 *         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":1445
 *         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":1447
 *             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":1448
 * 
 *         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":1447
 *             i += 1
 * 
 *         if tdSrc[0].sRGB:             # <<<<<<<<<<<<<<
 *             tdDst[0].flags |= ccuda.CU_TRSF_SRGB
 *         else:
 */
      goto __pyx_L16;
    }

    /* "cuda/_lib/ccudart/utils.pyx":1450
 *             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":1452
 *             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":1453
 * 
 *         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":1452
 *             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":1455
 *             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":1457
 *             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":1458
 * 
 *         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":1457
 *             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":1460
 *             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":1462
 *             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":1463
 * 
 *         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":1462
 *             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":1465
 *             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":1467
 *             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":1468
 * 
 *         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":1469
 *         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":1470
 *                       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":1471
 *                       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":1472
 *                       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":1473
 *                       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":1474
 *                       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":1475
 *                       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":1476
 *                       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":1477
 *                       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":1478
 *                       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":1479
 *                       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":1480
 *                       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":1481
 *                       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":1482
 *                       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":1483
 *                       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":1484
 *                       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":1485
 *                       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":1486
 *                       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":1487
 *                       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":1488
 *                       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":1489
 *                       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":1491
 *                       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) != 0);
      if (__pyx_t_1) {

        /* "cuda/_lib/ccudart/utils.pyx":1492
 *                       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":1491
 *                       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":1467
 *             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":1493
 *             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":1494
 *                 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":1495
 *         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":1497
 *                         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) != 0);
      if (__pyx_t_1) {

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

          /* "cuda/_lib/ccudart/utils.pyx":1499
 *             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":1498
 *                         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":1500
 *                 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":1497
 *                         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":1493
 *             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":1502
 *                 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":1501
 *                     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":1503
 *         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":1504
 *             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) != 0);
      if (__pyx_t_1) {

        /* "cuda/_lib/ccudart/utils.pyx":1505
 *         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":1504
 *             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":1506
 *             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) != 0);
      if (__pyx_t_1) {

        /* "cuda/_lib/ccudart/utils.pyx":1507
 *                 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":1506
 *             if tdSrc[0].filterMode == cudaTextureFilterMode.cudaFilterModeLinear:
 *                 return cudaErrorInvalidFilterSetting
 *             if tdSrc[0].readMode == cudaTextureReadMode.cudaReadModeNormalizedFloat:             # <<<<<<<<<<<<<<
 *                 return cudaErrorInvalidNormSetting
 *         else:
 */
      }

      /* "cuda/_lib/ccudart/utils.pyx":1503
 *         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":1509
 *                 return cudaErrorInvalidNormSetting
 *         else:
 *             if tdSrc[0].readMode == cudaTextureReadMode.cudaReadModeNormalizedFloat:             # <<<<<<<<<<<<<<
 *                 return cudaErrorInvalidNormSetting
 * 
 */
      __pyx_t_1 = (((__pyx_v_tdSrc[0]).readMode == cudaReadModeNormalizedFloat) != 0);
      if (__pyx_t_1) {

        /* "cuda/_lib/ccudart/utils.pyx":1510
 *         else:
 *             if tdSrc[0].readMode == cudaTextureReadMode.cudaReadModeNormalizedFloat:
 *                 return cudaErrorInvalidNormSetting             # <<<<<<<<<<<<<<
 * 
 *     if rvdDst and rvdSrc:
 */
        __pyx_r = cudaErrorInvalidNormSetting;
        goto __pyx_L0;

        /* "cuda/_lib/ccudart/utils.pyx":1509
 *                 return cudaErrorInvalidNormSetting
 *         else:
 *             if tdSrc[0].readMode == cudaTextureReadMode.cudaReadModeNormalizedFloat:             # <<<<<<<<<<<<<<
 *                 return cudaErrorInvalidNormSetting
 * 
 */
      }
      break;
    }

    /* "cuda/_lib/ccudart/utils.pyx":1429
 *     rdDst[0].flags = 0
 * 
 *     if tdDst and tdSrc:             # <<<<<<<<<<<<<<
 *         memset(tdDst, 0, sizeof(tdDst[0]))
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1512
 *                 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":1513
 * 
 *     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":1515
 *         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":1516
 * 
 *         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":1517
 *         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":1518
 *         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":1519
 *         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":1520
 *         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":1521
 *         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":1522
 *         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":1512
 *                 return cudaErrorInvalidNormSetting
 * 
 *     if rvdDst and rvdSrc:             # <<<<<<<<<<<<<<
 *         memset(rvdDst, 0, sizeof(rvdDst[0]))
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1524
 *         rvdDst[0].lastLayer        = rvdSrc[0].lastLayer
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1376
 * 
 * 
 * cdef cudaError_t getDriverResDescFromResDesc(ccuda.CUDA_RESOURCE_DESC *rdDst, const cudaResourceDesc *rdSrc,             # <<<<<<<<<<<<<<
 *                                              ccuda.CUDA_TEXTURE_DESC *tdDst, const cudaTextureDesc_v2 *tdSrc,
 *                                              ccuda.CUDA_RESOURCE_VIEW_DESC *rvdDst, const cudaResourceViewDesc *rvdSrc) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1527
 * 
 * 
 * cdef cudaError_t getResDescFromDriverResDesc(cudaResourceDesc *rdDst, const ccuda.CUDA_RESOURCE_DESC *rdSrc,             # <<<<<<<<<<<<<<
 *                                              cudaTextureDesc_v2 *tdDst, const ccuda.CUDA_TEXTURE_DESC *tdSrc,
 *                                              cudaResourceViewDesc *rvdDst, const ccuda.CUDA_RESOURCE_VIEW_DESC *rvdSrc) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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_v2 *__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
  __Pyx_RefNannyDeclarations
  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_RefNannySetupContext("getResDescFromDriverResDesc", 1);
  __Pyx_TraceCall("getResDescFromDriverResDesc", __pyx_f[0], 1527, 1, __PYX_ERR(0, 1527, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1530
 *                                              cudaTextureDesc_v2 *tdDst, const ccuda.CUDA_TEXTURE_DESC *tdSrc,
 *                                              cudaResourceViewDesc *rvdDst, const ccuda.CUDA_RESOURCE_VIEW_DESC *rvdSrc) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef int i = 0             # <<<<<<<<<<<<<<
 *     cdef int numChannels = 0
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 ad
 */
  /*try:*/ {
    __pyx_v_i = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1531
 *                                              cudaResourceViewDesc *rvdDst, const ccuda.CUDA_RESOURCE_VIEW_DESC *rvdSrc) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":1535
 *     cdef ccuda.CUarray hArray
 * 
 *     memset(rdDst, 0, sizeof(rdDst[0]))             # <<<<<<<<<<<<<<
 * 
 *     if rdSrc[0].resType == ccuda.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY:
 */
    (void)(memset(__pyx_v_rdDst, 0, (sizeof((__pyx_v_rdDst[0])))));

    /* "cuda/_lib/ccudart/utils.pyx":1537
 *     memset(rdDst, 0, sizeof(rdDst[0]))
 * 
 *     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) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1538
 * 
 *     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":1539
 *     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":1540
 *         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, 1540, __pyx_L4_error)
      __pyx_v_err = __pyx_t_2;

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

        /* "cuda/_lib/ccudart/utils.pyx":1542
 *         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_L3_return;

        /* "cuda/_lib/ccudart/utils.pyx":1541
 *         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":1537
 *     memset(rdDst, 0, sizeof(rdDst[0]))
 * 
 *     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_L6;
    }

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

      /* "cuda/_lib/ccudart/utils.pyx":1544
 *             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":1545
 *     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":1546
 *         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, 1546, __pyx_L4_error)
      __pyx_v_err = ((cudaError_t)__pyx_t_3);

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

        /* "cuda/_lib/ccudart/utils.pyx":1548
 *         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_L3_return;

        /* "cuda/_lib/ccudart/utils.pyx":1547
 *         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":1549
 *         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, 1549, __pyx_L4_error)
      __pyx_v_err = __pyx_t_2;

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

        /* "cuda/_lib/ccudart/utils.pyx":1551
 *         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_L3_return;

        /* "cuda/_lib/ccudart/utils.pyx":1550
 *             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":1543
 *         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_L6;
    }

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

      /* "cuda/_lib/ccudart/utils.pyx":1553
 *             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":1554
 *     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":1555
 *         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":1556
 *         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":1557
 *         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":1558
 *         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, 1558, __pyx_L4_error)
      __pyx_v_err = __pyx_t_2;

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

        /* "cuda/_lib/ccudart/utils.pyx":1562
 *                                                  &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_L3_return;

        /* "cuda/_lib/ccudart/utils.pyx":1561
 *                                                  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":1552
 *         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_L6;
    }

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

      /* "cuda/_lib/ccudart/utils.pyx":1564
 *             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":1565
 *     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":1566
 *         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":1567
 *         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":1568
 *         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":1569
 *         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":1570
 *         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":1571
 *         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, 1571, __pyx_L4_error)
      __pyx_v_err = __pyx_t_2;

      /* "cuda/_lib/ccudart/utils.pyx":1574
 *                                                 NULL, NULL, NULL,
 *                                                 &ad)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     else:
 */
      __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
      if (__pyx_t_1) {

        /* "cuda/_lib/ccudart/utils.pyx":1575
 *                                                 &ad)
 *         if err != cudaSuccess:
 *             return err             # <<<<<<<<<<<<<<
 *     else:
 *         return cudaErrorInvalidValue
 */
        __pyx_r = __pyx_v_err;
        goto __pyx_L3_return;

        /* "cuda/_lib/ccudart/utils.pyx":1574
 *                                                 NULL, NULL, NULL,
 *                                                 &ad)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *     else:
 */
      }

      /* "cuda/_lib/ccudart/utils.pyx":1563
 *         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_L6;
    }

    /* "cuda/_lib/ccudart/utils.pyx":1577
 *             return err
 *     else:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     if tdDst and tdSrc:
 */
    /*else*/ {
      __pyx_r = cudaErrorInvalidValue;
      goto __pyx_L3_return;
    }
    __pyx_L6:;

    /* "cuda/_lib/ccudart/utils.pyx":1579
 *         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_L13_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_tdSrc != 0);
    __pyx_t_1 = __pyx_t_7;
    __pyx_L13_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1580
 * 
 *     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":1581
 *     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":1582
 *         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) != 0);
        if (!__pyx_t_1) break;

        /* "cuda/_lib/ccudart/utils.pyx":1583
 *         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":1584
 *         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":1586
 *             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":1587
 * 
 *         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":1588
 *         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":1589
 *         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":1590
 *         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":1591
 *         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":1592
 *         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":1593
 *         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) != 0);
        if (!__pyx_t_1) break;

        /* "cuda/_lib/ccudart/utils.pyx":1594
 *         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":1595
 *         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":1597
 *             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":1598
 * 
 *         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":1597
 *             i += 1
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_SRGB:             # <<<<<<<<<<<<<<
 *             tdDst[0].sRGB                         = 1
 *         else:
 */
        goto __pyx_L19;
      }

      /* "cuda/_lib/ccudart/utils.pyx":1600
 *             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_L19:;

      /* "cuda/_lib/ccudart/utils.pyx":1602
 *             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":1603
 * 
 *         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":1602
 *             tdDst[0].sRGB                         = 0
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_NORMALIZED_COORDINATES:             # <<<<<<<<<<<<<<
 *             tdDst[0].normalizedCoords             = 1
 *         else:
 */
        goto __pyx_L20;
      }

      /* "cuda/_lib/ccudart/utils.pyx":1605
 *             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_L20:;

      /* "cuda/_lib/ccudart/utils.pyx":1607
 *             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":1608
 * 
 *         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":1607
 *             tdDst[0].normalizedCoords             = 0
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION:             # <<<<<<<<<<<<<<
 *             tdDst[0].disableTrilinearOptimization = 1
 *         else:
 */
        goto __pyx_L21;
      }

      /* "cuda/_lib/ccudart/utils.pyx":1610
 *             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_L21:;

      /* "cuda/_lib/ccudart/utils.pyx":1612
 *             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":1613
 * 
 *         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":1612
 *             tdDst[0].disableTrilinearOptimization = 0
 * 
 *         if tdSrc[0].flags & ccuda.CU_TRSF_SEAMLESS_CUBEMAP:             # <<<<<<<<<<<<<<
 *             tdDst[0].seamlessCubemap |= 1
 *         else:
 */
        goto __pyx_L22;
      }

      /* "cuda/_lib/ccudart/utils.pyx":1615
 *             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_L22:;

      /* "cuda/_lib/ccudart/utils.pyx":1617
 *             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":1618
 * 
 *         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":1619
 *         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":1620
 *                          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":1621
 *                          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":1622
 *                          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":1623
 *                          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":1624
 *                          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":1625
 *                          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":1626
 *                          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":1627
 *                          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":1628
 *                          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":1629
 *                          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":1630
 *                          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":1631
 *                          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":1632
 *                          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":1633
 *                          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":1634
 *                          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":1635
 *                          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":1636
 *                          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":1637
 *                          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":1638
 *                          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":1639
 *                          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":1641
 *                          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":1617
 *             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":1642
 *                          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":1643
 *             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":1644
 *         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":1646
 *                            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":1647
 *                            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":1648
 *             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":1647
 *                            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_L26;
              }

              /* "cuda/_lib/ccudart/utils.pyx":1650
 *                     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_L26:;
            }

            /* "cuda/_lib/ccudart/utils.pyx":1646
 *                            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_L25;
              }
              __pyx_L25:;
            }
        }

        /* "cuda/_lib/ccudart/utils.pyx":1642
 *                          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":1652
 *                     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":1579
 *         return cudaErrorInvalidValue
 * 
 *     if tdDst and tdSrc:             # <<<<<<<<<<<<<<
 *         memset(tdDst, 0, sizeof(tdDst[0]))
 *         i = 0
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1654
 *             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_L28_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_rvdSrc != 0);
    __pyx_t_1 = __pyx_t_7;
    __pyx_L28_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":1655
 * 
 *     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":1657
 *         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":1658
 * 
 *         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":1659
 *         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":1660
 *         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":1661
 *         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":1662
 *         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":1663
 *         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":1664
 *         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":1654
 *             tdDst[0].readMode = cudaTextureReadMode.cudaReadModeElementType
 * 
 *     if rvdDst and rvdSrc:             # <<<<<<<<<<<<<<
 *         memset(rvdDst, 0, sizeof(rvdDst[0]))
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1666
 *         rvdDst[0].lastLayer        = rvdSrc[0].lastLayer
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L3_return;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1530
 *                                              cudaTextureDesc_v2 *tdDst, const ccuda.CUDA_TEXTURE_DESC *tdSrc,
 *                                              cudaResourceViewDesc *rvdDst, const ccuda.CUDA_RESOURCE_VIEW_DESC *rvdSrc) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef int i = 0             # <<<<<<<<<<<<<<
 *     cdef int numChannels = 0
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 ad
 */
  /*finally:*/ {
    __pyx_L3_return: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L0;
    }
    __pyx_L4_error: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L1_error;
    }
  }

  /* "cuda/_lib/ccudart/utils.pyx":1527
 * 
 * 
 * cdef cudaError_t getResDescFromDriverResDesc(cudaResourceDesc *rdDst, const ccuda.CUDA_RESOURCE_DESC *rdSrc,             # <<<<<<<<<<<<<<
 *                                              cudaTextureDesc_v2 *tdDst, const ccuda.CUDA_TEXTURE_DESC *tdSrc,
 *                                              cudaResourceViewDesc *rvdDst, const ccuda.CUDA_RESOURCE_VIEW_DESC *rvdSrc) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1669
 * 
 * 
 * cdef cudaError_t memsetPtr(char *mem, int c, size_t count, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("memsetPtr", __pyx_f[0], 1669, 1, __PYX_ERR(0, 1669, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1670
 * 
 * cdef cudaError_t memsetPtr(char *mem, int c, size_t count, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if count == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  __pyx_t_1 = ((__pyx_v_count == 0) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1671
 * cdef cudaError_t memsetPtr(char *mem, int c, size_t count, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if count == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if not async:
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1670
 * 
 * cdef cudaError_t memsetPtr(char *mem, int c, size_t count, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if count == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  }

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

    /* "cuda/_lib/ccudart/utils.pyx":1674
 * 
 *     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, 1674, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_2);
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1673
 *         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":1676
 *         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, 1676, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_2);
    goto __pyx_L0;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1669
 * 
 * 
 * cdef cudaError_t memsetPtr(char *mem, int c, size_t count, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if count == 0:
 *         return cudaSuccess
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1679
 * 
 * 
 * cdef cudaError_t memset2DPtr(char *mem, size_t pitch, int c, size_t width, size_t height, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("memset2DPtr", __pyx_f[0], 1679, 1, __PYX_ERR(0, 1679, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1680
 * 
 * cdef cudaError_t memset2DPtr(char *mem, size_t pitch, int c, size_t width, size_t height, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  __pyx_t_2 = ((__pyx_v_width == 0) != 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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":1681
 * cdef cudaError_t memset2DPtr(char *mem, size_t pitch, int c, size_t width, size_t height, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if width == 0 or height == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if not async:
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1680
 * 
 * cdef cudaError_t memset2DPtr(char *mem, size_t pitch, int c, size_t width, size_t height, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  }

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

    /* "cuda/_lib/ccudart/utils.pyx":1684
 * 
 *     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, 1684, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_3);
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1683
 *         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":1686
 *         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, 1686, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_3);
    goto __pyx_L0;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1679
 * 
 * 
 * cdef cudaError_t memset2DPtr(char *mem, size_t pitch, int c, size_t width, size_t height, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if width == 0 or height == 0:
 *         return cudaSuccess
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1689
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 */

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;
  __Pyx_TraceCall("copyFromHost", __pyx_f[0], 1689, 1, __PYX_ERR(0, 1689, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1692
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 *     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":1693
 *     cdef cudaError_t err
 *     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, 1693, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":1695
 *     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":1694
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t copied = 0
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1696
 *     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":1697
 *         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":1699
 *     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) != 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)) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1700
 * 
 *     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":1701
 *     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":1702
 *         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":1704
 *         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":1705
 * 
 *         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":1706
 *         cp.srcHost       = src
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = 0             # <<<<<<<<<<<<<<
 *         cp.srcY          = 0
 * 
 */
    __pyx_v_cp.srcXInBytes = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1707
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = 0
 *         cp.srcY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.Height        = 1
 */
    __pyx_v_cp.srcY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1709
 *         cp.srcY          = 0
 * 
 *         cp.Height        = 1             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = arrayState.widthInBytes - wOffset
 * 
 */
    __pyx_v_cp.Height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1710
 * 
 *         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":1712
 *         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":1713
 * 
 *         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":1714
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height
 *         wOffset  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_wOffset = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1716
 *         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, 1716, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1717
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1718
 *         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":1717
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

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

    /* "cuda/_lib/ccudart/utils.pyx":1721
 * 
 *     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":1722
 *     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":1723
 *         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":1725
 *         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":1726
 * 
 *         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":1727
 *         cp.srcHost       = src + copied
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = 0             # <<<<<<<<<<<<<<
 *         cp.srcY          = 0
 * 
 */
    __pyx_v_cp.srcXInBytes = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1728
 *         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":1730
 *         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, 1730, __pyx_L1_error)
    }
    __pyx_v_cp.Height = ((size_t)(((double)__pyx_t_5) / ((double)__pyx_v_arrayState.widthInBytes)));

    /* "cuda/_lib/ccudart/utils.pyx":1731
 * 
 *         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":1733
 *         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":1734
 * 
 *         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":1735
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height
 *         wOffset  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_wOffset = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1737
 *         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, 1737, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1738
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1739
 *         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":1738
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1720
 *             return err
 * 
 *     if (count - copied >= arrayState.widthInBytes):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1741
 *             return err
 * 
 *     if (count - copied > 0):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  __pyx_t_2 = (((__pyx_v_count - __pyx_v_copied) > 0) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1742
 * 
 *     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":1743
 *     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":1744
 *         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":1746
 *         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":1747
 * 
 *         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":1748
 *         cp.srcHost       = src + copied
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = 0             # <<<<<<<<<<<<<<
 *         cp.srcY          = 0
 * 
 */
    __pyx_v_cp.srcXInBytes = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1749
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = 0
 *         cp.srcY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.Height        = 1
 */
    __pyx_v_cp.srcY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1751
 *         cp.srcY          = 0
 * 
 *         cp.Height        = 1             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = count - copied
 * 
 */
    __pyx_v_cp.Height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1752
 * 
 *         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":1754
 *         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, 1754, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1755
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1756
 *         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":1755
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1741
 *             return err
 * 
 *     if (count - copied > 0):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  }

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

  /* "cuda/_lib/ccudart/utils.pyx":1689
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1761
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 */

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;
  __Pyx_TraceCall("copyFromDevice", __pyx_f[0], 1761, 1, __PYX_ERR(0, 1761, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1764
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 *     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":1765
 *     cdef cudaError_t err
 *     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, 1765, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":1767
 *     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":1766
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t copied = 0
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1768
 *     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":1769
 *         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":1771
 *     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) != 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)) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1772
 * 
 *     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":1773
 *     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":1774
 *         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":1776
 *         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":1777
 * 
 *         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":1778
 *         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":1779
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = srcOffset
 *         cp.srcY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.Height        = 1
 */
    __pyx_v_cp.srcY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1781
 *         cp.srcY          = 0
 * 
 *         cp.Height        = 1             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = arrayState.widthInBytes - wOffset
 * 
 */
    __pyx_v_cp.Height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1782
 * 
 *         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":1784
 *         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":1785
 * 
 *         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":1786
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height
 *         wOffset  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_wOffset = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1788
 *         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, 1788, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1789
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1790
 *         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":1789
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

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

    /* "cuda/_lib/ccudart/utils.pyx":1793
 * 
 *     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":1794
 *     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":1795
 *         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":1797
 *         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":1798
 * 
 *         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":1799
 *         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":1800
 *         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":1802
 *         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, 1802, __pyx_L1_error)
    }
    __pyx_v_cp.Height = ((size_t)(((double)__pyx_t_5) / ((double)__pyx_v_arrayState.widthInBytes)));

    /* "cuda/_lib/ccudart/utils.pyx":1803
 * 
 *         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":1805
 *         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":1806
 * 
 *         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":1807
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height
 *         wOffset  = 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_wOffset = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1810
 * 
 * 
 *         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, 1810, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1811
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1812
 *         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":1811
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1792
 *             return err
 * 
 *     if (count - copied >= arrayState.widthInBytes):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1814
 *             return err
 * 
 *     if (count - copied > 0):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  __pyx_t_2 = (((__pyx_v_count - __pyx_v_copied) > 0) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1815
 * 
 *     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":1816
 *     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":1817
 *         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":1819
 *         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":1820
 * 
 *         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":1821
 *         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":1822
 *         cp.srcPitch      = arrayState.widthInBytes
 *         cp.srcXInBytes   = srcOffset
 *         cp.srcY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.Height        = 1
 */
    __pyx_v_cp.srcY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1824
 *         cp.srcY          = 0
 * 
 *         cp.Height        = 1             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = count - copied
 * 
 */
    __pyx_v_cp.Height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1825
 * 
 *         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":1827
 *         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, 1827, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1828
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1829
 *         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":1828
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1814
 *             return err
 * 
 *     if (count - copied > 0):             # <<<<<<<<<<<<<<
 *         cp.dstArray      = arrayState.array
 *         cp.dstXInBytes   = wOffset
 */
  }

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

  /* "cuda/_lib/ccudart/utils.pyx":1761
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1834
 * 
 * 
 * cdef cudaError_t copyToHost(cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, char *dst, size_t count, ccuda.CUstream stream, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 */

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;
  __Pyx_TraceCall("copyToHost", __pyx_f[0], 1834, 1, __PYX_ERR(0, 1834, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1837
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 *     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":1838
 *     cdef cudaError_t err
 *     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, 1838, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":1840
 *     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":1839
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t copied = 0
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1841
 *     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":1842
 *         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":1844
 *     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) != 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)) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1845
 * 
 *     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":1846
 *     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":1847
 *         cp.dstHost       = dst
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = 0             # <<<<<<<<<<<<<<
 *         cp.dstY          = 0
 * 
 */
    __pyx_v_cp.dstXInBytes = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1848
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = 0
 *         cp.dstY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.srcArray      = arrayState.array
 */
    __pyx_v_cp.dstY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1850
 *         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":1851
 * 
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.srcY          = hOffset
 * 
 */
    __pyx_v_cp.srcXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1852
 *         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":1854
 *         cp.srcY          = hOffset
 * 
 *         cp.Height        = 1             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = arrayState.widthInBytes - wOffset
 * 
 */
    __pyx_v_cp.Height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1855
 * 
 *         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":1857
 *         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":1858
 * 
 *         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":1859
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height
 *         wOffset  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_wOffset = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1861
 *         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, 1861, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1862
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1863
 *         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":1862
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

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

    /* "cuda/_lib/ccudart/utils.pyx":1866
 * 
 *     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":1867
 *     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":1868
 *         cp.dstHost       = dst + copied
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = 0             # <<<<<<<<<<<<<<
 *         cp.dstY          = 0
 * 
 */
    __pyx_v_cp.dstXInBytes = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1869
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = 0
 *         cp.dstY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.srcArray      = arrayState.array
 */
    __pyx_v_cp.dstY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1871
 *         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":1872
 * 
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.srcY          = hOffset
 * 
 */
    __pyx_v_cp.srcXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1873
 *         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":1875
 *         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, 1875, __pyx_L1_error)
    }
    __pyx_v_cp.Height = ((size_t)(((double)__pyx_t_4) / ((double)__pyx_v_arrayState.widthInBytes)));

    /* "cuda/_lib/ccudart/utils.pyx":1876
 * 
 *         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":1878
 *         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":1879
 * 
 *         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":1880
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height
 *         wOffset  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_wOffset = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1882
 *         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, 1882, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1883
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1884
 *         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":1883
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1865
 *             return err
 * 
 *     if (count - copied >= arrayState.widthInBytes):             # <<<<<<<<<<<<<<
 *         cp.dstHost       = dst + copied
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1886
 *             return err
 * 
 *     if (count - copied > 0):             # <<<<<<<<<<<<<<
 *         cp.dstHost       = dst + copied
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  __pyx_t_2 = (((__pyx_v_count - __pyx_v_copied) > 0) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1887
 * 
 *     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":1888
 *     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":1889
 *         cp.dstHost       = dst + copied
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = 0             # <<<<<<<<<<<<<<
 *         cp.dstY          = 0
 * 
 */
    __pyx_v_cp.dstXInBytes = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1890
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = 0
 *         cp.dstY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.srcArray      = arrayState.array
 */
    __pyx_v_cp.dstY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1892
 *         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":1893
 * 
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.srcY          = hOffset
 * 
 */
    __pyx_v_cp.srcXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1894
 *         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":1896
 *         cp.srcY          = hOffset
 * 
 *         cp.Height        = 1             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = count - copied
 * 
 */
    __pyx_v_cp.Height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1897
 * 
 *         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":1899
 *         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, 1899, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1900
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1901
 *         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":1900
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1886
 *             return err
 * 
 *     if (count - copied > 0):             # <<<<<<<<<<<<<<
 *         cp.dstHost       = dst + copied
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  }

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

  /* "cuda/_lib/ccudart/utils.pyx":1834
 * 
 * 
 * cdef cudaError_t copyToHost(cudaArray_const_t thisArray, size_t hOffset, size_t wOffset, char *dst, size_t count, ccuda.CUstream stream, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1906
 * 
 * 
 * cdef cudaError_t driverMemcpy3DPeer(ccuda.CUDA_MEMCPY3D_PEER *cp, ccuda.CUstream stream, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("driverMemcpy3DPeer", __pyx_f[0], 1906, 1, __PYX_ERR(0, 1906, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1907
 * 
 * cdef cudaError_t driverMemcpy3DPeer(ccuda.CUDA_MEMCPY3D_PEER *cp, ccuda.CUstream stream, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":1908
 * cdef cudaError_t driverMemcpy3DPeer(ccuda.CUDA_MEMCPY3D_PEER *cp, ccuda.CUstream stream, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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, 1908, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_2);
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1907
 * 
 * cdef cudaError_t driverMemcpy3DPeer(ccuda.CUDA_MEMCPY3D_PEER *cp, ccuda.CUstream stream, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if async:             # <<<<<<<<<<<<<<
 *         return <cudaError_t>ccuda._cuMemcpy3DPeerAsync(cp, stream)
 *     else:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1910
 *         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, 1910, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_2);
    goto __pyx_L0;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1906
 * 
 * 
 * cdef cudaError_t driverMemcpy3DPeer(ccuda.CUDA_MEMCPY3D_PEER *cp, ccuda.CUstream stream, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if async:
 *         return <cudaError_t>ccuda._cuMemcpy3DPeerAsync(cp, stream)
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1913
 * 
 * 
 * cdef cudaError_t driverMemcpy3D(ccuda.CUDA_MEMCPY3D_v2 *cp, ccuda.CUstream stream, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("driverMemcpy3D", __pyx_f[0], 1913, 1, __PYX_ERR(0, 1913, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1914
 * 
 * cdef cudaError_t driverMemcpy3D(ccuda.CUDA_MEMCPY3D_v2 *cp, ccuda.CUstream stream, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":1915
 * cdef cudaError_t driverMemcpy3D(ccuda.CUDA_MEMCPY3D_v2 *cp, ccuda.CUstream stream, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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, 1915, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_2);
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":1914
 * 
 * cdef cudaError_t driverMemcpy3D(ccuda.CUDA_MEMCPY3D_v2 *cp, ccuda.CUstream stream, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if async:             # <<<<<<<<<<<<<<
 *         return <cudaError_t>ccuda._cuMemcpy3DAsync_v2(cp, stream)
 *     else:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1917
 *         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, 1917, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_2);
    goto __pyx_L0;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1913
 * 
 * 
 * cdef cudaError_t driverMemcpy3D(ccuda.CUDA_MEMCPY3D_v2 *cp, ccuda.CUstream stream, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if async:
 *         return <cudaError_t>ccuda._cuMemcpy3DAsync_v2(cp, stream)
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1920
 * 
 * 
 * cdef cudaError_t memcpy3D(const cudaMemcpy3DParms *p, bool peer, int srcDevice, int dstDevice, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("memcpy3D", __pyx_f[0], 1920, 1, __PYX_ERR(0, 1920, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1926
 *     cdef cudaPythonDevice *dstDev
 * 
 *     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, 1926, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

  /* "cuda/_lib/ccudart/utils.pyx":1927
 * 
 *     cdef cudaError_t err = toDriverMemCopy3DParams(p, &cd)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1928
 *     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":1927
 * 
 *     cdef cudaError_t err = toDriverMemCopy3DParams(p, &cd)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1931
 * 
 *     # 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":1932
 *     # 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":1933
 *     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":1934
 *         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) != 0);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = ((__pyx_v_dstDev == NULL) != 0);
    __pyx_t_2 = __pyx_t_3;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1935
 *         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":1934
 *         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":1936
 *         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":1937
 *             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":1938
 *         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":1939
 *         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":1940
 *         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":1941
 *         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":1942
 *         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":1943
 *         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":1944
 *         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":1945
 *         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":1946
 *         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":1947
 *         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":1948
 *         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":1949
 *         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":1950
 *         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":1951
 *         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":1952
 *         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":1953
 *         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":1954
 *         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":1955
 *         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":1956
 *         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":1957
 *         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":1958
 *         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":1959
 *         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":1960
 *         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":1961
 *         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, 1961, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1931
 * 
 *     # Execute the copy
 *     if peer:             # <<<<<<<<<<<<<<
 *         srcDev = m_global.getDevice(srcDevice)
 *         dstDev = m_global.getDevice(dstDevice)
 */
    goto __pyx_L4;
  }

  /* "cuda/_lib/ccudart/utils.pyx":1963
 *         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, 1963, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;
  }
  __pyx_L4:;

  /* "cuda/_lib/ccudart/utils.pyx":1964
 *     else:
 *         err = driverMemcpy3D(&cd, sid, async)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":1920
 * 
 * 
 * cdef cudaError_t memcpy3D(const cudaMemcpy3DParms *p, bool peer, int srcDevice, int dstDevice, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_MEMCPY3D_v2 cd
 *     cdef ccuda.CUDA_MEMCPY3D_PEER cdPeer
 */

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

/* "cuda/_lib/ccudart/utils.pyx":1967
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 */

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;
  __Pyx_TraceCall("copyToDevice", __pyx_f[0], 1967, 1, __PYX_ERR(0, 1967, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":1970
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 *     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":1971
 *     cdef cudaError_t err
 *     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, 1971, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":1973
 *     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":1972
 *     memset(&arrayState, 0, sizeof(arrayState))
 *     err = getLocalState(&arrayState, thisArray)
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 *     cdef size_t copied = 0
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":1974
 *     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":1975
 *         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":1977
 *     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) != 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)) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":1978
 * 
 *     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":1979
 *     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":1980
 *         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":1981
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = dstOffset
 *         cp.dstY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.srcArray      = arrayState.array
 */
    __pyx_v_cp.dstY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1983
 *         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":1984
 * 
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.srcY          = hOffset
 * 
 */
    __pyx_v_cp.srcXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":1985
 *         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":1987
 *         cp.srcY          = hOffset
 * 
 *         cp.Height        = 1             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = arrayState.widthInBytes - wOffset
 * 
 */
    __pyx_v_cp.Height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":1988
 * 
 *         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":1990
 *         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":1991
 * 
 *         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":1992
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height
 *         wOffset  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_wOffset = 0;

    /* "cuda/_lib/ccudart/utils.pyx":1994
 *         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, 1994, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":1995
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":1996
 *         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":1995
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

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

    /* "cuda/_lib/ccudart/utils.pyx":1999
 * 
 *     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":2000
 *     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":2001
 *         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":2002
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = dstOffset
 *         cp.dstY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.srcArray      = arrayState.array
 */
    __pyx_v_cp.dstY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":2004
 *         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":2005
 * 
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.srcY          = hOffset
 * 
 */
    __pyx_v_cp.srcXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":2006
 *         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":2008
 *         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, 2008, __pyx_L1_error)
    }
    __pyx_v_cp.Height = ((size_t)(((double)__pyx_t_4) / ((double)__pyx_v_arrayState.widthInBytes)));

    /* "cuda/_lib/ccudart/utils.pyx":2009
 * 
 *         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":2011
 *         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":2012
 * 
 *         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":2013
 *         copied  += cp.Height * cp.WidthInBytes
 *         hOffset += cp.Height
 *         wOffset  = 0             # <<<<<<<<<<<<<<
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 */
    __pyx_v_wOffset = 0;

    /* "cuda/_lib/ccudart/utils.pyx":2015
 *         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, 2015, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":2016
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":2017
 *         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":2016
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":1998
 *             return err
 * 
 *     if (count - copied >= arrayState.widthInBytes):             # <<<<<<<<<<<<<<
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>(dst + copied)
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  }

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

    /* "cuda/_lib/ccudart/utils.pyx":2020
 * 
 *     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":2021
 *     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":2022
 *         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":2023
 *         cp.dstPitch      = arrayState.widthInBytes
 *         cp.dstXInBytes   = dstOffset
 *         cp.dstY          = 0             # <<<<<<<<<<<<<<
 * 
 *         cp.srcArray      = arrayState.array
 */
    __pyx_v_cp.dstY = 0;

    /* "cuda/_lib/ccudart/utils.pyx":2025
 *         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":2026
 * 
 *         cp.srcArray      = arrayState.array
 *         cp.srcXInBytes   = wOffset             # <<<<<<<<<<<<<<
 *         cp.srcY          = hOffset
 * 
 */
    __pyx_v_cp.srcXInBytes = __pyx_v_wOffset;

    /* "cuda/_lib/ccudart/utils.pyx":2027
 *         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":2029
 *         cp.srcY          = hOffset
 * 
 *         cp.Height        = 1             # <<<<<<<<<<<<<<
 *         cp.WidthInBytes  = count - copied
 * 
 */
    __pyx_v_cp.Height = 1;

    /* "cuda/_lib/ccudart/utils.pyx":2030
 * 
 *         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":2032
 *         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, 2032, __pyx_L1_error)
    __pyx_v_err = __pyx_t_1;

    /* "cuda/_lib/ccudart/utils.pyx":2033
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_2 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":2034
 *         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":2033
 * 
 *         err = driverMemcpy3D(&cp, stream, async)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2019
 *             return err
 * 
 *     if (count - copied > 0):             # <<<<<<<<<<<<<<
 *         cp.dstDevice     = <ccuda.CUdeviceptr_v2>(dst + copied)
 *         cp.dstPitch      = arrayState.widthInBytes
 */
  }

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

  /* "cuda/_lib/ccudart/utils.pyx":1967
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaArrayLocalState arrayState
 *     cdef cudaError_t err
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2039
 * 
 * 
 * cdef cudaError_t copy1DConvertTo3DParams(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaMemcpy3DParms *p) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("copy1DConvertTo3DParams", __pyx_f[0], 2039, 1, __PYX_ERR(0, 2039, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2040
 * 
 * cdef cudaError_t copy1DConvertTo3DParams(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaMemcpy3DParms *p) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":2041
 * cdef cudaError_t copy1DConvertTo3DParams(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaMemcpy3DParms *p) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":2042
 *     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":2043
 *     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":2044
 *     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":2045
 *     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":2046
 *     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":2039
 * 
 * 
 * cdef cudaError_t copy1DConvertTo3DParams(void* dst, const void* src, size_t count, cudaMemcpyKind kind, cudaMemcpy3DParms *p) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.utils.copy1DConvertTo3DParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":2049
 * 
 * 
 * cdef void toDriverMemsetNodeParams(const cudaMemsetParams *pRuntimeParams, ccuda.CUDA_MEMSET_NODE_PARAMS *pDriverParams) 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;
  __Pyx_TraceCall("toDriverMemsetNodeParams", __pyx_f[0], 2049, 1, __PYX_ERR(0, 2049, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2050
 * 
 * cdef void toDriverMemsetNodeParams(const cudaMemsetParams *pRuntimeParams, ccuda.CUDA_MEMSET_NODE_PARAMS *pDriverParams) 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":2051
 * cdef void toDriverMemsetNodeParams(const cudaMemsetParams *pRuntimeParams, ccuda.CUDA_MEMSET_NODE_PARAMS *pDriverParams) 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":2052
 *     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":2053
 *     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":2054
 *     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":2055
 *     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":2049
 * 
 * 
 * cdef void toDriverMemsetNodeParams(const cudaMemsetParams *pRuntimeParams, ccuda.CUDA_MEMSET_NODE_PARAMS *pDriverParams) 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:;
  __Pyx_WriteUnraisable("cuda._lib.ccudart.utils.toDriverMemsetNodeParams", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
}

/* "cuda/_lib/ccudart/utils.pyx":2058
 * 
 * 
 * cdef cudaError_t getElementSize(size_t *elementSize, cudaArray_t array) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR driverDesc
 *     cdef cudaError_t err
 */

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;
  __Pyx_TraceCall("getElementSize", __pyx_f[0], 2058, 1, __PYX_ERR(0, 2058, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2061
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR driverDesc
 *     cdef cudaError_t err
 *     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, 2061, __pyx_L1_error)
  __pyx_v_err = ((cudaError_t)__pyx_t_1);

  /* "cuda/_lib/ccudart/utils.pyx":2062
 *     cdef cudaError_t err
 *     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) != 0);
  if (__pyx_t_2) {

    /* "cuda/_lib/ccudart/utils.pyx":2063
 *     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":2062
 *     cdef cudaError_t err
 *     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":2064
 *     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":2065
 *         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":2067
 *         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":2068
 *         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":2064
 *     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":2069
 *         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":2070
 *         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":2072
 *           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":2073
 *           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":2069
 *         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":2074
 *         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":2075
 *         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":2077
 *           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":2078
 *           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":2074
 *         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":2079
 *         elementSize[0] = driverDesc.NumChannels
 *         return cudaSuccess
 *     return cudaErrorInvalidChannelDescriptor             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaErrorInvalidChannelDescriptor;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2058
 * 
 * 
 * cdef cudaError_t getElementSize(size_t *elementSize, cudaArray_t array) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR driverDesc
 *     cdef cudaError_t err
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2082
 * 
 * 
 * cdef cudaError_t toDriverMemCopy3DParams(const cudaMemcpy3DParms *p, ccuda.CUDA_MEMCPY3D *cd) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("toDriverMemCopy3DParams", __pyx_f[0], 2082, 1, __PYX_ERR(0, 2082, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2083
 * 
 * cdef cudaError_t toDriverMemCopy3DParams(const cudaMemcpy3DParms *p, ccuda.CUDA_MEMCPY3D *cd) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":2084
 * cdef cudaError_t toDriverMemCopy3DParams(const cudaMemcpy3DParms *p, ccuda.CUDA_MEMCPY3D *cd) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":2085
 *     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":2086
 *     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":2087
 *     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":2088
 *     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":2089
 *     cd[0].Height = 1
 *     cd[0].Depth = 1
 *     cdef size_t srcElementSize = 0             # <<<<<<<<<<<<<<
 *     cdef size_t dstElementSize = 0
 *     cdef cudaError_t err
 */
  __pyx_v_srcElementSize = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2090
 *     cd[0].Depth = 1
 *     cdef size_t srcElementSize = 0
 *     cdef size_t dstElementSize = 0             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */
  __pyx_v_dstElementSize = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2098
 *     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":2099
 *     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":2100
 *     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":2101
 *     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":2103
 *     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) != 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) != 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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2104
 * 
 *     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":2103
 *     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":2106
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2107
 * 
 *     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":2108
 *     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":2106
 *         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":2109
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2110
 *         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":2111
 *     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":2109
 *         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":2112
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2113
 *         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":2114
 *     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":2112
 *         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":2115
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2116
 *         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":2117
 *     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":2115
 *         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":2118
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2119
 *         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":2120
 *     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":2118
 *         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":2122
 *         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":2124
 *         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":2125
 * 
 *     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, 2125, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

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

      /* "cuda/_lib/ccudart/utils.pyx":2127
 *         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":2126
 *     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":2128
 *         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, 2128, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2129
 *             return err
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         copyBlockExtent = srcBlockExtent
 */
    __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2130
 *         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":2129
 *             return err
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         copyBlockExtent = srcBlockExtent
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2131
 *         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":2124
 *         return cudaErrorInvalidMemcpyDirection
 * 
 *     if p[0].srcArray:             # <<<<<<<<<<<<<<
 *         err = getFormat(p[0].srcArray, numChannels, &srcFmt)
 *         if err != cudaSuccess:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2132
 *             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":2133
 *         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, 2133, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

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

      /* "cuda/_lib/ccudart/utils.pyx":2135
 *         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":2134
 *     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":2136
 *         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, 2136, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2137
 *             return err
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         if not p[0].srcArray:
 */
    __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2138
 *         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":2137
 *             return err
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         if not p[0].srcArray:
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2139
 *         if err != cudaSuccess:
 *             return err
 *         if not p[0].srcArray:             # <<<<<<<<<<<<<<
 *             copyBlockExtent = dstBlockExtent
 * 
 */
    __pyx_t_1 = ((!((__pyx_v_p[0]).srcArray != 0)) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2140
 *             return err
 *         if not p[0].srcArray:
 *             copyBlockExtent = dstBlockExtent             # <<<<<<<<<<<<<<
 * 
 *     if p[0].srcArray:
 */
      __pyx_v_copyBlockExtent = __pyx_v_dstBlockExtent;

      /* "cuda/_lib/ccudart/utils.pyx":2139
 *         if err != cudaSuccess:
 *             return err
 *         if not p[0].srcArray:             # <<<<<<<<<<<<<<
 *             copyBlockExtent = dstBlockExtent
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2132
 *             return err
 *         copyBlockExtent = srcBlockExtent
 *     if p[0].dstArray:             # <<<<<<<<<<<<<<
 *         err = getFormat(p[0].dstArray, numChannels, &dstFmt)
 *         if err != cudaSuccess:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2142
 *             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":2143
 * 
 *     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) != 0);
    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) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L17_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2144
 *     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":2143
 * 
 *     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":2145
 *         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":2146
 *             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":2147
 *         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, 2147, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

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

      /* "cuda/_lib/ccudart/utils.pyx":2149
 *         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":2148
 *         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":2142
 *             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":2151
 *             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) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2152
 *     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":2151
 *             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":2153
 *         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) != 0);
    if (!__pyx_t_2) {
    } else {
      goto __pyx_L23_next_and;
    }
    __pyx_t_2 = (((__pyx_v_p[0]).extent.depth > 1) != 0);
    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) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L22_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2154
 *             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":2153
 *         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":2155
 *         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) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2156
 *             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":2157
 *         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) != 0);
      if (__pyx_t_1) {

        /* "cuda/_lib/ccudart/utils.pyx":2158
 *             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":2157
 *         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":2155
 *         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":2160
 *                 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) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2161
 * 
 *         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":2160
 *                 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":2163
 *             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":2164
 *         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":2165
 *             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":2167
 *         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":2168
 * 
 *     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) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2169
 *     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":2168
 * 
 *     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":2170
 *         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":2171
 *             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":2172
 *         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, 2172, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

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

      /* "cuda/_lib/ccudart/utils.pyx":2174
 *         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":2173
 *         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":2167
 *         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":2176
 *             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) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2177
 *     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":2176
 *             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":2178
 *         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) != 0);
    if (!__pyx_t_2) {
    } else {
      goto __pyx_L34_next_and;
    }
    __pyx_t_2 = (((__pyx_v_p[0]).extent.depth > 1) != 0);
    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) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L33_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2179
 *             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":2178
 *         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":2180
 *         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) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2181
 *             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":2182
 *         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) != 0);
      if (__pyx_t_1) {

        /* "cuda/_lib/ccudart/utils.pyx":2183
 *             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":2182
 *         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":2180
 *         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":2185
 *                 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) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2186
 * 
 *         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":2185
 *                 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":2188
 *             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":2189
 *         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":2190
 *             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":2192
 *         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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L40_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2193
 * 
 *     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":2192
 *         cd[0].dstHeight = p[0].dstPtr.ysize
 * 
 *     if srcElementSize and dstElementSize and srcElementSize != dstElementSize:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2195
 *         return cudaErrorInvalidValue
 * 
 *     cdef size_t elementSize = sizeof(char)             # <<<<<<<<<<<<<<
 *     if srcElementSize:
 *         elementSize = srcElementSize
 */
  __pyx_v_elementSize = (sizeof(char));

  /* "cuda/_lib/ccudart/utils.pyx":2196
 * 
 *     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":2197
 *     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":2196
 * 
 *     cdef size_t elementSize = sizeof(char)
 *     if srcElementSize:             # <<<<<<<<<<<<<<
 *         elementSize = srcElementSize
 *     if dstElementSize:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2198
 *     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":2199
 *         elementSize = srcElementSize
 *     if dstElementSize:
 *         elementSize = dstElementSize             # <<<<<<<<<<<<<<
 *     srcElementSize = elementSize
 *     dstElementSize = elementSize
 */
    __pyx_v_elementSize = __pyx_v_dstElementSize;

    /* "cuda/_lib/ccudart/utils.pyx":2198
 *     if srcElementSize:
 *         elementSize = srcElementSize
 *     if dstElementSize:             # <<<<<<<<<<<<<<
 *         elementSize = dstElementSize
 *     srcElementSize = elementSize
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2200
 *     if dstElementSize:
 *         elementSize = dstElementSize
 *     srcElementSize = elementSize             # <<<<<<<<<<<<<<
 *     dstElementSize = elementSize
 * 
 */
  __pyx_v_srcElementSize = __pyx_v_elementSize;

  /* "cuda/_lib/ccudart/utils.pyx":2201
 *         elementSize = dstElementSize
 *     srcElementSize = elementSize
 *     dstElementSize = elementSize             # <<<<<<<<<<<<<<
 * 
 *     # Determine the extent of the transfer
 */
  __pyx_v_dstElementSize = __pyx_v_elementSize;

  /* "cuda/_lib/ccudart/utils.pyx":2204
 * 
 *     # 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, 2204, __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":2205
 *     # 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, 2205, __pyx_L1_error)
  }
  (__pyx_v_cd[0]).Height = ((size_t)(((double)__pyx_t_5) / ((double)__pyx_v_copyBlockExtent.height)));

  /* "cuda/_lib/ccudart/utils.pyx":2206
 *     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":2209
 * 
 *     # 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, 2209, __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":2210
 *     # 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, 2210, __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":2211
 *     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":2214
 * 
 *     # 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, 2214, __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":2215
 *     # 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, 2215, __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":2216
 *     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":2218
 *     cd[0].dstZ         = p[0].dstPos.z
 * 
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2082
 * 
 * 
 * cdef cudaError_t toDriverMemCopy3DParams(const cudaMemcpy3DParms *p, ccuda.CUDA_MEMCPY3D *cd) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.utils.toDriverMemCopy3DParams", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":2221
 * 
 * 
 * cdef cudaError_t mallocArray(cudaArray_t *arrayPtr, const cudaChannelFormatDesc *desc,             # <<<<<<<<<<<<<<
 *         size_t depth, size_t height, size_t width, int corr2D, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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;
  __Pyx_TraceCall("mallocArray", __pyx_f[0], 2221, 1, __PYX_ERR(0, 2221, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2223
 * cdef cudaError_t mallocArray(cudaArray_t *arrayPtr, const cudaChannelFormatDesc *desc,
 *         size_t depth, size_t height, size_t width, int corr2D, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if arrayPtr == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_1 = ((__pyx_v_arrayPtr == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2224
 *         size_t depth, size_t height, size_t width, int corr2D, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if arrayPtr == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUarray array = NULL
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

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

  /* "cuda/_lib/ccudart/utils.pyx":2226
 *         return cudaErrorInvalidValue
 * 
 *     cdef ccuda.CUarray array = NULL             # <<<<<<<<<<<<<<
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 ad
 *     cdef cudaError_t err
 */
  __pyx_v_array = NULL;

  /* "cuda/_lib/ccudart/utils.pyx":2229
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 ad
 *     cdef cudaError_t err
 *     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":2230
 *     cdef cudaError_t err
 *     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) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2231
 *     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) != 0);
  if (!__pyx_t_2) {
    goto __pyx_L7_next_or;
  } else {
  }
  __pyx_t_2 = ((__pyx_v_depth != 0) != 0);
  if (!__pyx_t_2) {
    goto __pyx_L7_next_or;
  } else {
  }
  __pyx_t_2 = ((!((__pyx_v_flags & __pyx_e_4cuda_7ccudart_cudaArrayLayered) != 0)) != 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":2232
 *     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) != 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":2233
 *         ((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)) != 0);
  if (!__pyx_t_2) {
    goto __pyx_L12_next_or;
  } else {
  }
  __pyx_t_2 = ((__pyx_v_width != __pyx_v_height) != 0);
  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);
  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":2234
 *         ((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) != 0);
  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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":2230
 *     cdef cudaError_t err
 *     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":2235
 *         ((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":2230
 *     cdef cudaError_t err
 *     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":2237
 *         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":2238
 *     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, 2238, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

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

      /* "cuda/_lib/ccudart/utils.pyx":2240
 *         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":2239
 *         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":2241
 *         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":2242
 *             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":2243
 *         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":2244
 *         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":2245
 *         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, 2245, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_4);

    /* "cuda/_lib/ccudart/utils.pyx":2246
 *         ad.Flags  = flags
 *         err = <cudaError_t>ccuda._cuArray3DCreate_v2(&array, &ad)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2247
 *         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":2246
 *         ad.Flags  = flags
 *         err = <cudaError_t>ccuda._cuArray3DCreate_v2(&array, &ad)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2249
 *             return err
 * 
 *         arrayPtr[0] = <cudaArray_t>array             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
    (__pyx_v_arrayPtr[0]) = ((cudaArray_t)__pyx_v_array);
  }

  /* "cuda/_lib/ccudart/utils.pyx":2250
 * 
 *         arrayPtr[0] = <cudaArray_t>array
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2221
 * 
 * 
 * cdef cudaError_t mallocArray(cudaArray_t *arrayPtr, const cudaChannelFormatDesc *desc,             # <<<<<<<<<<<<<<
 *         size_t depth, size_t height, size_t width, int corr2D, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if arrayPtr == NULL:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2253
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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;
  __Pyx_TraceCall("memcpy2DToArray", __pyx_f[0], 2253, 1, __PYX_ERR(0, 2253, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2256
 *                                  size_t spitch, size_t width, size_t height, cudaMemcpyKind kind,
 *                                  cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if height > 1 and width > spitch:
 */
  __pyx_t_2 = ((__pyx_v_width == 0) != 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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2257
 *                                  cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":2256
 *                                  size_t spitch, size_t width, size_t height, cudaMemcpyKind kind,
 *                                  cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if height > 1 and width > spitch:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2258
 *     if width == 0 or height == 0:
 *         return cudaSuccess
 *     if height > 1 and width > spitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidPitchValue
 * 
 */
  __pyx_t_2 = ((__pyx_v_height > 1) != 0);
  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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2259
 *         return cudaSuccess
 *     if height > 1 and width > spitch:
 *         return cudaErrorInvalidPitchValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = cudaErrorInvalidPitchValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2258
 *     if width == 0 or height == 0:
 *         return cudaSuccess
 *     if height > 1 and width > spitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidPitchValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2262
 * 
 *     cdef cudaError_t err
 *     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":2263
 *     cdef cudaError_t err
 *     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, 2263, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2262
 * 
 *     cdef cudaError_t err
 *     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":2265
 *        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, 2265, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2264
 *     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":2267
 *        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, 2267, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2266
 *     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":2269
 *        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":2270
 *     else:
 *         return cudaErrorInvalidMemcpyDirection
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2253
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2273
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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;
  __Pyx_TraceCall("memcpy2DPtr", __pyx_f[0], 2273, 1, __PYX_ERR(0, 2273, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2276
 *                              size_t height, cudaMemcpyKind kind,
 *                              cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if height > 1 and width > dpitch:
 */
  __pyx_t_2 = ((__pyx_v_width == 0) != 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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2277
 *                              cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":2276
 *                              size_t height, cudaMemcpyKind kind,
 *                              cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if height > 1 and width > dpitch:
 */
  }

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

    /* "cuda/_lib/ccudart/utils.pyx":2279
 *         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":2278
 *     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":2280
 *     if height > 1 and width > dpitch:
 *         return cudaErrorInvalidPitchValue
 *     if height > 1 and width > spitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidPitchValue
 * 
 */
  __pyx_t_2 = ((__pyx_v_height > 1) != 0);
  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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L10_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2281
 *         return cudaErrorInvalidPitchValue
 *     if height > 1 and width > spitch:
 *         return cudaErrorInvalidPitchValue             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = cudaErrorInvalidPitchValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2280
 *     if height > 1 and width > dpitch:
 *         return cudaErrorInvalidPitchValue
 *     if height > 1 and width > spitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidPitchValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2285
 *     cdef cudaError_t err
 *     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":2287
 *     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":2288
 * 
 *     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":2289
 *     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":2290
 *         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":2287
 *     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":2292
 *         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":2293
 *     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":2294
 *         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":2291
 *         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":2296
 *         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":2297
 *     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":2298
 *         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":2295
 *         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":2300
 *         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":2301
 *     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":2302
 *         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":2299
 *         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":2304
 *         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":2305
 *     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":2306
 *         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":2303
 *         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":2308
 *         cp.srcDevice = <ccuda.CUdeviceptr_v2>src
 *     else:
 *         err = cudaErrorInvalidMemcpyDirection             # <<<<<<<<<<<<<<
 * 
 *     if err != cudaSuccess:
 */
    __pyx_v_err = cudaErrorInvalidMemcpyDirection;
    break;
  }

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

    /* "cuda/_lib/ccudart/utils.pyx":2311
 * 
 *     if err != cudaSuccess:
 *         return err             # <<<<<<<<<<<<<<
 * 
 *     cp.dstPitch      = dpitch
 */
    __pyx_r = __pyx_v_err;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2310
 *         err = cudaErrorInvalidMemcpyDirection
 * 
 *     if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *         return err
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2313
 *         return err
 * 
 *     cp.dstPitch      = dpitch             # <<<<<<<<<<<<<<
 *     cp.srcPitch      = spitch
 *     cp.WidthInBytes  = width
 */
  __pyx_v_cp.dstPitch = __pyx_v_dpitch;

  /* "cuda/_lib/ccudart/utils.pyx":2314
 * 
 *     cp.dstPitch      = dpitch
 *     cp.srcPitch      = spitch             # <<<<<<<<<<<<<<
 *     cp.WidthInBytes  = width
 *     cp.Height        = height
 */
  __pyx_v_cp.srcPitch = __pyx_v_spitch;

  /* "cuda/_lib/ccudart/utils.pyx":2315
 *     cp.dstPitch      = dpitch
 *     cp.srcPitch      = spitch
 *     cp.WidthInBytes  = width             # <<<<<<<<<<<<<<
 *     cp.Height        = height
 * 
 */
  __pyx_v_cp.WidthInBytes = __pyx_v_width;

  /* "cuda/_lib/ccudart/utils.pyx":2316
 *     cp.srcPitch      = spitch
 *     cp.WidthInBytes  = width
 *     cp.Height        = height             # <<<<<<<<<<<<<<
 * 
 *     if async:
 */
  __pyx_v_cp.Height = __pyx_v_height;

  /* "cuda/_lib/ccudart/utils.pyx":2318
 *     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":2319
 * 
 *     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, 2319, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":2318
 *     cp.Height        = height
 * 
 *     if async:             # <<<<<<<<<<<<<<
 *         err = <cudaError_t>ccuda._cuMemcpy2DAsync_v2(&cp, sid)
 *     else:
 */
    goto __pyx_L13;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2321
 *         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, 2321, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);
  }
  __pyx_L13:;

  /* "cuda/_lib/ccudart/utils.pyx":2322
 *     else:
 *         err = <cudaError_t>ccuda._cuMemcpy2DUnaligned_v2(&cp)
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2273
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2325
 * 
 * 
 * cdef cudaError_t memcpyDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("memcpyDispatch", __pyx_f[0], 2325, 1, __PYX_ERR(0, 2325, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2326
 * 
 * cdef cudaError_t memcpyDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  __pyx_t_1 = ((__pyx_v_size == 0) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2327
 * cdef cudaError_t memcpyDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if size == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     cdef cudaError_t err
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2326
 * 
 * cdef cudaError_t memcpyDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2330
 * 
 *     cdef cudaError_t err
 *     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":2331
 *     cdef cudaError_t err
 *     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, 2331, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2330
 * 
 *     cdef cudaError_t err
 *     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":2333
 *         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, 2333, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":2332
 *     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":2335
 *         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, 2335, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":2334
 *     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":2337
 *         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, 2337, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":2336
 *     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":2339
 *         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, 2339, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_3);

    /* "cuda/_lib/ccudart/utils.pyx":2338
 *     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":2341
 *         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":2325
 * 
 * 
 * cdef cudaError_t memcpyDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if size == 0:
 *         return cudaSuccess
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2344
 * 
 * 
 * cdef cudaError_t mallocHost(size_t size, void **mem, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("mallocHost", __pyx_f[0], 2344, 1, __PYX_ERR(0, 2344, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2345
 * 
 * cdef cudaError_t mallocHost(size_t size, void **mem, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         if mem == NULL:
 *             return cudaErrorInvalidValue
 */
  __pyx_t_1 = ((__pyx_v_size == 0) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2346
 * cdef cudaError_t mallocHost(size_t size, void **mem, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if size == 0:
 *         if mem == NULL:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         mem[0] = NULL
 */
    __pyx_t_1 = ((__pyx_v_mem == NULL) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2347
 *     if size == 0:
 *         if mem == NULL:
 *             return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *         mem[0] = NULL
 *         return cudaSuccess
 */
      __pyx_r = cudaErrorInvalidValue;
      goto __pyx_L0;

      /* "cuda/_lib/ccudart/utils.pyx":2346
 * cdef cudaError_t mallocHost(size_t size, void **mem, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if size == 0:
 *         if mem == NULL:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         mem[0] = NULL
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2348
 *         if mem == NULL:
 *             return cudaErrorInvalidValue
 *         mem[0] = NULL             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     else:
 */
    (__pyx_v_mem[0]) = NULL;

    /* "cuda/_lib/ccudart/utils.pyx":2349
 *             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":2345
 * 
 * cdef cudaError_t mallocHost(size_t size, void **mem, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         if mem == NULL:
 *             return cudaErrorInvalidValue
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2351
 *         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, 2351, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_2);
    goto __pyx_L0;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2344
 * 
 * 
 * cdef cudaError_t mallocHost(size_t size, void **mem, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if size == 0:
 *         if mem == NULL:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2354
 * 
 * 
 * cdef cudaError_t mallocPitch(size_t width, size_t height, size_t depth, void **mem, size_t *pitch) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("mallocPitch", __pyx_f[0], 2354, 1, __PYX_ERR(0, 2354, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2355
 * 
 * cdef cudaError_t mallocPitch(size_t width, size_t height, size_t depth, void **mem, size_t *pitch) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     height *= depth             # <<<<<<<<<<<<<<
 * 
 *     if width == 0 or height == 0:
 */
  __pyx_v_height = (__pyx_v_height * __pyx_v_depth);

  /* "cuda/_lib/ccudart/utils.pyx":2357
 *     height *= depth
 * 
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         if mem == NULL or pitch == NULL:
 *             return cudaErrorInvalidValue
 */
  __pyx_t_2 = ((__pyx_v_width == 0) != 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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2358
 * 
 *     if width == 0 or height == 0:
 *         if mem == NULL or pitch == NULL:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         mem[0]   = NULL
 */
    __pyx_t_2 = ((__pyx_v_mem == NULL) != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_pitch == NULL) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2359
 *     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":2358
 * 
 *     if width == 0 or height == 0:
 *         if mem == NULL or pitch == NULL:             # <<<<<<<<<<<<<<
 *             return cudaErrorInvalidValue
 *         mem[0]   = NULL
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2360
 *         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":2361
 *             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":2357
 *     height *= depth
 * 
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         if mem == NULL or pitch == NULL:
 *             return cudaErrorInvalidValue
 */
    goto __pyx_L3;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2363
 *         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, 2363, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_3);
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "cuda/_lib/ccudart/utils.pyx":2364
 *     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":2354
 * 
 * 
 * cdef cudaError_t mallocPitch(size_t width, size_t height, size_t depth, void **mem, size_t *pitch) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     height *= depth
 * 
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2367
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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;
  __Pyx_TraceCall("mallocMipmappedArray", __pyx_f[0], 2367, 1, __PYX_ERR(0, 2367, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2369
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if mipmappedArray == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_1 = ((__pyx_v_mipmappedArray == NULL) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2370
 *                                       size_t depth, size_t height, size_t width, unsigned int numLevels, unsigned int flags) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if mipmappedArray == NULL:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 * 
 *     cdef ccuda.CUmipmappedArray mipmap = NULL
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2369
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if mipmappedArray == NULL:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2372
 *         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":2374
 *     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":2376
 *     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":2377
 * 
 *     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) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2378
 *     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) != 0);
  if (!__pyx_t_2) {
    goto __pyx_L7_next_or;
  } else {
  }
  __pyx_t_2 = ((__pyx_v_depth != 0) != 0);
  if (!__pyx_t_2) {
    goto __pyx_L7_next_or;
  } else {
  }
  __pyx_t_2 = ((!((__pyx_v_flags & __pyx_e_4cuda_7ccudart_cudaArrayLayered) != 0)) != 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":2379
 *     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) != 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":2380
 *         ((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)) != 0);
  if (!__pyx_t_2) {
    goto __pyx_L12_next_or;
  } else {
  }
  __pyx_t_2 = ((__pyx_v_width != __pyx_v_height) != 0);
  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);
  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":2381
 *         ((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) != 0);
  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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":2377
 * 
 *     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":2382
 *         ((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":2377
 * 
 *     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":2384
 *         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, 2384, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

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

      /* "cuda/_lib/ccudart/utils.pyx":2386
 *         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":2385
 *     else:
 *         err = getDescInfo(desc, <int*>&ad.NumChannels, &ad.Format)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         ad.Height = <unsigned int>height
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2387
 *         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":2388
 *             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":2389
 *         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":2390
 *         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":2391
 *         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, 2391, __pyx_L1_error)
    __pyx_v_err = ((cudaError_t)__pyx_t_4);

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

      /* "cuda/_lib/ccudart/utils.pyx":2393
 *         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":2392
 *         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":2394
 *         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":2395
 *             return err
 *         mipmappedArray[0] = <cudaMipmappedArray_t>mipmap
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2367
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if mipmappedArray == NULL:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2398
 * 
 * 
 * cdef cudaError_t memcpyAsyncDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("memcpyAsyncDispatch", __pyx_f[0], 2398, 1, __PYX_ERR(0, 2398, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2399
 * 
 * cdef cudaError_t memcpyAsyncDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 */
  __pyx_t_1 = ((__pyx_v_size == 0) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2400
 * cdef cudaError_t memcpyAsyncDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":2399
 * 
 * cdef cudaError_t memcpyAsyncDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 */
  }

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

    /* "cuda/_lib/ccudart/utils.pyx":2402
 *         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, 2402, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2401
 *     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":2403
 *     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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2404
 *         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, 2404, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_3);
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2403
 *     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":2405
 *     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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2406
 *         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, 2406, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_3);
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2405
 *     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":2407
 *     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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2408
 *         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, 2408, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_3);
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2407
 *     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":2409
 *     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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2410
 *         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, 2410, __pyx_L1_error)
    __pyx_r = ((cudaError_t)__pyx_t_3);
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2409
 *     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":2411
 *     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":2398
 * 
 * 
 * cdef cudaError_t memcpyAsyncDispatch(void *dst, const void *src, size_t size, cudaMemcpyKind kind, cudaStream_t stream) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if size == 0:
 *         return cudaSuccess
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2414
 * 
 * 
 * cdef cudaError_t toCudartMemCopy3DParams(const ccuda.CUDA_MEMCPY3D_v2 *cd, cudaMemcpy3DParms *p) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("toCudartMemCopy3DParams", __pyx_f[0], 2414, 1, __PYX_ERR(0, 2414, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2420
 *     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":2421
 *     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":2422
 *     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":2423
 *     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":2425
 *     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":2426
 * 
 *     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":2427
 *     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":2429
 *     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) != 0);
  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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2430
 * 
 *     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":2432
 *         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":2433
 * 
 *         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":2434
 *         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":2436
 *         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":2437
 * 
 *         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":2438
 *         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":2429
 *     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":2439
 *         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) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2440
 *         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) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2441
 *     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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":2439
 *         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":2442
 *             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":2444
 *         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":2445
 * 
 *         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":2446
 *         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":2448
 *         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) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2449
 * 
 *         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":2448
 *         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":2451
 *             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":2452
 *         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":2453
 *             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":2439
 *         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":2454
 *             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) != 0);
  if (!__pyx_t_2) {
  } else {
    goto __pyx_L11_next_and;
  }
  __pyx_t_2 = (((__pyx_v_cd[0]).srcMemoryType == CU_MEMORYTYPE_ARRAY) != 0);
  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":2455
 *             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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L10_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":2454
 *             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":2456
 *     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":2458
 *         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) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2459
 * 
 *         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":2458
 *         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":2461
 *             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":2462
 *         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":2463
 *             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":2465
 *             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":2466
 * 
 *         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":2467
 *         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":2454
 *             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":2468
 *         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) != 0);
  if (!__pyx_t_2) {
  } else {
    goto __pyx_L15_next_and;
  }
  __pyx_t_2 = (((__pyx_v_cd[0]).srcMemoryType == CU_MEMORYTYPE_ARRAY) != 0);
  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":2469
 *         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) != 0);
  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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L14_bool_binop_done:;

  /* "cuda/_lib/ccudart/utils.pyx":2468
 *         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":2470
 *     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":2472
 *         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) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2473
 * 
 *         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":2472
 *         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":2475
 *             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":2476
 *         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":2477
 *             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":2479
 *             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) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2480
 * 
 *         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":2479
 *             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":2482
 *             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":2483
 *         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":2484
 *             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":2468
 *         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":2485
 *             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) != 0);
  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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L20_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2486
 *             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":2488
 *         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":2489
 * 
 *         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":2490
 *         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":2492
 *         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":2493
 * 
 *         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":2494
 *         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":2485
 *             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":2495
 *         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) != 0);
  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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L22_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2496
 *         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":2498
 *         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":2499
 * 
 *         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":2500
 *         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":2502
 *         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":2495
 *         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":2503
 * 
 *         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) != 0);
  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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L24_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2504
 *         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":2506
 *         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":2508
 *         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":2509
 * 
 *         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":2510
 *         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":2503
 * 
 *         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":2512
 *         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":2514
 *         return cudaErrorUnknown
 * 
 *     cdef size_t srcElementSize = 0             # <<<<<<<<<<<<<<
 *     cdef size_t dstElementSize = 0
 *     cdef cudaError_t err
 */
  __pyx_v_srcElementSize = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2515
 * 
 *     cdef size_t srcElementSize = 0
 *     cdef size_t dstElementSize = 0             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err
 * 
 */
  __pyx_v_dstElementSize = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2518
 *     cdef cudaError_t err
 * 
 *     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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2519
 * 
 *     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, 2519, __pyx_L1_error)
    __pyx_v_err = __pyx_t_5;

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

      /* "cuda/_lib/ccudart/utils.pyx":2521
 *         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":2520
 *     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":2522
 *         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, 2522, __pyx_L1_error)
    __pyx_v_err = __pyx_t_5;

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

      /* "cuda/_lib/ccudart/utils.pyx":2524
 *         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":2523
 *             return err
 *         err = getArrayBlockExtent(&srcBlockExtent, srcFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getElementSize(&srcElementSize, <cudaArray_t>cd[0].srcArray)
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2525
 *         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, 2525, __pyx_L1_error)
    __pyx_v_err = __pyx_t_5;

    /* "cuda/_lib/ccudart/utils.pyx":2526
 *             return err
 *         err = getElementSize(&srcElementSize, <cudaArray_t>cd[0].srcArray)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         copyBlockExtent = srcBlockExtent
 */
    __pyx_t_1 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2527
 *         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":2526
 *             return err
 *         err = getElementSize(&srcElementSize, <cudaArray_t>cd[0].srcArray)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         copyBlockExtent = srcBlockExtent
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2528
 *         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":2518
 *     cdef cudaError_t err
 * 
 *     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":2530
 *         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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2531
 * 
 *     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, 2531, __pyx_L1_error)
    __pyx_v_err = __pyx_t_5;

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

      /* "cuda/_lib/ccudart/utils.pyx":2533
 *         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":2532
 *     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":2534
 *         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, 2534, __pyx_L1_error)
    __pyx_v_err = __pyx_t_5;

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

      /* "cuda/_lib/ccudart/utils.pyx":2536
 *         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":2535
 *             return err
 *         err = getArrayBlockExtent(&dstBlockExtent, dstFmt)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 *         err = getElementSize(&dstElementSize, <cudaArray_t>cd[0].dstArray)
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2537
 *         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, 2537, __pyx_L1_error)
    __pyx_v_err = __pyx_t_5;

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

      /* "cuda/_lib/ccudart/utils.pyx":2539
 *         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":2538
 *             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":2540
 *         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) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2541
 *             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":2540
 *         if err != cudaSuccess:
 *             return err
 *         if cd[0].srcMemoryType != ccuda.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY:             # <<<<<<<<<<<<<<
 *             copyBlockExtent = dstBlockExtent
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2530
 *         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":2543
 *             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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L36_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2544
 * 
 *     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":2543
 *             copyBlockExtent = dstBlockExtent
 * 
 *     if (srcElementSize and dstElementSize and srcElementSize != dstElementSize):             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2546
 *         return cudaErrorInvalidValue
 * 
 *     cdef size_t elementSize = sizeof(char)             # <<<<<<<<<<<<<<
 *     if (srcElementSize):
 *         elementSize = srcElementSize
 */
  __pyx_v_elementSize = (sizeof(char));

  /* "cuda/_lib/ccudart/utils.pyx":2547
 * 
 *     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":2548
 *     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":2547
 * 
 *     cdef size_t elementSize = sizeof(char)
 *     if (srcElementSize):             # <<<<<<<<<<<<<<
 *         elementSize = srcElementSize
 *     if (dstElementSize):
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2549
 *     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":2550
 *         elementSize = srcElementSize
 *     if (dstElementSize):
 *         elementSize = dstElementSize             # <<<<<<<<<<<<<<
 *     srcElementSize = elementSize
 *     dstElementSize = elementSize
 */
    __pyx_v_elementSize = __pyx_v_dstElementSize;

    /* "cuda/_lib/ccudart/utils.pyx":2549
 *     if (srcElementSize):
 *         elementSize = srcElementSize
 *     if (dstElementSize):             # <<<<<<<<<<<<<<
 *         elementSize = dstElementSize
 *     srcElementSize = elementSize
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2551
 *     if (dstElementSize):
 *         elementSize = dstElementSize
 *     srcElementSize = elementSize             # <<<<<<<<<<<<<<
 *     dstElementSize = elementSize
 * 
 */
  __pyx_v_srcElementSize = __pyx_v_elementSize;

  /* "cuda/_lib/ccudart/utils.pyx":2552
 *         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":2554
 *     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, 2554, __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":2555
 * 
 *     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":2556
 *     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":2558
 *     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, 2558, __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":2559
 * 
 *     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":2560
 *     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":2562
 *     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, 2562, __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":2563
 * 
 *     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":2564
 *     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":2565
 *     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":2414
 * 
 * 
 * cdef cudaError_t toCudartMemCopy3DParams(const ccuda.CUDA_MEMCPY3D_v2 *cd, cudaMemcpy3DParms *p) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaExtent srcBlockExtent
 *     cdef cudaExtent dstBlockExtent
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2568
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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;
  __Pyx_TraceCall("memcpy2DFromArray", __pyx_f[0], 2568, 1, __PYX_ERR(0, 2568, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2572
 *         cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if height > 1 and width > dpitch:
 */
  __pyx_t_2 = ((__pyx_v_width == 0) != 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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2573
 *     cdef cudaError_t err
 *     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":2572
 *         cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if height > 1 and width > dpitch:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2574
 *     if width == 0 or height == 0:
 *         return cudaSuccess
 *     if height > 1 and width > dpitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidPitchValue
 * 
 */
  __pyx_t_2 = ((__pyx_v_height > 1) != 0);
  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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2575
 *         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":2574
 *     if width == 0 or height == 0:
 *         return cudaSuccess
 *     if height > 1 and width > dpitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidPitchValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2577
 *         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":2578
 * 
 *     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, 2578, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2577
 *         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":2580
 *         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, 2580, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2579
 *     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":2582
 *         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, 2582, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2581
 *     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":2584
 *         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":2585
 *     else:
 *         return cudaErrorInvalidMemcpyDirection
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2568
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2588
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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;
  __Pyx_TraceCall("memcpy2DArrayToArray", __pyx_f[0], 2588, 1, __PYX_ERR(0, 2588, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2591
 *                                       cudaArray_const_t src, size_t hOffsetSrc, size_t wOffsetSrc,
 *                                       size_t width, size_t height, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if kind != cudaMemcpyKind.cudaMemcpyDeviceToDevice and kind != cudaMemcpyKind.cudaMemcpyDefault:
 */
  __pyx_t_2 = ((__pyx_v_width == 0) != 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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2592
 *                                       size_t width, size_t height, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":2591
 *                                       cudaArray_const_t src, size_t hOffsetSrc, size_t wOffsetSrc,
 *                                       size_t width, size_t height, cudaMemcpyKind kind) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if width == 0 or height == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 *     if kind != cudaMemcpyKind.cudaMemcpyDeviceToDevice and kind != cudaMemcpyKind.cudaMemcpyDefault:
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2593
 *     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":2594
 *         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":2593
 *     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":2595
 *     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, 2595, __pyx_L1_error)
  __pyx_r = __pyx_t_3;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2588
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2598
 * 
 * 
 * cdef cudaError_t memset3DPtr(cudaPitchedPtr p, int val, cudaExtent e, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("memset3DPtr", __pyx_f[0], 2598, 1, __PYX_ERR(0, 2598, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2599
 * 
 * cdef cudaError_t memset3DPtr(cudaPitchedPtr p, int val, cudaExtent e, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if e.width == 0 or e.height == 0 or e.depth == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  __pyx_t_2 = ((__pyx_v_e.width == 0) != 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) != 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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2600
 * cdef cudaError_t memset3DPtr(cudaPitchedPtr p, int val, cudaExtent e, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":2599
 * 
 * cdef cudaError_t memset3DPtr(cudaPitchedPtr p, int val, cudaExtent e, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if e.width == 0 or e.height == 0 or e.depth == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2602
 *         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) != 0);
  if (!__pyx_t_2) {
  } else {
    goto __pyx_L9_next_and;
  }
  __pyx_t_2 = ((__pyx_v_e.depth > 1) != 0);
  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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2603
 * 
 *     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":2602
 *         return cudaSuccess
 * 
 *     if (e.height > 1 or e.depth > 1) and e.width > p.pitch:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2605
 *         return cudaErrorInvalidValue
 * 
 *     if e.depth > 0 and e.height > p.ysize:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  __pyx_t_2 = ((__pyx_v_e.depth > 0) != 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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L12_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2606
 * 
 *     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":2605
 *         return cudaErrorInvalidValue
 * 
 *     if e.depth > 0 and e.height > p.ysize:             # <<<<<<<<<<<<<<
 *         return cudaErrorInvalidValue
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2608
 *         return cudaErrorInvalidValue
 * 
 *     cdef char *ptr = <char*>p.ptr             # <<<<<<<<<<<<<<
 *     cdef size_t d
 *     cdef cudaError_t err
 */
  __pyx_v_ptr = ((char *)__pyx_v_p.ptr);

  /* "cuda/_lib/ccudart/utils.pyx":2612
 *     cdef cudaError_t err
 * 
 *     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) != 0);
  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) != 0);
  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) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2613
 * 
 *     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, 2613, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2612
 *     cdef cudaError_t err
 * 
 *     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":2614
 *     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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2615
 *         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, 2615, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2614
 *     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":2617
 *         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":2618
 *     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) != 0);
      if (!__pyx_t_1) break;

      /* "cuda/_lib/ccudart/utils.pyx":2619
 *         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, 2619, __pyx_L1_error)
      __pyx_v_err = __pyx_t_3;

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

        /* "cuda/_lib/ccudart/utils.pyx":2621
 *             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":2620
 *         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":2622
 *             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":2623
 *                 return err
 *             ptr += p.pitch * p.ysize
 *             d += 1             # <<<<<<<<<<<<<<
 *     return cudaSuccess
 * 
 */
      __pyx_v_d = (__pyx_v_d + 1);
    }
  }

  /* "cuda/_lib/ccudart/utils.pyx":2624
 *             ptr += p.pitch * p.ysize
 *             d += 1
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2598
 * 
 * 
 * cdef cudaError_t memset3DPtr(cudaPitchedPtr p, int val, cudaExtent e, cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     if e.width == 0 or e.height == 0 or e.depth == 0:
 *         return cudaSuccess
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2627
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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;
  __Pyx_TraceCall("memcpyToArray", __pyx_f[0], 2627, 1, __PYX_ERR(0, 2627, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2630
 *                                size_t count, cudaMemcpyKind kind,
 *                                cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if count == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  __pyx_t_1 = ((__pyx_v_count == 0) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2631
 *                                cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if count == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyHostToDevice:
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2630
 *                                size_t count, cudaMemcpyKind kind,
 *                                cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if count == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2633
 *         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":2634
 * 
 *     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, 2634, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2633
 *         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":2636
 *         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, 2636, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2635
 *     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":2638
 *         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, 2638, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2637
 *     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":2639
 *     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":2640
 *         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":2639
 *     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":2641
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToHost or kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 *         return cudaErrorInvalidMemcpyDirection
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2627
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2644
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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;
  __Pyx_TraceCall("memcpyFromArray", __pyx_f[0], 2644, 1, __PYX_ERR(0, 2644, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2647
 *                                  size_t count, cudaMemcpyKind kind,
 *                                  cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if count == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  __pyx_t_1 = ((__pyx_v_count == 0) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2648
 *                                  cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if count == 0:
 *         return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 *     if kind == cudaMemcpyKind.cudaMemcpyDeviceToHost:
 */
    __pyx_r = cudaSuccess;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2647
 *                                  size_t count, cudaMemcpyKind kind,
 *                                  cudaStream_t sid, bool async) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     if count == 0:             # <<<<<<<<<<<<<<
 *         return cudaSuccess
 * 
 */
  }

  /* "cuda/_lib/ccudart/utils.pyx":2650
 *         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":2651
 * 
 *     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, 2651, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2650
 *         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":2653
 *         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, 2653, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2652
 *     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":2655
 *         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, 2655, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cuda/_lib/ccudart/utils.pyx":2654
 *     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":2656
 *     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":2657
 *         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":2656
 *     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":2658
 *     elif kind == cudaMemcpyKind.cudaMemcpyHostToDevice or kind == cudaMemcpyKind.cudaMemcpyHostToHost:
 *         return cudaErrorInvalidMemcpyDirection
 *     return cudaSuccess             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = cudaSuccess;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2644
 * 
 * 
 * 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) nogil except ?cudaErrorCallRequiresNewerDriver:
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2661
 * 
 * 
 * cdef cudaError_t toDriverCudaResourceDesc(ccuda.CUDA_RESOURCE_DESC *_driver_pResDesc, const cudaResourceDesc *pResDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("toDriverCudaResourceDesc", __pyx_f[0], 2661, 1, __PYX_ERR(0, 2661, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2662
 * 
 * cdef cudaError_t toDriverCudaResourceDesc(ccuda.CUDA_RESOURCE_DESC *_driver_pResDesc, const cudaResourceDesc *pResDesc) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef int numChannels
 *     cdef ccuda.CUarray_format format
 */
  __pyx_v_err = cudaSuccess;

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

    /* "cuda/_lib/ccudart/utils.pyx":2667
 * 
 *     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":2668
 *     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":2666
 *     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":2669
 *         _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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2670
 *         _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":2671
 *     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":2669
 *         _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":2672
 *         _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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2673
 *         _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":2674
 *     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":2675
 *         _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":2676
 *         _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, 2676, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2677
 *         _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) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2678
 *         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, 2678, __pyx_L1_error)

      /* "cuda/_lib/ccudart/utils.pyx":2679
 *         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":2677
 *         _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":2680
 *             _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":2681
 *             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":2672
 *         _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":2682
 *         _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) != 0);
  if (__pyx_t_1) {

    /* "cuda/_lib/ccudart/utils.pyx":2683
 *         _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":2684
 *     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":2685
 *         _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":2686
 *         _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":2687
 *         _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":2688
 *         _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, 2688, __pyx_L1_error)
    __pyx_v_err = __pyx_t_3;

    /* "cuda/_lib/ccudart/utils.pyx":2689
 *         _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) != 0);
    if (__pyx_t_1) {

      /* "cuda/_lib/ccudart/utils.pyx":2690
 *         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, 2690, __pyx_L1_error)

      /* "cuda/_lib/ccudart/utils.pyx":2691
 *         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":2689
 *         _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":2692
 *             _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":2693
 *             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":2682
 *         _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":2695
 *         _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, 2695, __pyx_L1_error)

    /* "cuda/_lib/ccudart/utils.pyx":2696
 *     else:
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 *     _driver_pResDesc[0].flags = 0
 * 
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "cuda/_lib/ccudart/utils.pyx":2697
 *         _setLastError(cudaErrorInvalidValue)
 *         return cudaErrorInvalidValue
 *     _driver_pResDesc[0].flags = 0             # <<<<<<<<<<<<<<
 * 
 *     return err
 */
  (__pyx_v__driver_pResDesc[0]).flags = 0;

  /* "cuda/_lib/ccudart/utils.pyx":2699
 *     _driver_pResDesc[0].flags = 0
 * 
 *     return err             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_err;
  goto __pyx_L0;

  /* "cuda/_lib/ccudart/utils.pyx":2661
 * 
 * 
 * cdef cudaError_t toDriverCudaResourceDesc(ccuda.CUDA_RESOURCE_DESC *_driver_pResDesc, const cudaResourceDesc *pResDesc) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     cdef cudaError_t err = cudaSuccess
 *     cdef int numChannels
 */

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

/* "cuda/_lib/ccudart/utils.pyx":2702
 * 
 * 
 * cdef cudaError_t getDriverEglFrame(ccuda.CUeglFrame *cuEglFrame, cudaEglFrame eglFrame) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  __Pyx_TraceCall("getDriverEglFrame", __pyx_f[0], 2702, 1, __PYX_ERR(0, 2702, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2703
 * 
 * cdef cudaError_t getDriverEglFrame(ccuda.CUeglFrame *cuEglFrame, cudaEglFrame eglFrame) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     cdef cudaError_t err = cudaSuccess             # <<<<<<<<<<<<<<
 *     cdef unsigned int i = 0
 * 
 */
  __pyx_v_err = cudaSuccess;

  /* "cuda/_lib/ccudart/utils.pyx":2704
 * cdef cudaError_t getDriverEglFrame(ccuda.CUeglFrame *cuEglFrame, cudaEglFrame eglFrame) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":2706
 *     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, 2706, __pyx_L1_error)
  __pyx_v_err = __pyx_t_1;

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

    /* "cuda/_lib/ccudart/utils.pyx":2708
 *     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":2707
 * 
 *     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":2709
 *     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":2710
 *         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) != 0);
    if (__pyx_t_2) {

      /* "cuda/_lib/ccudart/utils.pyx":2711
 *     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":2710
 *         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":2713
 *             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":2714
 *         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":2715
 *             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":2716
 *     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":2717
 *     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":2718
 *     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":2719
 *     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":2720
 *     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":2719
 *     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":2722
 *         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":2721
 *     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":2724
 *         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":2723
 *     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":2726
 *         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":2725
 *     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":2728
 *         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":2727
 *     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":2730
 *         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":2729
 *     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":2732
 *         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":2731
 *     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":2734
 *         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":2733
 *     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":2736
 *         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":2735
 *     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":2738
 *         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":2737
 *     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":2740
 *         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":2739
 *     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":2742
 *         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":2741
 *     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":2744
 *         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":2743
 *     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":2746
 *         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":2745
 *     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":2748
 *         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":2747
 *     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":2750
 *         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":2749
 *     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":2752
 *         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":2751
 *     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":2754
 *         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":2753
 *     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":2756
 *         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":2755
 *     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":2758
 *         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":2757
 *     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":2760
 *         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":2759
 *     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":2762
 *         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":2761
 *     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":2764
 *         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":2763
 *     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":2766
 *         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":2765
 *     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":2768
 *         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":2767
 *     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":2770
 *         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":2769
 *     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":2772
 *         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":2771
 *     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":2774
 *         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":2773
 *     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":2776
 *         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":2775
 *     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":2778
 *         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":2777
 *     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":2780
 *         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":2779
 *     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":2782
 *         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":2781
 *     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":2784
 *         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":2783
 *     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":2786
 *         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":2785
 *     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":2788
 *         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":2787
 *     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":2790
 *         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":2789
 *     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":2792
 *         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":2791
 *     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":2794
 *         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":2793
 *     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":2796
 *         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":2795
 *     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":2798
 *         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":2797
 *     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":2800
 *         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":2799
 *     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":2802
 *         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":2801
 *     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":2804
 *         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":2803
 *     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":2806
 *         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":2805
 *     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":2808
 *         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":2807
 *     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":2810
 *         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":2809
 *     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":2812
 *         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":2811
 *     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":2814
 *         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":2813
 *     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":2816
 *         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":2815
 *     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":2818
 *         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":2817
 *     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":2820
 *         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":2819
 *     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":2822
 *         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":2821
 *     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":2824
 *         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":2823
 *     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":2826
 *         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":2825
 *     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":2828
 *         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":2827
 *     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":2830
 *         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":2829
 *     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":2832
 *         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":2831
 *     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":2834
 *         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":2833
 *     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":2836
 *         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":2835
 *     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":2838
 *         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":2837
 *     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":2840
 *         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":2839
 *     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":2842
 *         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":2841
 *     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":2844
 *         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":2843
 *     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":2846
 *         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":2845
 *     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":2848
 *         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":2847
 *     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":2850
 *         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":2849
 *     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":2852
 *         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":2851
 *     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":2854
 *         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":2853
 *     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":2856
 *         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":2855
 *     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":2858
 *         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":2857
 *     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":2860
 *         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":2859
 *     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":2862
 *         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":2861
 *     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":2864
 *         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":2863
 *     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":2866
 *         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":2865
 *     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":2868
 *         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":2867
 *     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":2870
 *         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":2869
 *     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":2872
 *         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":2871
 *     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":2874
 *         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":2873
 *     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":2876
 *         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":2875
 *     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":2878
 *         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":2877
 *     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":2880
 *         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":2879
 *     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":2882
 *         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":2881
 *     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":2884
 *         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":2883
 *     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":2886
 *         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":2885
 *     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":2888
 *         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":2887
 *     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":2890
 *         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":2889
 *     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":2892
 *         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":2891
 *     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":2894
 *         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":2893
 *     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":2896
 *         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":2895
 *     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":2898
 *         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":2897
 *     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":2900
 *         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":2899
 *     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":2902
 *         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":2901
 *     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":2904
 *         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":2903
 *     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":2906
 *         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":2905
 *     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":2908
 *         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":2907
 *     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":2910
 *         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":2909
 *     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":2912
 *         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":2911
 *     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":2914
 *         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":2913
 *     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":2916
 *         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":2915
 *     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":2918
 *         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":2917
 *     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":2920
 *         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":2919
 *     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":2922
 *         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":2921
 *     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":2924
 *         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":2923
 *     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":2926
 *         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":2925
 *     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":2928
 *         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":2927
 *     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":2930
 *         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":2929
 *     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":2932
 *         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":2931
 *     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":2934
 *         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":2933
 *     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":2936
 *         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":2935
 *     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":2938
 *         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":2937
 *     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":2940
 *         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":2941
 *     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":2942
 *         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":2941
 *     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":2944
 *         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":2943
 *     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":2946
 *         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":2702
 * 
 * 
 * cdef cudaError_t getDriverEglFrame(ccuda.CUeglFrame *cuEglFrame, cudaEglFrame eglFrame) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.utils.getDriverEglFrame", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}

/* "cuda/_lib/ccudart/utils.pyx":2949
 * 
 * 
 * cdef cudaError_t getRuntimeEglFrame(cudaEglFrame *eglFrame, ccuda.CUeglFrame cueglFrame) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_TraceCall("getRuntimeEglFrame", __pyx_f[0], 2949, 1, __PYX_ERR(0, 2949, __pyx_L1_error));

  /* "cuda/_lib/ccudart/utils.pyx":2950
 * 
 * cdef cudaError_t getRuntimeEglFrame(cudaEglFrame *eglFrame, ccuda.CUeglFrame cueglFrame) nogil except ?cudaErrorCallRequiresNewerDriver:
 *     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":2954
 *     cdef ccuda.CUDA_ARRAY3D_DESCRIPTOR_v2 ad
 *     cdef cudaPitchedPtr pPtr
 *     memset(eglFrame, 0, sizeof(eglFrame[0]))             # <<<<<<<<<<<<<<
 *     for i in range(cueglFrame.planeCount):
 *         ad.Depth = cueglFrame.depth
 */
  (void)(memset(__pyx_v_eglFrame, 0, (sizeof((__pyx_v_eglFrame[0])))));

  /* "cuda/_lib/ccudart/utils.pyx":2955
 *     cdef cudaPitchedPtr pPtr
 *     memset(eglFrame, 0, sizeof(eglFrame[0]))
 *     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":2956
 *     memset(eglFrame, 0, sizeof(eglFrame[0]))
 *     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":2957
 *     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":2958
 *         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":2959
 *         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":2960
 *         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":2961
 *         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":2963
 *         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, 2963, __pyx_L1_error)
    __pyx_v_err = __pyx_t_6;

    /* "cuda/_lib/ccudart/utils.pyx":2964
 * 
 *         err = getChannelFormatDescFromDriverDesc(&eglFrame[0].planeDesc[i].channelDesc, NULL, NULL, NULL, &ad)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    __pyx_t_7 = ((__pyx_v_err != cudaSuccess) != 0);
    if (__pyx_t_7) {

      /* "cuda/_lib/ccudart/utils.pyx":2965
 *         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":2964
 * 
 *         err = getChannelFormatDescFromDriverDesc(&eglFrame[0].planeDesc[i].channelDesc, NULL, NULL, NULL, &ad)
 *         if err != cudaSuccess:             # <<<<<<<<<<<<<<
 *             return err
 * 
 */
    }

    /* "cuda/_lib/ccudart/utils.pyx":2967
 *             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":2968
 * 
 *         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":2969
 *         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) != 0);
    if (__pyx_t_7) {

      /* "cuda/_lib/ccudart/utils.pyx":2970
 *         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":2971
 *         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":2972
 *             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":2969
 *         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":2973
 *             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":2974
 *             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":2975
 *         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":2976
 *               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":2977
 *               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":2978
 *               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":2979
 *               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":2973
 *             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":2981
 *               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":2982
 *               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":2983
 *             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":2973
 *             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":2984
 *             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":2985
 *             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":2986
 *         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":2987
 *               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":2988
 *               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":2989
 *               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":2990
 *               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":2991
 *               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":2992
 *               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":2993
 *               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":2994
 *               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":2995
 *               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":2996
 *               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":2997
 *               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":2998
 *               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":2984
 *             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":3000
 *               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":3001
 *               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":3002
 *             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":3003
 *             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":3004
 *             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":3005
 *             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":3006
 *             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":3007
 *                 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":3008
 *                 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":3009
 *                 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":3010
 *                 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":3012
 *                 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":3004
 *             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":2984
 *             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":3013
 *                 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":3014
 *                 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":3015
 *         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":3013
 *                 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":3017
 *               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":3018
 *               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":3019
 *             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":3013
 *                 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":3020
 *             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":3021
 *             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":3022
 *         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":3023
 *               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":3024
 *               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":3025
 *               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":3020
 *             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":3027
 *               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":3028
 *               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":3029
 *             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":3030
 *             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":3031
 *             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":3032
 *             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":3034
 *                 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":3031
 *             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":3020
 *             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":3035
 *                 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":3036
 *                 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":3037
 *         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":3035
 *                 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":3039
 *               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":3040
 *               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":3041
 *             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":3035
 *                 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":3042
 *             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":3043
 *             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":3044
 *         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":3045
 *               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":3046
 *               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":3047
 *               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":3048
 *               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":3049
 *               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":3050
 *               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":3042
 *             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":3052
 *               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":3053
 *               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":3054
 *             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":3055
 *             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":3056
 *             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":3057
 *             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":3058
 *             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":3059
 *                 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":3060
 *                 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":3062
 *                 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":3056
 *             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":3042
 *             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":3063
 *                 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) != 0);
    if (__pyx_t_7) {

      /* "cuda/_lib/ccudart/utils.pyx":3064
 *                 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":3063
 *                 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":3066
 *             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":3067
 *         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_v_pPtr = __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);

      /* "cuda/_lib/ccudart/utils.pyx":3068
 *             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":3070
 *             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":3071
 * 
 *     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":3072
 *     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":3071
 * 
 *     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":3074
 *         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":3073
 *     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":3076
 *         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":3075
 *     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":3078
 *         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":3077
 *     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":3080
 *         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":3079
 *     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":3082
 *         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":3081
 *     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":3084
 *         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":3083
 *     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":3086
 *         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":3085
 *     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":3088
 *         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":3087
 *     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":3090
 *         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":3089
 *     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":3092
 *         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":3091
 *     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":3094
 *         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":3093
 *     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":3096
 *         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":3095
 *     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":3098
 *         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":3097
 *     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":3100
 *         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":3099
 *     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":3102
 *         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":3101
 *     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":3104
 *         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":3103
 *     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":3106
 *         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":3105
 *     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":3108
 *         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":3107
 *     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":3110
 *         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":3109
 *     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":3112
 *         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":3111
 *     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":3114
 *         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":3113
 *     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":3116
 *         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":3115
 *     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":3118
 *         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":3117
 *     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":3120
 *         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":3119
 *     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":3122
 *         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":3121
 *     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":3124
 *         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":3123
 *     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":3126
 *         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":3125
 *     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":3128
 *         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":3127
 *     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":3130
 *         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":3129
 *     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":3132
 *         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":3131
 *     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":3134
 *         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":3133
 *     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":3136
 *         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":3135
 *     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":3138
 *         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":3137
 *     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":3140
 *         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":3139
 *     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":3142
 *         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":3141
 *     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":3144
 *         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":3143
 *     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":3146
 *         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":3145
 *     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":3148
 *         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":3147
 *     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":3150
 *         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":3149
 *     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":3152
 *         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":3151
 *     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":3154
 *         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":3153
 *     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":3156
 *         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":3155
 *     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":3158
 *         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":3157
 *     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":3160
 *         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":3159
 *     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":3162
 *         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":3161
 *     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":3164
 *         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":3163
 *     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":3166
 *         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":3165
 *     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":3168
 *         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":3167
 *     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":3170
 *         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":3169
 *     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":3172
 *         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":3171
 *     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":3174
 *         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":3173
 *     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":3176
 *         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":3175
 *     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":3178
 *         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":3177
 *     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":3180
 *         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":3179
 *     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":3182
 *         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":3181
 *     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":3184
 *         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":3183
 *     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":3186
 *         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":3185
 *     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":3188
 *         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":3187
 *     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":3190
 *         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":3189
 *     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":3192
 *         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":3191
 *     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":3194
 *         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":3193
 *     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":3196
 *         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":3195
 *     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":3198
 *         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":3197
 *     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":3200
 *         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":3199
 *     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":3202
 *         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":3201
 *     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":3204
 *         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":3203
 *     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":3206
 *         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":3205
 *     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":3208
 *         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":3207
 *     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":3210
 *         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":3209
 *     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":3212
 *         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":3211
 *     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":3214
 *         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":3213
 *     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":3216
 *         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":3215
 *     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":3218
 *         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":3217
 *     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":3220
 *         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":3219
 *     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":3222
 *         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":3221
 *     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":3224
 *         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":3223
 *     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":3226
 *         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":3225
 *     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":3228
 *         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":3227
 *     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":3230
 *         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":3229
 *     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":3232
 *         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":3231
 *     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":3234
 *         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":3233
 *     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":3236
 *         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":3235
 *     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":3238
 *         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":3237
 *     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":3240
 *         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":3239
 *     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":3242
 *         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":3241
 *     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":3244
 *         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":3243
 *     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":3246
 *         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":3245
 *     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":3248
 *         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":3247
 *     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":3250
 *         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":3249
 *     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":3252
 *         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":3251
 *     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":3254
 *         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":3253
 *     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":3256
 *         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":3255
 *     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":3258
 *         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":3257
 *     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":3260
 *         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":3259
 *     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":3262
 *         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":3261
 *     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":3264
 *         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":3263
 *     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":3266
 *         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":3265
 *     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":3268
 *         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":3267
 *     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":3270
 *         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":3269
 *     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":3272
 *         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":3271
 *     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":3274
 *         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":3273
 *     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":3276
 *         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":3275
 *     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":3278
 *         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":3277
 *     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":3280
 *         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":3279
 *     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":3282
 *         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":3281
 *     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":3284
 *         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":3283
 *     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":3286
 *         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":3285
 *     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":3288
 *         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":3287
 *     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":3290
 *         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":3289
 *     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":3292
 *         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":3293
 *     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":3294
 *         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":3293
 *     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":3296
 *         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":3295
 *     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":3298
 *         eglFrame[0].frameType = cudaEglFrameTypePitch
 *     else:
 *         return cudaErrorInvalidValue             # <<<<<<<<<<<<<<
 */
    __pyx_r = cudaErrorInvalidValue;
    goto __pyx_L0;
    break;
  }

  /* "cuda/_lib/ccudart/utils.pyx":2949
 * 
 * 
 * cdef cudaError_t getRuntimeEglFrame(cudaEglFrame *eglFrame, ccuda.CUeglFrame cueglFrame) nogil except ?cudaErrorCallRequiresNewerDriver:             # <<<<<<<<<<<<<<
 *     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
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("cuda._lib.ccudart.utils.getRuntimeEglFrame", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = cudaErrorCallRequiresNewerDriver;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 1);
  return __pyx_r;
}
static 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 (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal *)o);
  p->__pyx_vtab = __pyx_vtabptr_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal;
  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) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    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);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_5__reduce_cython__, METH_NOARGS, __pyx_doc_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_7__setstate_cython__, METH_O, __pyx_doc_4cuda_4_lib_7ccudart_5utils_16cudaPythonGlobal_6__setstate_cython__},
  {0, 0, 0, 0}
};

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*/
  0, /*tp_dictoffset*/
  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
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_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

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "utils",
    0, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 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_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_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}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 56, __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;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "(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_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "(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_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "(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__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);
  __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __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__6 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);
  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __pyx_v_4cuda_4_lib_7ccudart_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("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("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_v2 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_v2 *, 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)
  __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 (PyType_Ready(&__pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal.tp_dictoffset && __pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal.tp_dict, __pyx_vtabptr_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cudaPythonGlobal, (PyObject *)&__pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  __pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal = &__pyx_type_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal;
  __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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__pyx_t_1, "_cuDeviceGetAttribute", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDeviceGetAttribute, "CUresult (int *, CUdevice_attribute, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuDevicePrimaryCtxRetain", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxRetain, "CUresult (CUcontext *, CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuDevicePrimaryCtxReset_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuDevicePrimaryCtxReset_v2, "CUresult (CUdevice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuCtxSetCurrent", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxSetCurrent, "CUresult (CUcontext)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_cuCtxGetCurrent", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuCtxGetCurrent, "CUresult (CUcontext *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__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(__pyx_t_1, "_cuArray3DGetDescriptor_v2", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuArray3DGetDescriptor_v2, "CUresult (CUDA_ARRAY3D_DESCRIPTOR *, CUarray)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "_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(__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(__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(__pyx_t_1, "_cuStreamGetCaptureInfo", (void (**)(void))&__pyx_f_4cuda_5_cuda_5ccuda__cuStreamGetCaptureInfo, "CUresult (CUstream, CUstreamCaptureStatus *, cuuint64_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__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)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}


#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC 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;
}
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_utils(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  __Pyx_TraceDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module '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
  #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() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("utils", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_cuda___lib__ccudart__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_1 = __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_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1 = __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__3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cuda/_lib/ccudart/utils.pyx":129
 *         return NULL
 * 
 * cdef cudaPythonGlobal m_global = cudaPythonGlobal()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4cuda_4_lib_7ccudart_5utils_cudaPythonGlobal)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __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_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cuda/_lib/ccudart/utils.pyx":1
 * # Copyright 2021-2022 NVIDIA Corporation.  All rights reserved.             # <<<<<<<<<<<<<<
 * #
 * # Please refer to the NVIDIA end user license agreement (EULA) associated
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_TraceReturn(Py_None, 0);

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init cuda._lib.ccudart.utils", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } 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
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* 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 *kwdict,
    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(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &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:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* Profile */
#if CYTHON_PROFILE
static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
                                   PyFrameObject** frame,
                                   PyThreadState* tstate,
                                   const char *funcname,
                                   const char *srcfile,
                                   int firstlineno) {
    PyObject *type, *value, *traceback;
    int retval;
    if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
        if (*code == NULL) {
            *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
            if (*code == NULL) return 0;
        }
        *frame = PyFrame_New(
            tstate,                          /*PyThreadState *tstate*/
            *code,                           /*PyCodeObject *code*/
            __pyx_d,                  /*PyObject *globals*/
            0                                /*PyObject *locals*/
        );
        if (*frame == NULL) return 0;
        if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
            Py_INCREF(Py_None);
            (*frame)->f_trace = Py_None;
        }
#if PY_VERSION_HEX < 0x030400B1
    } else {
        (*frame)->f_tstate = tstate;
#endif
    }
    __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
    retval = 1;
    __Pyx_EnterTracing(tstate);
    __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
    #if CYTHON_TRACE
    if (tstate->c_tracefunc)
        retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
    if (retval && tstate->c_profilefunc)
    #endif
        retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
    __Pyx_LeaveTracing(tstate);
    if (retval) {
        __Pyx_ErrRestoreInState(tstate, type, value, traceback);
        return __Pyx_IsTracing(tstate, 0, 0) && retval;
    } else {
        Py_XDECREF(type);
        Py_XDECREF(value);
        Py_XDECREF(traceback);
        return -1;
    }
}
static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
    PyCodeObject *py_code = 0;
#if PY_MAJOR_VERSION >= 3
    py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
    if (likely(py_code)) {
        py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
    }
#else
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    py_funcname = PyString_FromString(funcname);
    if (unlikely(!py_funcname)) goto bad;
    py_srcfile = PyString_FromString(srcfile);
    if (unlikely(!py_srcfile)) goto bad;
    py_code = PyCode_New(
        0,
        0,
        0,
        CO_OPTIMIZED | CO_NEWLOCALS,
        __pyx_empty_bytes,     /*PyObject *code,*/
        __pyx_empty_tuple,     /*PyObject *consts,*/
        __pyx_empty_tuple,     /*PyObject *names,*/
        __pyx_empty_tuple,     /*PyObject *varnames,*/
        __pyx_empty_tuple,     /*PyObject *freevars,*/
        __pyx_empty_tuple,     /*PyObject *cellvars,*/
        py_srcfile,       /*PyObject *filename,*/
        py_funcname,      /*PyObject *name,*/
        firstlineno,
        __pyx_empty_bytes      /*PyObject *lnotab*/
    );
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
#endif
    return py_code;
}
#endif

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* 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 (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    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 CYTHON_COMPILING_IN_PYPY
        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);
#else
        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);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#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) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    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(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* 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) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* PyObjectGetAttrStrNoError */
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#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;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStr(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_GetAttrStr(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())
        PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_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;
}

/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunctionShared */
#include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.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, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#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;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#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;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *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, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
    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;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    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 = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = 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, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__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, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__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, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
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 *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 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},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    Py_INCREF(m->func_qualname);
    return m->func_qualname;
#else
    return PyString_FromString(m->func.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
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.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 (unlikely(op == NULL))
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    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;
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    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);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    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);
    PyObject_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);
    Py_VISIT(m->func.m_module);
    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);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    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_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
#if PY_MAJOR_VERSION < 3
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
#endif
    return __Pyx_PyMethod_New(func, obj, type);
}
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) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_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)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = 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;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        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);
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
            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;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    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,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    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_CyFunction_descr_get,
    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 PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    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;
}

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
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;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
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_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    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
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_srcfile = NULL;
    py_srcfile = PyString_FromString(filename);
    if (!py_srcfile) goto bad;
    #endif
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        if (!py_funcname) goto bad;
        #endif
    }
    #if PY_MAJOR_VERSION < 3
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    #else
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    #endif
    Py_XDECREF(py_funcname);  // XDECREF since it's only set on Py3 if cline
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_srcfile);
    #endif
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* None */
static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void) {
  int err;
  #ifdef WITH_THREAD
  PyGILState_STATE _save = PyGILState_Ensure();
  #endif
  err = !!PyErr_Occurred();
  #ifdef WITH_THREAD
  PyGILState_Release(_save);
  #endif
  return err;
}

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(unsigned int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
                                     little, !is_unsigned);
    }
}

/* 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
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0])
                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
            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
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +digits[0])
                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
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            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 one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (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;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(void) {
    char ctversion[5];
    int same=1, i, found_dot;
    const char* rt_from_call = Py_GetVersion();
    PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    found_dot = 0;
    for (i = 0; i < 4; i++) {
        if (!ctversion[i]) {
            same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
            break;
        }
        if (rt_from_call[i] != ctversion[i]) {
            same = 0;
            break;
        }
    }
    if (!same) {
        char rtversion[5] = {'\0'};
        char message[200];
        for (i=0; i<4; ++i) {
            if (rt_from_call[i] == '.') {
                if (found_dot) break;
                found_dot = 1;
            } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
                break;
            }
            rtversion[i] = rt_from_call[i];
        }
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* FunctionExport */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000
    cobj = PyCapsule_New(tmp.p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

/* FunctionImport */
#ifndef __PYX_HAVE_RT_ImportFunction
#define __PYX_HAVE_RT_ImportFunction
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, funcname);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C function %.200s",
                PyModule_GetName(module), funcname);
        goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    tmp.p = PyCapsule_GetPointer(cobj, sig);
#else
    {const char *desc, *s1, *s2;
    desc = (const char *)PyCObject_GetDesc(cobj);
    if (!desc)
        goto bad;
    s1 = desc; s2 = sig;
    while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
    if (*s1 != *s2) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, desc);
        goto bad;
    }
    tmp.p = PyCObject_AsVoidPtr(cobj);}
#endif
    *f = tmp.fp;
    if (!(*f))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

/* InitStrings */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
#if PY_MAJOR_VERSION < 3
  } else if (likely(PyInt_CheckExact(o))) {
    return PyInt_AS_LONG(o);
#endif
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyInt_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
