/* Generated by Cython 0.29.21 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "define_macros": [
            [
                "_FORCE_INLINES",
                "1"
            ],
            [
                "CUPY_NO_CUDA",
                "1"
            ]
        ],
        "depends": [
            "cupy/cuda/cupy_cuComplex.h",
            "cupy/cuda/cupy_cuda.h",
            "cupy/cuda/cupy_cusparse.h"
        ],
        "extra_link_args": [
            "-Wl,--disable-new-dtags,-rpath,/usr/local/cuda/lib64"
        ],
        "include_dirs": [
            "cupy/cuda",
            "./cupy/cuda",
            "/usr/local/cuda/include"
        ],
        "language": "c++",
        "library_dirs": [
            "/usr/local/cuda/lib64"
        ],
        "name": "cupy.cuda.cusparse",
        "sources": [
            "cupy/cuda/cusparse.pyx"
        ]
    },
    "module_name": "cupy.cuda.cusparse"
}
END: Cython Metadata */

#define 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_21"
#define CYTHON_HEX_VERSION 0x001D15F0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x02070000
    #define HAVE_LONG_LONG
  #endif
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 0
  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  #endif
  #ifndef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #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"
#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#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
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #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)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  #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   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

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

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

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

#define __PYX_HAVE__cupy__cuda__cusparse
#define __PYX_HAVE_API__cupy__cuda__cusparse
/* Early includes */
#include <stdint.h>
#include "../cuda/cupy_cuda.h"
#include "cupy_cuComplex.h"
#include "cupy_cusparse.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

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

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#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;

/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
  #if defined(__cplusplus)
    #define CYTHON_CCOMPLEX 1
  #elif defined(_Complex_I)
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <complex>
  #else
    #include <complex.h>
  #endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  #undef _Complex_I
  #define _Complex_I 1.0fj
#endif


static const char *__pyx_f[] = {
  "cupy/cuda/cusparse.pyx",
  "cupy/cuda/cusparse.pxd",
  "stringsource",
  "cupy/cuda/runtime.pxd",
};
/* 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()

/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

/* Declarations.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);


/*--- Type declarations ---*/
struct __pyx_obj_4cupy_4cuda_7runtime_PointerAttributes;
struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes;
struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes;
struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes;
struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes;
struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes;
struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes;
struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes;

/* "driver.pxd":39
 * 
 * 
 * cpdef enum:             # <<<<<<<<<<<<<<
 *     CU_JIT_INPUT_CUBIN = 0
 *     CU_JIT_INPUT_PTX = 1
 */
enum  {
  __pyx_e_4cupy_4cuda_6driver_CU_JIT_INPUT_CUBIN = 0,
  __pyx_e_4cupy_4cuda_6driver_CU_JIT_INPUT_PTX = 1,
  __pyx_e_4cupy_4cuda_6driver_CU_JIT_INPUT_FATBINARY = 2,
  __pyx_e_4cupy_4cuda_6driver_CU_JIT_INPUT_OBJECT = 3,
  __pyx_e_4cupy_4cuda_6driver_CU_JIT_INPUT_LIBRARY = 4,
  __pyx_e_4cupy_4cuda_6driver_CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 0,
  __pyx_e_4cupy_4cuda_6driver_CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES = 1,
  __pyx_e_4cupy_4cuda_6driver_CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES = 2,
  __pyx_e_4cupy_4cuda_6driver_CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES = 3,
  __pyx_e_4cupy_4cuda_6driver_CU_FUNC_ATTRIBUTE_NUM_REGS = 4,
  __pyx_e_4cupy_4cuda_6driver_CU_FUNC_ATTRIBUTE_PTX_VERSION = 5,
  __pyx_e_4cupy_4cuda_6driver_CU_FUNC_ATTRIBUTE_BINARY_VERSION = 6,
  __pyx_e_4cupy_4cuda_6driver_CU_FUNC_ATTRIBUTE_CACHE_MODE_CA = 7,
  __pyx_e_4cupy_4cuda_6driver_CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES = 8,
  __pyx_e_4cupy_4cuda_6driver_CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = 9,
  __pyx_e_4cupy_4cuda_6driver_CUDA_ERROR_INVALID_VALUE = 1,
  __pyx_e_4cupy_4cuda_6driver_CU_AD_FORMAT_UNSIGNED_INT8 = 0x01,
  __pyx_e_4cupy_4cuda_6driver_CU_AD_FORMAT_UNSIGNED_INT16 = 0x02,
  __pyx_e_4cupy_4cuda_6driver_CU_AD_FORMAT_UNSIGNED_INT32 = 0x03,
  __pyx_e_4cupy_4cuda_6driver_CU_AD_FORMAT_SIGNED_INT8 = 0x08,
  __pyx_e_4cupy_4cuda_6driver_CU_AD_FORMAT_SIGNED_INT16 = 0x09,
  __pyx_e_4cupy_4cuda_6driver_CU_AD_FORMAT_SIGNED_INT32 = 0x0a,
  __pyx_e_4cupy_4cuda_6driver_CU_AD_FORMAT_HALF = 0x10,
  __pyx_e_4cupy_4cuda_6driver_CU_AD_FORMAT_FLOAT = 0x20,
  __pyx_e_4cupy_4cuda_6driver_CU_TR_ADDRESS_MODE_WRAP = 0,
  __pyx_e_4cupy_4cuda_6driver_CU_TR_ADDRESS_MODE_CLAMP = 1,
  __pyx_e_4cupy_4cuda_6driver_CU_TR_ADDRESS_MODE_MIRROR = 2,
  __pyx_e_4cupy_4cuda_6driver_CU_TR_ADDRESS_MODE_BORDER = 3,
  __pyx_e_4cupy_4cuda_6driver_CU_TR_FILTER_MODE_POINT = 0,
  __pyx_e_4cupy_4cuda_6driver_CU_TR_FILTER_MODE_LINEAR = 1,
  __pyx_e_4cupy_4cuda_6driver_CU_TRSA_OVERRIDE_FORMAT = 0x01,
  __pyx_e_4cupy_4cuda_6driver_CU_TRSF_READ_AS_INTEGER = 0x01,
  __pyx_e_4cupy_4cuda_6driver_CU_TRSF_NORMALIZED_COORDINATES = 0x02,
  __pyx_e_4cupy_4cuda_6driver_CU_TRSF_SRGB = 0x10,
  __pyx_e_4cupy_4cuda_6driver_CU_PARAM_TR_DEFAULT = -1L
};
struct __pyx_opt_args_4cupy_4cuda_7runtime_mallocManaged;
struct __pyx_opt_args_4cupy_4cuda_7runtime_malloc3DArray;
struct __pyx_opt_args_4cupy_4cuda_7runtime_mallocArray;
struct __pyx_opt_args_4cupy_4cuda_7runtime_streamAddCallback;
struct __pyx_opt_args_4cupy_4cuda_7runtime_streamWaitEvent;

/* "cupy/cuda/runtime.pxd":99
 * ###############################################################################
 * 
 * cpdef enum:             # <<<<<<<<<<<<<<
 *     memcpyHostToHost = 0
 *     memcpyHostToDevice = 1
 */
enum  {
  __pyx_e_4cupy_4cuda_7runtime_memcpyHostToHost = 0,
  __pyx_e_4cupy_4cuda_7runtime_memcpyHostToDevice = 1,
  __pyx_e_4cupy_4cuda_7runtime_memcpyDeviceToHost = 2,
  __pyx_e_4cupy_4cuda_7runtime_memcpyDeviceToDevice = 3,
  __pyx_e_4cupy_4cuda_7runtime_memcpyDefault = 4,
  __pyx_e_4cupy_4cuda_7runtime_cudaMemoryTypeHost = 1,
  __pyx_e_4cupy_4cuda_7runtime_cudaMemoryTypeDevice = 2,
  __pyx_e_4cupy_4cuda_7runtime_cudaMemAttachGlobal = 1,
  __pyx_e_4cupy_4cuda_7runtime_cudaMemAttachHost = 2,
  __pyx_e_4cupy_4cuda_7runtime_cudaMemAttachSingle = 4,
  __pyx_e_4cupy_4cuda_7runtime_hostAllocDefault = 0,
  __pyx_e_4cupy_4cuda_7runtime_hostAllocPortable = 1,
  __pyx_e_4cupy_4cuda_7runtime_hostAllocMapped = 2,
  __pyx_e_4cupy_4cuda_7runtime_hostAllocWriteCombined = 4,
  __pyx_e_4cupy_4cuda_7runtime_cudaMemAdviseSetReadMostly = 1,
  __pyx_e_4cupy_4cuda_7runtime_cudaMemAdviseUnsetReadMostly = 2,
  __pyx_e_4cupy_4cuda_7runtime_cudaMemAdviseSetPreferredLocation = 3,
  __pyx_e_4cupy_4cuda_7runtime_cudaMemAdviseUnsetPreferredLocation = 4,
  __pyx_e_4cupy_4cuda_7runtime_cudaMemAdviseSetAccessedBy = 5,
  __pyx_e_4cupy_4cuda_7runtime_cudaMemAdviseUnsetAccessedBy = 6,
  __pyx_e_4cupy_4cuda_7runtime_streamDefault = 0,
  __pyx_e_4cupy_4cuda_7runtime_streamNonBlocking = 1,
  __pyx_e_4cupy_4cuda_7runtime_eventDefault = 0,
  __pyx_e_4cupy_4cuda_7runtime_eventBlockingSync = 1,
  __pyx_e_4cupy_4cuda_7runtime_eventDisableTiming = 2,
  __pyx_e_4cupy_4cuda_7runtime_eventInterprocess = 4,
  __pyx_e_4cupy_4cuda_7runtime_CUDA_R_32F = 0,
  __pyx_e_4cupy_4cuda_7runtime_CUDA_R_64F = 1,
  __pyx_e_4cupy_4cuda_7runtime_CUDA_R_16F = 2,
  __pyx_e_4cupy_4cuda_7runtime_CUDA_R_8I = 3,
  __pyx_e_4cupy_4cuda_7runtime_CUDA_C_32F = 4,
  __pyx_e_4cupy_4cuda_7runtime_CUDA_C_64F = 5,
  __pyx_e_4cupy_4cuda_7runtime_CUDA_C_16F = 6,
  __pyx_e_4cupy_4cuda_7runtime_CUDA_C_8I = 7,
  __pyx_e_4cupy_4cuda_7runtime_CUDA_R_8U = 8,
  __pyx_e_4cupy_4cuda_7runtime_CUDA_C_8U = 9,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxThreadsPerBlock = 1,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxBlockDimX = 2,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxBlockDimY = 3,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxBlockDimZ = 4,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxGridDimX = 5,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxGridDimY = 6,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxGridDimZ = 7,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSharedMemoryPerBlock = 8,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrTotalConstantMemory = 9,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrWarpSize = 10,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxPitch = 11,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxRegistersPerBlock = 12,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrClockRate = 13,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrTextureAlignment = 14,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrGpuOverlap = 15,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMultiProcessorCount = 16,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrKernelExecTimeout = 17,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrIntegrated = 18,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrCanMapHostMemory = 19,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrComputeMode = 20,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture1DWidth = 21,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture2DWidth = 22,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture2DHeight = 23,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture3DWidth = 24,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture3DHeight = 25,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture3DDepth = 26,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture2DLayeredWidth = 27,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture2DLayeredHeight = 28,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture2DLayeredLayers = 29,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrSurfaceAlignment = 30,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrConcurrentKernels = 31,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrEccEnabled = 32,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrPciBusId = 33,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrPciDeviceId = 34,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrTccDriver = 35,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMemoryClockRate = 36,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrGlobalMemoryBusWidth = 37,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrL2CacheSize = 38,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxThreadsPerMultiProcessor = 39,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrAsyncEngineCount = 40,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrUnifiedAddressing = 41,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture1DLayeredWidth = 42,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture1DLayeredLayers = 43,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture2DGatherWidth = 45,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture2DGatherHeight = 46,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture3DWidthAlt = 47,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture3DHeightAlt = 48,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture3DDepthAlt = 49,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrPciDomainId = 50,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrTexturePitchAlignment = 51,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTextureCubemapWidth = 52,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTextureCubemapLayeredWidth = 53,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTextureCubemapLayeredLayers = 54,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSurface1DWidth = 55,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSurface2DWidth = 56,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSurface2DHeight = 57,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSurface3DWidth = 58,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSurface3DHeight = 59,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSurface3DDepth = 60,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSurface1DLayeredWidth = 61,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSurface1DLayeredLayers = 62,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSurface2DLayeredWidth = 63,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSurface2DLayeredHeight = 64,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSurface2DLayeredLayers = 65,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSurfaceCubemapWidth = 66,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSurfaceCubemapLayeredWidth = 67,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSurfaceCubemapLayeredLayers = 68,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture1DLinearWidth = 69,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture2DLinearWidth = 70,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture2DLinearHeight = 71,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture2DLinearPitch = 72,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture2DMipmappedWidth = 73,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture2DMipmappedHeight = 74,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxTexture1DMipmappedWidth = 77,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrStreamPrioritiesSupported = 78,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrGlobalL1CacheSupported = 79,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrLocalL1CacheSupported = 80,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSharedMemoryPerMultiprocessor = 81,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxRegistersPerMultiprocessor = 82,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrManagedMemory = 83,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrIsMultiGpuBoard = 84,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMultiGpuBoardGroupID = 85,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrHostNativeAtomicSupported = 86,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrSingleToDoublePrecisionPerfRatio = 87,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrPageableMemoryAccess = 88,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrConcurrentManagedAccess = 89,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrComputePreemptionSupported = 90,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrCanUseHostPointerForRegisteredMem = 91,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrReserved92 = 92,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrReserved93 = 93,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrReserved94 = 94,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrCooperativeLaunch = 95,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrCooperativeMultiDeviceLaunch = 96,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrMaxSharedMemoryPerBlockOptin = 97,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrCanFlushRemoteWrites = 98,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrHostRegisterSupported = 99,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrPageableMemoryAccessUsesHostPageTables = 0x64,
  __pyx_e_4cupy_4cuda_7runtime_cudaDevAttrDirectManagedMemAccessFromHost = 0x65,
  __pyx_e_4cupy_4cuda_7runtime_cudaChannelFormatKindSigned = 0,
  __pyx_e_4cupy_4cuda_7runtime_cudaChannelFormatKindUnsigned = 1,
  __pyx_e_4cupy_4cuda_7runtime_cudaChannelFormatKindFloat = 2,
  __pyx_e_4cupy_4cuda_7runtime_cudaChannelFormatKindNone = 3,
  __pyx_e_4cupy_4cuda_7runtime_cudaResourceTypeArray = 0,
  __pyx_e_4cupy_4cuda_7runtime_cudaResourceTypeMipmappedArray = 1,
  __pyx_e_4cupy_4cuda_7runtime_cudaResourceTypeLinear = 2,
  __pyx_e_4cupy_4cuda_7runtime_cudaResourceTypePitch2D = 3,
  __pyx_e_4cupy_4cuda_7runtime_cudaAddressModeWrap = 0,
  __pyx_e_4cupy_4cuda_7runtime_cudaAddressModeClamp = 1,
  __pyx_e_4cupy_4cuda_7runtime_cudaAddressModeMirror = 2,
  __pyx_e_4cupy_4cuda_7runtime_cudaAddressModeBorder = 3,
  __pyx_e_4cupy_4cuda_7runtime_cudaFilterModePoint = 0,
  __pyx_e_4cupy_4cuda_7runtime_cudaFilterModeLinear = 1,
  __pyx_e_4cupy_4cuda_7runtime_cudaReadModeElementType = 0,
  __pyx_e_4cupy_4cuda_7runtime_cudaReadModeNormalizedFloat = 1
};

/* "cupy/cuda/runtime.pxd":325
 * 
 * cpdef intptr_t malloc(size_t size) except? 0
 * cpdef intptr_t mallocManaged(size_t size, unsigned int flags=*) except? 0             # <<<<<<<<<<<<<<
 * cpdef intptr_t malloc3DArray(intptr_t desc, size_t width, size_t height,
 *                              size_t depth, unsigned int flags=*) except? 0
 */
struct __pyx_opt_args_4cupy_4cuda_7runtime_mallocManaged {
  int __pyx_n;
  unsigned int flags;
};

/* "cupy/cuda/runtime.pxd":326
 * cpdef intptr_t malloc(size_t size) except? 0
 * cpdef intptr_t mallocManaged(size_t size, unsigned int flags=*) except? 0
 * cpdef intptr_t malloc3DArray(intptr_t desc, size_t width, size_t height,             # <<<<<<<<<<<<<<
 *                              size_t depth, unsigned int flags=*) except? 0
 * cpdef intptr_t mallocArray(intptr_t desc, size_t width, size_t height,
 */
struct __pyx_opt_args_4cupy_4cuda_7runtime_malloc3DArray {
  int __pyx_n;
  unsigned int flags;
};

/* "cupy/cuda/runtime.pxd":328
 * cpdef intptr_t malloc3DArray(intptr_t desc, size_t width, size_t height,
 *                              size_t depth, unsigned int flags=*) except? 0
 * cpdef intptr_t mallocArray(intptr_t desc, size_t width, size_t height,             # <<<<<<<<<<<<<<
 *                            unsigned int flags=*) except? 0
 * cpdef intptr_t hostAlloc(size_t size, unsigned int flags) except? 0
 */
struct __pyx_opt_args_4cupy_4cuda_7runtime_mallocArray {
  int __pyx_n;
  unsigned int flags;
};

/* "cupy/cuda/runtime.pxd":380
 * cpdef streamDestroy(intptr_t stream)
 * cpdef streamSynchronize(intptr_t stream)
 * cpdef streamAddCallback(intptr_t stream, callback, intptr_t arg,             # <<<<<<<<<<<<<<
 *                         unsigned int flags=*)
 * cpdef streamQuery(intptr_t stream)
 */
struct __pyx_opt_args_4cupy_4cuda_7runtime_streamAddCallback {
  int __pyx_n;
  unsigned int flags;
};

/* "cupy/cuda/runtime.pxd":383
 *                         unsigned int flags=*)
 * cpdef streamQuery(intptr_t stream)
 * cpdef streamWaitEvent(intptr_t stream, intptr_t event, unsigned int flags=*)             # <<<<<<<<<<<<<<
 * cpdef intptr_t eventCreate() except? 0
 * cpdef intptr_t eventCreateWithFlags(unsigned int flags) except? 0
 */
struct __pyx_opt_args_4cupy_4cuda_7runtime_streamWaitEvent {
  int __pyx_n;
  unsigned int flags;
};

/* "cupy/cuda/cusparse.pxd":55
 *     ctypedef int Csr2CscAlg 'cusparseCsr2CscAlg_t'
 * 
 * cpdef enum:             # <<<<<<<<<<<<<<
 *     CUSPARSE_POINTER_MODE_HOST = 0
 *     CUSPARSE_POINTER_MODE_DEVICE = 1
 */
enum  {
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_POINTER_MODE_HOST = 0,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_POINTER_MODE_DEVICE = 1,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_ACTION_SYMBOLIC = 0,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_ACTION_NUMERIC = 1,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_INDEX_BASE_ZERO = 0,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_INDEX_BASE_ONE = 1,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_MATRIX_TYPE_GENERAL = 0,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_MATRIX_TYPE_SYMMETRIC = 1,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_MATRIX_TYPE_HERMITIAN = 2,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_MATRIX_TYPE_TRIANGULAR = 3,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_OPERATION_NON_TRANSPOSE = 0,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_OPERATION_TRANSPOSE = 1,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE = 2,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_DIRECTION_ROW = 0,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_DIRECTION_COLUMN = 1,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_SOLVE_POLICY_NO_LEVEL = 0,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_SOLVE_POLICY_USE_LEVEL = 1,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_ALG_NAIVE = 0,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_ALG_MERGE_PATH = 1,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_FORMAT_CSR = 1,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_FORMAT_CSC = 2,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_FORMAT_COO = 3,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_FORMAT_COO_AOS = 4,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_ORDER_COL = 1,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_ORDER_ROW = 2,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_MV_ALG_DEFAULT = 0,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_COOMV_ALG = 1,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_CSRMV_ALG1 = 2,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_CSRMV_ALG2 = 3,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_MM_ALG_DEFAULT = 0,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_COOMM_ALG1 = 1,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_COOMM_ALG2 = 2,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_COOMM_ALG3 = 3,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_CSRMM_ALG1 = 4,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_INDEX_16U = 1,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_INDEX_32I = 2,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_INDEX_64I = 3,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_CSR2CSC_ALG1 = 1,
  __pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_CSR2CSC_ALG2 = 2
};

/* "cupy/cuda/runtime.pxd":8
 * ###############################################################################
 * 
 * cdef class PointerAttributes:             # <<<<<<<<<<<<<<
 *     cdef:
 *         public int device
 */
struct __pyx_obj_4cupy_4cuda_7runtime_PointerAttributes {
  PyObject_HEAD
  int device;
  intptr_t devicePointer;
  intptr_t hostPointer;
};


/* "cupy/cuda/cusparse.pxd":111
 *     CUSPARSE_CSR2CSC_ALG2 = 2  # low memory requirement, non-deterministc
 * 
 * cdef class SpVecAttributes:             # <<<<<<<<<<<<<<
 *     cdef:
 *         public int64_t size
 */
struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes {
  PyObject_HEAD
  int64_t size;
  int64_t nnz;
  intptr_t idx;
  intptr_t values;
  cusparseIndexType_t idxType;
  cusparseIndexBase_t idxBase;
  cudaDataType valueType;
};


/* "cupy/cuda/cusparse.pxd":121
 *         public DataType valueType
 * 
 * cdef class CooAttributes:             # <<<<<<<<<<<<<<
 *     cdef:
 *         public int64_t rows
 */
struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes {
  PyObject_HEAD
  int64_t rows;
  int64_t cols;
  int64_t nnz;
  intptr_t rowIdx;
  intptr_t colIdx;
  intptr_t values;
  cusparseIndexType_t idxType;
  cusparseIndexBase_t idxBase;
  cudaDataType valueType;
};


/* "cupy/cuda/cusparse.pxd":133
 *         public DataType valueType
 * 
 * cdef class CooAoSAttributes:             # <<<<<<<<<<<<<<
 *     cdef:
 *         public int64_t rows
 */
struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes {
  PyObject_HEAD
  int64_t rows;
  int64_t cols;
  int64_t nnz;
  intptr_t ind;
  intptr_t values;
  cusparseIndexType_t idxType;
  cusparseIndexBase_t idxBase;
  cudaDataType valueType;
};


/* "cupy/cuda/cusparse.pxd":144
 *         public DataType valueType
 * 
 * cdef class CsrAttributes:             # <<<<<<<<<<<<<<
 *     cdef:
 *         public int64_t rows
 */
struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes {
  PyObject_HEAD
  int64_t rows;
  int64_t cols;
  int64_t nnz;
  intptr_t rowOffsets;
  intptr_t colIdx;
  intptr_t values;
  cusparseIndexType_t rowOffsetType;
  cusparseIndexType_t colIdxType;
  cusparseIndexBase_t idxBase;
  cudaDataType valueType;
};


/* "cupy/cuda/cusparse.pxd":157
 *         public DataType valueType
 * 
 * cdef class DnVecAttributes:             # <<<<<<<<<<<<<<
 *     cdef:
 *         public int64_t size
 */
struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes {
  PyObject_HEAD
  int64_t size;
  intptr_t values;
  cudaDataType valueType;
};


/* "cupy/cuda/cusparse.pxd":163
 *         public DataType valueType
 * 
 * cdef class DnMatAttributes:             # <<<<<<<<<<<<<<
 *     cdef:
 *         public int64_t rows
 */
struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes {
  PyObject_HEAD
  int64_t rows;
  int64_t cols;
  int64_t ld;
  intptr_t values;
  cudaDataType valueType;
  cusparseOrder_t order;
};


/* "cupy/cuda/cusparse.pxd":172
 *         public Order order
 * 
 * cdef class DnMatBatchAttributes:             # <<<<<<<<<<<<<<
 *     cdef:
 *         public int count
 */
struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes {
  PyObject_HEAD
  int count;
  int64_t stride;
};


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

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

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

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

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#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

/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

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

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
#define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

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

/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
    (likely(PyDict_CheckExact(obj)) ?\
     __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
#endif

/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
#endif

/* 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
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif

/* PyObjectCall2Args.proto */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

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

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

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

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

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);

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

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

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

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto
#define __PYX_HAVE_RT_ImportType_proto
enum __Pyx_ImportType_CheckSize {
   __Pyx_ImportType_CheckSize_Error = 0,
   __Pyx_ImportType_CheckSize_Warn = 1,
   __Pyx_ImportType_CheckSize_Ignore = 2
};
static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
#endif

/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

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

/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
#elif CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
#else
#define __Pyx_SetNameInClass(ns, name, value)  PyObject_SetItem(ns, name, value)
#endif

/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

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

/* RealImag.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if defined(__cplusplus) && CYTHON_CCOMPLEX\
        && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq_double(a, b)   ((a)==(b))
    #define __Pyx_c_sum_double(a, b)  ((a)+(b))
    #define __Pyx_c_diff_double(a, b) ((a)-(b))
    #define __Pyx_c_prod_double(a, b) ((a)*(b))
    #define __Pyx_c_quot_double(a, b) ((a)/(b))
    #define __Pyx_c_neg_double(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
    #define __Pyx_c_conj_double(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (::std::abs(z))
        #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_double(z) ((z)==0)
    #define __Pyx_c_conj_double(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (cabs(z))
        #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_cusparseIndexBase_t(cusparseIndexBase_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_cusparseIndexType_t(cusparseIndexType_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_cudaDataType(cudaDataType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_cusparseOrder_t(cusparseOrder_t value);

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

/* FromPy.proto */
static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject*);

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

/* CIntFromPy.proto */
static CYTHON_INLINE cusparseIndexBase_t __Pyx_PyInt_As_cusparseIndexBase_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE cusparseIndexType_t __Pyx_PyInt_As_cusparseIndexType_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE cudaDataType __Pyx_PyInt_As_cudaDataType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE cusparseOrder_t __Pyx_PyInt_As_cusparseOrder_t(PyObject *);

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

/* CIntFromPy.proto */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE cusparseOperation_t __Pyx_PyInt_As_cusparseOperation_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE cusparseSpMVAlg_t __Pyx_PyInt_As_cusparseSpMVAlg_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE cusparseSpMMAlg_t __Pyx_PyInt_As_cusparseSpMMAlg_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE cusparseAction_t __Pyx_PyInt_As_cusparseAction_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE cusparseCsr2CscAlg_t __Pyx_PyInt_As_cusparseCsr2CscAlg_t(PyObject *);

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

/* CIntFromPy.proto */
static CYTHON_INLINE cusparseMatrixType_t __Pyx_PyInt_As_cusparseMatrixType_t(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);

/* VoidPtrImport.proto */
static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig);

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

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


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

/* Module declarations from 'cython' */

/* Module declarations from 'cupy.cuda' */

/* Module declarations from 'cupy.cuda.driver' */

/* Module declarations from 'cupy.cuda.stream' */
static intptr_t (*__pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr)(void); /*proto*/

/* Module declarations from 'cupy.cuda.runtime' */
static PyTypeObject *__pyx_ptype_4cupy_4cuda_7runtime_PointerAttributes = 0;
static int *__pyx_vp_4cupy_4cuda_7runtime__is_hip_environment = 0;
#define __pyx_v_4cupy_4cuda_7runtime__is_hip_environment (*__pyx_vp_4cupy_4cuda_7runtime__is_hip_environment)
static int *__pyx_vp_4cupy_4cuda_7runtime_deviceAttributeComputeCapabilityMajor = 0;
#define __pyx_v_4cupy_4cuda_7runtime_deviceAttributeComputeCapabilityMajor (*__pyx_vp_4cupy_4cuda_7runtime_deviceAttributeComputeCapabilityMajor)
static int *__pyx_vp_4cupy_4cuda_7runtime_deviceAttributeComputeCapabilityMinor = 0;
#define __pyx_v_4cupy_4cuda_7runtime_deviceAttributeComputeCapabilityMinor (*__pyx_vp_4cupy_4cuda_7runtime_deviceAttributeComputeCapabilityMinor)

/* Module declarations from 'cupy.cuda.cusparse' */
static PyTypeObject *__pyx_ptype_4cupy_4cuda_8cusparse_SpVecAttributes = 0;
static PyTypeObject *__pyx_ptype_4cupy_4cuda_8cusparse_CooAttributes = 0;
static PyTypeObject *__pyx_ptype_4cupy_4cuda_8cusparse_CooAoSAttributes = 0;
static PyTypeObject *__pyx_ptype_4cupy_4cuda_8cusparse_CsrAttributes = 0;
static PyTypeObject *__pyx_ptype_4cupy_4cuda_8cusparse_DnVecAttributes = 0;
static PyTypeObject *__pyx_ptype_4cupy_4cuda_8cusparse_DnMatAttributes = 0;
static PyTypeObject *__pyx_ptype_4cupy_4cuda_8cusparse_DnMatBatchAttributes = 0;
static PyObject *__pyx_v_4cupy_4cuda_8cusparse_STATUS = 0;
static size_t __pyx_f_4cupy_4cuda_8cusparse_create(int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroy(size_t, int __pyx_skip_dispatch); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_4cupy_4cuda_8cusparse_check_status(int, int __pyx_skip_dispatch); /*proto*/
static CYTHON_INLINE cuComplex __pyx_f_4cupy_4cuda_8cusparse_complex_to_cuda(__pyx_t_double_complex); /*proto*/
static CYTHON_INLINE cuDoubleComplex __pyx_f_4cupy_4cuda_8cusparse_double_complex_to_cuda(__pyx_t_double_complex); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_getVersion(size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createMatDescr(int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroyMatDescr(size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_setMatIndexBase(size_t, PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_setMatType(size_t, PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_setPointerMode(size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_setStream(size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_getStream(size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgthr(size_t, int, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgthr(size_t, int, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgthr(size_t, int, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgthr(size_t, int, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrmv(size_t, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrmv(size_t, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrmv(size_t, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrmv(size_t, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_csrmvEx_bufferSize(size_t, int, int, int, int, int, size_t, int, size_t, size_t, int, size_t, size_t, size_t, int, size_t, int, size_t, int, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_csrmvEx(size_t, int, int, int, int, int, size_t, int, size_t, size_t, int, size_t, size_t, size_t, int, size_t, int, size_t, int, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrmm(size_t, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrmm(size_t, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrmm(size_t, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrmm(size_t, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrmm2(size_t, int, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrmm2(size_t, int, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrmm2(size_t, int, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrmm2(size_t, int, int, int, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcsrgeamNnz(size_t, int, int, size_t, int, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrgeam(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrgeam(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrgeam(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrgeam(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_scsrgeam2_bufferSizeExt(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_dcsrgeam2_bufferSizeExt(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_ccsrgeam2_bufferSizeExt(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_zcsrgeam2_bufferSizeExt(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcsrgeam2Nnz(size_t, int, int, size_t, int, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_scsrgeam2(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_dcsrgeam2(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_ccsrgeam2(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_zcsrgeam2(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcsrgemmNnz(size_t, int, int, int, int, int, size_t, int, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrgemm(size_t, int, int, int, int, int, size_t, int const , size_t, size_t, size_t, size_t, int const , size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrgemm(size_t, int, int, int, int, int, size_t, int const , size_t, size_t, size_t, size_t, int const , size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrgemm(size_t, int, int, int, int, int, size_t, int const , size_t, size_t, size_t, size_t, int const , size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrgemm(size_t, int, int, int, int, int, size_t, int const , size_t, size_t, size_t, size_t, int const , size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createCsrgemm2Info(int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroyCsrgemm2Info(size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_scsrgemm2_bufferSizeExt(size_t, int, int, int, size_t, size_t, int, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_dcsrgemm2_bufferSizeExt(size_t, int, int, int, size_t, size_t, int, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_ccsrgemm2_bufferSizeExt(size_t, int, int, int, size_t, size_t, int, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_zcsrgemm2_bufferSizeExt(size_t, int, int, int, size_t, size_t, int, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcsrgemm2Nnz(size_t, int, int, int, size_t, int, size_t, size_t, size_t, int, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrgemm2(size_t, int, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrgemm2(size_t, int, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrgemm2(size_t, int, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrgemm2(size_t, int, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcoo2csr(size_t, size_t, int, int, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsc2dense(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsc2dense(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsc2dense(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsc2dense(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcsr2coo(size_t, size_t, int, int, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsr2csc(size_t, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsr2csc(size_t, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsr2csc(size_t, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsr2csc(size_t, int, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsr2dense(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsr2dense(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsr2dense(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsr2dense(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_snnz_compress(size_t, int, size_t, size_t, size_t, size_t, float, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dnnz_compress(size_t, int, size_t, size_t, size_t, size_t, double, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cnnz_compress(size_t, int, size_t, size_t, size_t, size_t, __pyx_t_double_complex, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_znnz_compress(size_t, int, size_t, size_t, size_t, size_t, __pyx_t_double_complex, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsr2csr_compress(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, float, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsr2csr_compress(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, float, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsr2csr_compress(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, __pyx_t_double_complex, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsr2csr_compress(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, size_t, size_t, size_t, __pyx_t_double_complex, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sdense2csc(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ddense2csc(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cdense2csc(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zdense2csc(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sdense2csr(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ddense2csr(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cdense2csr(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zdense2csr(size_t, int, int, size_t, size_t, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_snnz(size_t, int, int, int, size_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dnnz(size_t, int, int, int, size_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cnnz(size_t, int, int, int, size_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_znnz(size_t, int, int, int, size_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_createIdentityPermutation(size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_xcoosort_bufferSizeExt(size_t, int, int, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcoosortByRow(size_t, int, int, int, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_xcsrsort_bufferSizeExt(size_t, int, int, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcsrsort(size_t, int, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_xcscsort_bufferSizeExt(size_t, int, int, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcscsort(size_t, int, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createCsrilu02Info(int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroyCsrilu02Info(size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createBsrilu02Info(int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroyBsrilu02Info(size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createCsric02Info(int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroyCsric02Info(size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createBsric02Info(int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroyBsric02Info(size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrilu02_numericBoost(size_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrilu02_numericBoost(size_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrilu02_numericBoost(size_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrilu02_numericBoost(size_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcsrilu02_zeroPivot(size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_scsrilu02_bufferSize(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_dcsrilu02_bufferSize(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_ccsrilu02_bufferSize(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_zcsrilu02_bufferSize(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrilu02_analysis(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrilu02_analysis(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrilu02_analysis(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrilu02_analysis(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrilu02(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrilu02(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrilu02(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrilu02(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sbsrilu02_numericBoost(size_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dbsrilu02_numericBoost(size_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cbsrilu02_numericBoost(size_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zbsrilu02_numericBoost(size_t, size_t, int, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xbsrilu02_zeroPivot(size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_sbsrilu02_bufferSize(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_dbsrilu02_bufferSize(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_cbsrilu02_bufferSize(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_zbsrilu02_bufferSize(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sbsrilu02_analysis(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dbsrilu02_analysis(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cbsrilu02_analysis(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zbsrilu02_analysis(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sbsrilu02(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dbsrilu02(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cbsrilu02(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zbsrilu02(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcsric02_zeroPivot(size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_scsric02_bufferSize(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_dcsric02_bufferSize(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_ccsric02_bufferSize(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_zcsric02_bufferSize(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsric02_analysis(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsric02_analysis(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsric02_analysis(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsric02_analysis(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsric02(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsric02(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsric02(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsric02(size_t, int, int, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xbsric02_zeroPivot(size_t, size_t, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_sbsric02_bufferSize(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_dbsric02_bufferSize(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_cbsric02_bufferSize(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_zbsric02_bufferSize(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sbsric02_analysis(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dbsric02_analysis(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cbsric02_analysis(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zbsric02_analysis(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sbsric02(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dbsric02(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cbsric02(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zbsric02(size_t, int, int, int, size_t, size_t, size_t, size_t, int, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgtsv2_bufferSizeExt(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgtsv2_bufferSizeExt(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgtsv2_bufferSizeExt(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgtsv2_bufferSizeExt(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgtsv2(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgtsv2(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgtsv2(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgtsv2(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgtsv2_nopivot_bufferSizeExt(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgtsv2_nopivot_bufferSizeExt(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgtsv2_nopivot_bufferSizeExt(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgtsv2_nopivot_bufferSizeExt(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgtsv2_nopivot(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgtsv2_nopivot(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgtsv2_nopivot(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgtsv2_nopivot(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgtsv2StridedBatch_bufferSizeExt(size_t, int, size_t, size_t, size_t, size_t, int, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgtsv2StridedBatch_bufferSizeExt(size_t, int, size_t, size_t, size_t, size_t, int, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgtsv2StridedBatch_bufferSizeExt(size_t, int, size_t, size_t, size_t, size_t, int, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgtsv2StridedBatch_bufferSizeExt(size_t, int, size_t, size_t, size_t, size_t, int, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgtsv2StridedBatch(size_t, int, size_t, size_t, size_t, size_t, int, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgtsv2StridedBatch(size_t, int, size_t, size_t, size_t, size_t, int, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgtsv2StridedBatch(size_t, int, size_t, size_t, size_t, size_t, int, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgtsv2StridedBatch(size_t, int, size_t, size_t, size_t, size_t, int, int, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_sgtsvInterleavedBatch_bufferSizeExt(size_t, int, int, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_dgtsvInterleavedBatch_bufferSizeExt(size_t, int, int, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_cgtsvInterleavedBatch_bufferSizeExt(size_t, int, int, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_zgtsvInterleavedBatch_bufferSizeExt(size_t, int, int, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgtsvInterleavedBatch(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgtsvInterleavedBatch(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgtsvInterleavedBatch(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgtsvInterleavedBatch(size_t, int, int, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_sgpsvInterleavedBatch_bufferSizeExt(size_t, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_dgpsvInterleavedBatch_bufferSizeExt(size_t, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_cgpsvInterleavedBatch_bufferSizeExt(size_t, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_zgpsvInterleavedBatch_bufferSizeExt(size_t, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgpsvInterleavedBatch(size_t, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgpsvInterleavedBatch(size_t, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgpsvInterleavedBatch(size_t, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgpsvInterleavedBatch(size_t, int, int, size_t, size_t, size_t, size_t, size_t, size_t, int, size_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createSpVec(int64_t, int64_t, intptr_t, intptr_t, cusparseIndexType_t, cusparseIndexBase_t, cudaDataType, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroySpVec(size_t, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_f_4cupy_4cuda_8cusparse_spVecGet(size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_spVecGetIndexBase(size_t, int __pyx_skip_dispatch); /*proto*/
static intptr_t __pyx_f_4cupy_4cuda_8cusparse_spVecGetValues(size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_spVecSetValues(size_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createCoo(int64_t, int64_t, int64_t, intptr_t, intptr_t, intptr_t, cusparseIndexType_t, cusparseIndexBase_t, cudaDataType, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createCooAoS(int64_t, int64_t, int64_t, intptr_t, intptr_t, cusparseIndexType_t, cusparseIndexBase_t, cudaDataType, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createCsr(int64_t, int64_t, int64_t, intptr_t, intptr_t, intptr_t, cusparseIndexType_t, cusparseIndexType_t, cusparseIndexBase_t, cudaDataType, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroySpMat(size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cooGet(size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cooAoSGet(size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_csrGet(size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_spMatGetFormat(size_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_spMatGetIndexBase(size_t, int __pyx_skip_dispatch); /*proto*/
static intptr_t __pyx_f_4cupy_4cuda_8cusparse_spMatGetValues(size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_spMatSetValues(size_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_spMatGetStridedBatch(size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_spMatSetStridedBatch(size_t, int, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createDnVec(int64_t, intptr_t, cudaDataType, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroyDnVec(size_t, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_f_4cupy_4cuda_8cusparse_dnVecGet(size_t, int __pyx_skip_dispatch); /*proto*/
static intptr_t __pyx_f_4cupy_4cuda_8cusparse_dnVecGetValues(size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dnVecSetValues(size_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createDnMat(int64_t, int64_t, int64_t, intptr_t, cudaDataType, cusparseOrder_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroyDnMat(size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dnMatGet(size_t, int __pyx_skip_dispatch); /*proto*/
static intptr_t __pyx_f_4cupy_4cuda_8cusparse_dnMatGetValues(size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dnMatSetValues(size_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_f_4cupy_4cuda_8cusparse_dnMatGetStridedBatch(size_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dnMatSetStridedBatch(size_t, int, int64_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_spVV_bufferSize(intptr_t, cusparseOperation_t, size_t, size_t, intptr_t, cudaDataType, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_spVV(intptr_t, cusparseOperation_t, size_t, size_t, intptr_t, cudaDataType, intptr_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_spMV_bufferSize(intptr_t, cusparseOperation_t, intptr_t, size_t, size_t, intptr_t, size_t, cudaDataType, cusparseSpMVAlg_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_spMV(intptr_t, cusparseOperation_t, intptr_t, size_t, size_t, intptr_t, size_t, cudaDataType, cusparseSpMVAlg_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_spMM_bufferSize(intptr_t, cusparseOperation_t, cusparseOperation_t, intptr_t, size_t, size_t, intptr_t, size_t, cudaDataType, cusparseSpMMAlg_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_spMM(intptr_t, cusparseOperation_t, cusparseOperation_t, intptr_t, size_t, size_t, intptr_t, size_t, cudaDataType, cusparseSpMMAlg_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_constrainedGeMM_bufferSize(intptr_t, cusparseOperation_t, cusparseOperation_t, intptr_t, size_t, size_t, intptr_t, size_t, cudaDataType, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_constrainedGeMM(intptr_t, cusparseOperation_t, cusparseOperation_t, intptr_t, size_t, size_t, intptr_t, size_t, cudaDataType, intptr_t, int __pyx_skip_dispatch); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_csr2cscEx2_bufferSize(intptr_t, int, int, int, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, cudaDataType, cusparseAction_t, cusparseIndexBase_t, cusparseCsr2CscAlg_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_csr2cscEx2(intptr_t, int, int, int, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, cudaDataType, cusparseAction_t, cusparseIndexBase_t, cusparseCsr2CscAlg_t, intptr_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_SpVecAttributes__set_state(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *, PyObject *); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_CooAttributes__set_state(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *, PyObject *); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_CooAoSAttributes__set_state(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *, PyObject *); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_CsrAttributes__set_state(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *, PyObject *); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_DnVecAttributes__set_state(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *, PyObject *); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_DnMatAttributes__set_state(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *, PyObject *); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_DnMatBatchAttributes__set_state(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *, PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "cupy.cuda.cusparse"
extern int __pyx_module_is_main_cupy__cuda__cusparse;
int __pyx_module_is_main_cupy__cuda__cusparse = 0;

/* Implementation of 'cupy.cuda.cusparse' */
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_super;
static const char __pyx_k_A[] = "A";
static const char __pyx_k_B[] = "B";
static const char __pyx_k_C[] = "C";
static const char __pyx_k_P[] = "P";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_k[] = "k";
static const char __pyx_k_m[] = "m";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_p[] = "p";
static const char __pyx_k_s[] = "%s";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_y[] = "y";
static const char __pyx_k_dl[] = "dl";
static const char __pyx_k_ds[] = "ds";
static const char __pyx_k_du[] = "du";
static const char __pyx_k_dw[] = "dw";
static const char __pyx_k_ld[] = "ld";
static const char __pyx_k_mb[] = "mb";
static const char __pyx_k_alg[] = "alg";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_idx[] = "idx";
static const char __pyx_k_ind[] = "ind";
static const char __pyx_k_lda[] = "lda";
static const char __pyx_k_ldb[] = "ldb";
static const char __pyx_k_ldc[] = "ldc";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_nnz[] = "nnz";
static const char __pyx_k_opA[] = "opA";
static const char __pyx_k_opB[] = "opB";
static const char __pyx_k_opX[] = "opX";
static const char __pyx_k_tol[] = "tol";
static const char __pyx_k_typ[] = "typ";
static const char __pyx_k_algo[] = "algo";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_beta[] = "beta";
static const char __pyx_k_cols[] = "cols";
static const char __pyx_k_desc[] = "desc";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_dirA[] = "dirA";
static const char __pyx_k_info[] = "info";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_matA[] = "matA";
static const char __pyx_k_matB[] = "matB";
static const char __pyx_k_matC[] = "matC";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_nnzA[] = "nnzA";
static const char __pyx_k_nnzB[] = "nnzB";
static const char __pyx_k_nnzD[] = "nnzD";
static const char __pyx_k_nnzb[] = "nnzb";
static const char __pyx_k_rows[] = "rows";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_vecX[] = "vecX";
static const char __pyx_k_vecY[] = "vecY";
static const char __pyx_k_xInd[] = "xInd";
static const char __pyx_k_xVal[] = "xVal";
static const char __pyx_k_alpha[] = "alpha";
static const char __pyx_k_count[] = "count";
static const char __pyx_k_descr[] = "descr";
static const char __pyx_k_inNnz[] = "inNnz";
static const char __pyx_k_inVal[] = "inVal";
static const char __pyx_k_order[] = "order";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_xtype[] = "xtype";
static const char __pyx_k_ytype[] = "ytype";
static const char __pyx_k_buffer[] = "buffer";
static const char __pyx_k_colIdx[] = "colIdx";
static const char __pyx_k_cooInd[] = "cooInd";
static const char __pyx_k_cscVal[] = "cscVal";
static const char __pyx_k_csrVal[] = "csrVal";
static const char __pyx_k_descrA[] = "descrA";
static const char __pyx_k_descrB[] = "descrB";
static const char __pyx_k_descrC[] = "descrC";
static const char __pyx_k_descrD[] = "descrD";
static const char __pyx_k_handle[] = "handle";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_outVal[] = "outVal";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_policy[] = "policy";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_rowIdx[] = "rowIdx";
static const char __pyx_k_rowPtr[] = "rowPtr";
static const char __pyx_k_status[] = "status";
static const char __pyx_k_stream[] = "stream";
static const char __pyx_k_stride[] = "stride";
static const char __pyx_k_transA[] = "transA";
static const char __pyx_k_transB[] = "transB";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_cooCols[] = "cooCols";
static const char __pyx_k_cooRows[] = "cooRows";
static const char __pyx_k_cscValA[] = "cscValA";
static const char __pyx_k_csrValA[] = "csrValA";
static const char __pyx_k_csrValB[] = "csrValB";
static const char __pyx_k_csrValC[] = "csrValC";
static const char __pyx_k_csrValD[] = "csrValD";
static const char __pyx_k_idxBase[] = "idxBase";
static const char __pyx_k_idxType[] = "idxType";
static const char __pyx_k_indices[] = "indices";
static const char __pyx_k_pBuffer[] = "pBuffer";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_valType[] = "valType";
static const char __pyx_k_betatype[] = "betatype";
static const char __pyx_k_blockDim[] = "blockDim";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_inColInd[] = "inColInd";
static const char __pyx_k_inRowPtr[] = "inRowPtr";
static const char __pyx_k_position[] = "position";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_alphatype[] = "alphatype";
static const char __pyx_k_boost_val[] = "boost_val";
static const char __pyx_k_cooColInd[] = "cooColInd";
static const char __pyx_k_cooRowInd[] = "cooRowInd";
static const char __pyx_k_cooValues[] = "cooValues";
static const char __pyx_k_cscColPtr[] = "cscColPtr";
static const char __pyx_k_cscRowInd[] = "cscRowInd";
static const char __pyx_k_csrColInd[] = "csrColInd";
static const char __pyx_k_csrColind[] = "csrColind";
static const char __pyx_k_csrRowPtr[] = "csrRowPtr";
static const char __pyx_k_csrValues[] = "csrValues";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_nnzPerCol[] = "nnzPerCol";
static const char __pyx_k_nnzPerRow[] = "nnzPerRow";
static const char __pyx_k_outColInd[] = "outColInd";
static const char __pyx_k_outRowPtr[] = "outRowPtr";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_valueType[] = "valueType";
static const char __pyx_k_workspace[] = "workspace";
static const char __pyx_k_batchCount[] = "batchCount";
static const char __pyx_k_colIdxType[] = "colIdxType";
static const char __pyx_k_cooIdxType[] = "cooIdxType";
static const char __pyx_k_copyValues[] = "copyValues";
static const char __pyx_k_cscColPtrA[] = "cscColPtrA";
static const char __pyx_k_cscRowIndA[] = "cscRowIndA";
static const char __pyx_k_csrColIndA[] = "csrColIndA";
static const char __pyx_k_csrColIndB[] = "csrColIndB";
static const char __pyx_k_csrColIndC[] = "csrColIndC";
static const char __pyx_k_csrColIndD[] = "csrColIndD";
static const char __pyx_k_csrRowPtrA[] = "csrRowPtrA";
static const char __pyx_k_csrRowPtrB[] = "csrRowPtrB";
static const char __pyx_k_csrRowPtrC[] = "csrRowPtrC";
static const char __pyx_k_csrRowPtrD[] = "csrRowPtrD";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_rowOffsets[] = "rowOffsets";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_batchStride[] = "batchStride";
static const char __pyx_k_computeType[] = "computeType";
static const char __pyx_k_csrValAtype[] = "csrValAtype";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_bsrSortedVal[] = "bsrSortedVal";
static const char __pyx_k_enable_boost[] = "enable_boost";
static const char __pyx_k_pInputBuffer[] = "pInputBuffer";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_stringsource[] = "stringsource";
static const char __pyx_k_CooAttributes[] = "CooAttributes";
static const char __pyx_k_CsrAttributes[] = "CsrAttributes";
static const char __pyx_k_CuSparseError[] = "CuSparseError";
static const char __pyx_k_cscSortedValA[] = "cscSortedValA";
static const char __pyx_k_csrColIndType[] = "csrColIndType";
static const char __pyx_k_csrRowOffsets[] = "csrRowOffsets";
static const char __pyx_k_csrSortedValA[] = "csrSortedValA";
static const char __pyx_k_executiontype[] = "executiontype";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_rowOffsetType[] = "rowOffsetType";
static const char __pyx_k_externalBuffer[] = "externalBuffer";
static const char __pyx_k_DnMatAttributes[] = "DnMatAttributes";
static const char __pyx_k_DnVecAttributes[] = "DnVecAttributes";
static const char __pyx_k_SpVecAttributes[] = "SpVecAttributes";
static const char __pyx_k_bsrSortedColInd[] = "bsrSortedColInd";
static const char __pyx_k_bsrSortedRowPtr[] = "bsrSortedRowPtr";
static const char __pyx_k_nnzPerRowColumn[] = "nnzPerRowColumn";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_CooAoSAttributes[] = "CooAoSAttributes";
static const char __pyx_k_cscSortedColPtrA[] = "cscSortedColPtrA";
static const char __pyx_k_cscSortedRowIndA[] = "cscSortedRowIndA";
static const char __pyx_k_csrSortedColIndA[] = "csrSortedColIndA";
static const char __pyx_k_csrSortedRowPtrA[] = "csrSortedRowPtrA";
static const char __pyx_k_bufferSizeInBytes[] = "bufferSizeInBytes";
static const char __pyx_k_csrRowOffsetsType[] = "csrRowOffsetsType";
static const char __pyx_k_get_build_version[] = "get_build_version";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_csrSortedValA_valM[] = "csrSortedValA_valM";
static const char __pyx_k_cupy_cuda_cusparse[] = "cupy.cuda.cusparse";
static const char __pyx_k_nnzTotalDevHostPtr[] = "nnzTotalDevHostPtr";
static const char __pyx_k_CuSparseError___init[] = "CuSparseError.__init__";
static const char __pyx_k_DnMatBatchAttributes[] = "DnMatBatchAttributes";
static const char __pyx_k_CuSparseError___reduce[] = "CuSparseError.__reduce__";
static const char __pyx_k_cupy_cuda_cusparse_pyx[] = "cupy/cuda/cusparse.pyx";
static const char __pyx_k_CUSPARSE_STATUS_SUCCESS[] = "CUSPARSE_STATUS_SUCCESS";
static const char __pyx_k_CUSPARSE_STATUS_ZERO_PIVOT[] = "CUSPARSE_STATUS_ZERO_PIVOT";
static const char __pyx_k_pyx_unpickle_CooAttributes[] = "__pyx_unpickle_CooAttributes";
static const char __pyx_k_pyx_unpickle_CsrAttributes[] = "__pyx_unpickle_CsrAttributes";
static const char __pyx_k_CUSPARSE_STATUS_ALLOC_FAILED[] = "CUSPARSE_STATUS_ALLOC_FAILED";
static const char __pyx_k_pyx_unpickle_DnMatAttributes[] = "__pyx_unpickle_DnMatAttributes";
static const char __pyx_k_pyx_unpickle_DnVecAttributes[] = "__pyx_unpickle_DnVecAttributes";
static const char __pyx_k_pyx_unpickle_SpVecAttributes[] = "__pyx_unpickle_SpVecAttributes";
static const char __pyx_k_CUSPARSE_STATUS_ARCH_MISMATCH[] = "CUSPARSE_STATUS_ARCH_MISMATCH";
static const char __pyx_k_CUSPARSE_STATUS_INVALID_VALUE[] = "CUSPARSE_STATUS_INVALID_VALUE";
static const char __pyx_k_CUSPARSE_STATUS_MAPPING_ERROR[] = "CUSPARSE_STATUS_MAPPING_ERROR";
static const char __pyx_k_CUSPARSE_STATUS_NOT_SUPPORTED[] = "CUSPARSE_STATUS_NOT_SUPPORTED";
static const char __pyx_k_pyx_unpickle_CooAoSAttributes[] = "__pyx_unpickle_CooAoSAttributes";
static const char __pyx_k_CUSPARSE_STATUS_INTERNAL_ERROR[] = "CUSPARSE_STATUS_INTERNAL_ERROR";
static const char __pyx_k_pyx_unpickle_DnMatBatchAttribu[] = "__pyx_unpickle_DnMatBatchAttributes";
static const char __pyx_k_CUSPARSE_STATUS_MATRIX_TYPE_NOT[] = "CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED";
static const char __pyx_k_CUSPARSE_STATUS_NOT_INITIALIZED[] = "CUSPARSE_STATUS_NOT_INITIALIZED";
static const char __pyx_k_CUSPARSE_STATUS_EXECUTION_FAILED[] = "CUSPARSE_STATUS_EXECUTION_FAILED";
static const char __pyx_k_Incompatible_checksums_s_vs_0x09[] = "Incompatible checksums (%s vs 0x09bcd38 = (colIdx, colIdxType, cols, idxBase, nnz, rowOffsetType, rowOffsets, rows, valueType, values))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x41[] = "Incompatible checksums (%s vs 0x41fb826 = (colIdx, cols, idxBase, idxType, nnz, rowIdx, rows, valueType, values))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x7f[] = "Incompatible checksums (%s vs 0x7f92e3a = (idx, idxBase, idxType, nnz, size, valueType, values))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x9d[] = "Incompatible checksums (%s vs 0x9d3053a = (cols, ld, order, rows, valueType, values))";
static const char __pyx_k_Incompatible_checksums_s_vs_0xb6[] = "Incompatible checksums (%s vs 0xb66dd58 = (count, stride))";
static const char __pyx_k_Incompatible_checksums_s_vs_0xcb[] = "Incompatible checksums (%s vs 0xcbbe7db = (size, valueType, values))";
static const char __pyx_k_Incompatible_checksums_s_vs_0xd3[] = "Incompatible checksums (%s vs 0xd3613df = (cols, idxBase, idxType, ind, nnz, rows, valueType, values))";
static PyObject *__pyx_n_s_A;
static PyObject *__pyx_n_s_B;
static PyObject *__pyx_n_s_C;
static PyObject *__pyx_n_u_CUSPARSE_STATUS_ALLOC_FAILED;
static PyObject *__pyx_n_u_CUSPARSE_STATUS_ARCH_MISMATCH;
static PyObject *__pyx_n_u_CUSPARSE_STATUS_EXECUTION_FAILED;
static PyObject *__pyx_n_u_CUSPARSE_STATUS_INTERNAL_ERROR;
static PyObject *__pyx_n_u_CUSPARSE_STATUS_INVALID_VALUE;
static PyObject *__pyx_n_u_CUSPARSE_STATUS_MAPPING_ERROR;
static PyObject *__pyx_n_u_CUSPARSE_STATUS_MATRIX_TYPE_NOT;
static PyObject *__pyx_n_u_CUSPARSE_STATUS_NOT_INITIALIZED;
static PyObject *__pyx_n_u_CUSPARSE_STATUS_NOT_SUPPORTED;
static PyObject *__pyx_n_u_CUSPARSE_STATUS_SUCCESS;
static PyObject *__pyx_n_u_CUSPARSE_STATUS_ZERO_PIVOT;
static PyObject *__pyx_n_s_CooAoSAttributes;
static PyObject *__pyx_n_s_CooAttributes;
static PyObject *__pyx_n_s_CsrAttributes;
static PyObject *__pyx_n_s_CuSparseError;
static PyObject *__pyx_n_s_CuSparseError___init;
static PyObject *__pyx_n_s_CuSparseError___reduce;
static PyObject *__pyx_n_s_DnMatAttributes;
static PyObject *__pyx_n_s_DnMatBatchAttributes;
static PyObject *__pyx_n_s_DnVecAttributes;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x09;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x41;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x7f;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x9d;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb6;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xcb;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xd3;
static PyObject *__pyx_n_s_P;
static PyObject *__pyx_n_s_PickleError;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_SpVecAttributes;
static PyObject *__pyx_n_s_alg;
static PyObject *__pyx_n_s_algo;
static PyObject *__pyx_n_s_alpha;
static PyObject *__pyx_n_s_alphatype;
static PyObject *__pyx_n_s_base;
static PyObject *__pyx_n_s_batchCount;
static PyObject *__pyx_n_s_batchStride;
static PyObject *__pyx_n_s_beta;
static PyObject *__pyx_n_s_betatype;
static PyObject *__pyx_n_s_blockDim;
static PyObject *__pyx_n_s_boost_val;
static PyObject *__pyx_n_s_bsrSortedColInd;
static PyObject *__pyx_n_s_bsrSortedRowPtr;
static PyObject *__pyx_n_s_bsrSortedVal;
static PyObject *__pyx_n_s_buffer;
static PyObject *__pyx_n_s_bufferSizeInBytes;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_colIdx;
static PyObject *__pyx_n_s_colIdxType;
static PyObject *__pyx_n_s_cols;
static PyObject *__pyx_n_s_computeType;
static PyObject *__pyx_n_s_cooColInd;
static PyObject *__pyx_n_s_cooCols;
static PyObject *__pyx_n_s_cooIdxType;
static PyObject *__pyx_n_s_cooInd;
static PyObject *__pyx_n_s_cooRowInd;
static PyObject *__pyx_n_s_cooRows;
static PyObject *__pyx_n_s_cooValues;
static PyObject *__pyx_n_s_copyValues;
static PyObject *__pyx_n_s_count;
static PyObject *__pyx_n_s_cscColPtr;
static PyObject *__pyx_n_s_cscColPtrA;
static PyObject *__pyx_n_s_cscRowInd;
static PyObject *__pyx_n_s_cscRowIndA;
static PyObject *__pyx_n_s_cscSortedColPtrA;
static PyObject *__pyx_n_s_cscSortedRowIndA;
static PyObject *__pyx_n_s_cscSortedValA;
static PyObject *__pyx_n_s_cscVal;
static PyObject *__pyx_n_s_cscValA;
static PyObject *__pyx_n_s_csrColInd;
static PyObject *__pyx_n_s_csrColIndA;
static PyObject *__pyx_n_s_csrColIndB;
static PyObject *__pyx_n_s_csrColIndC;
static PyObject *__pyx_n_s_csrColIndD;
static PyObject *__pyx_n_s_csrColIndType;
static PyObject *__pyx_n_s_csrColind;
static PyObject *__pyx_n_s_csrRowOffsets;
static PyObject *__pyx_n_s_csrRowOffsetsType;
static PyObject *__pyx_n_s_csrRowPtr;
static PyObject *__pyx_n_s_csrRowPtrA;
static PyObject *__pyx_n_s_csrRowPtrB;
static PyObject *__pyx_n_s_csrRowPtrC;
static PyObject *__pyx_n_s_csrRowPtrD;
static PyObject *__pyx_n_s_csrSortedColIndA;
static PyObject *__pyx_n_s_csrSortedRowPtrA;
static PyObject *__pyx_n_s_csrSortedValA;
static PyObject *__pyx_n_s_csrSortedValA_valM;
static PyObject *__pyx_n_s_csrVal;
static PyObject *__pyx_n_s_csrValA;
static PyObject *__pyx_n_s_csrValAtype;
static PyObject *__pyx_n_s_csrValB;
static PyObject *__pyx_n_s_csrValC;
static PyObject *__pyx_n_s_csrValD;
static PyObject *__pyx_n_s_csrValues;
static PyObject *__pyx_n_s_cupy_cuda_cusparse;
static PyObject *__pyx_kp_s_cupy_cuda_cusparse_pyx;
static PyObject *__pyx_n_s_d;
static PyObject *__pyx_n_s_desc;
static PyObject *__pyx_n_s_descr;
static PyObject *__pyx_n_s_descrA;
static PyObject *__pyx_n_s_descrB;
static PyObject *__pyx_n_s_descrC;
static PyObject *__pyx_n_s_descrD;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_dirA;
static PyObject *__pyx_n_s_dl;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_ds;
static PyObject *__pyx_n_s_du;
static PyObject *__pyx_n_s_dw;
static PyObject *__pyx_n_s_enable_boost;
static PyObject *__pyx_n_s_executiontype;
static PyObject *__pyx_n_s_externalBuffer;
static PyObject *__pyx_n_s_get_build_version;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_handle;
static PyObject *__pyx_n_s_idx;
static PyObject *__pyx_n_s_idxBase;
static PyObject *__pyx_n_s_idxType;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_inColInd;
static PyObject *__pyx_n_s_inNnz;
static PyObject *__pyx_n_s_inRowPtr;
static PyObject *__pyx_n_s_inVal;
static PyObject *__pyx_n_s_ind;
static PyObject *__pyx_n_s_indices;
static PyObject *__pyx_n_s_info;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_k;
static PyObject *__pyx_n_s_ld;
static PyObject *__pyx_n_s_lda;
static PyObject *__pyx_n_s_ldb;
static PyObject *__pyx_n_s_ldc;
static PyObject *__pyx_n_s_m;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_matA;
static PyObject *__pyx_n_s_matB;
static PyObject *__pyx_n_s_matC;
static PyObject *__pyx_n_s_mb;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_nnz;
static PyObject *__pyx_n_s_nnzA;
static PyObject *__pyx_n_s_nnzB;
static PyObject *__pyx_n_s_nnzD;
static PyObject *__pyx_n_s_nnzPerCol;
static PyObject *__pyx_n_s_nnzPerRow;
static PyObject *__pyx_n_s_nnzPerRowColumn;
static PyObject *__pyx_n_s_nnzTotalDevHostPtr;
static PyObject *__pyx_n_s_nnzb;
static PyObject *__pyx_n_s_opA;
static PyObject *__pyx_n_s_opB;
static PyObject *__pyx_n_s_opX;
static PyObject *__pyx_n_s_order;
static PyObject *__pyx_n_s_outColInd;
static PyObject *__pyx_n_s_outRowPtr;
static PyObject *__pyx_n_s_outVal;
static PyObject *__pyx_n_s_p;
static PyObject *__pyx_n_s_pBuffer;
static PyObject *__pyx_n_s_pInputBuffer;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_s_policy;
static PyObject *__pyx_n_s_position;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_pyx_PickleError;
static PyObject *__pyx_n_s_pyx_checksum;
static PyObject *__pyx_n_s_pyx_result;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_pyx_type;
static PyObject *__pyx_n_s_pyx_unpickle_CooAoSAttributes;
static PyObject *__pyx_n_s_pyx_unpickle_CooAttributes;
static PyObject *__pyx_n_s_pyx_unpickle_CsrAttributes;
static PyObject *__pyx_n_s_pyx_unpickle_DnMatAttributes;
static PyObject *__pyx_n_s_pyx_unpickle_DnMatBatchAttribu;
static PyObject *__pyx_n_s_pyx_unpickle_DnVecAttributes;
static PyObject *__pyx_n_s_pyx_unpickle_SpVecAttributes;
static PyObject *__pyx_n_s_qualname;
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_result;
static PyObject *__pyx_n_s_rowIdx;
static PyObject *__pyx_n_s_rowOffsetType;
static PyObject *__pyx_n_s_rowOffsets;
static PyObject *__pyx_n_s_rowPtr;
static PyObject *__pyx_n_s_rows;
static PyObject *__pyx_kp_u_s;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_status;
static PyObject *__pyx_n_s_stream;
static PyObject *__pyx_n_s_stride;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_tol;
static PyObject *__pyx_n_s_transA;
static PyObject *__pyx_n_s_transB;
static PyObject *__pyx_n_s_typ;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_valType;
static PyObject *__pyx_n_s_valueType;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_vecX;
static PyObject *__pyx_n_s_vecY;
static PyObject *__pyx_n_s_workspace;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_xInd;
static PyObject *__pyx_n_s_xVal;
static PyObject *__pyx_n_s_xtype;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_ytype;
static int __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes___init__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, int64_t __pyx_v_size, int64_t __pyx_v_nnz, intptr_t __pyx_v_idx, intptr_t __pyx_v_values, cusparseIndexType_t __pyx_v_idxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_4size___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_4size_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_3nnz___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_3nnz_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_3idx___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_3idx_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_6values___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_6values_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxBase___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxBase_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_9valueType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_9valueType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_2__reduce_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_4__setstate_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes___init__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_rowIdx, intptr_t __pyx_v_colIdx, intptr_t __pyx_v_values, cusparseIndexType_t __pyx_v_idxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_4rows___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_4rows_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_4cols___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_4cols_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_3nnz___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_3nnz_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6rowIdx___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6rowIdx_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6colIdx___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6colIdx_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6values___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6values_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_7idxType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_7idxType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_7idxBase___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_7idxBase_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_9valueType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_9valueType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_2__reduce_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_4__setstate_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes___init__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_ind, intptr_t __pyx_v_values, cusparseIndexType_t __pyx_v_idxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_4rows___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_4rows_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_4cols___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_4cols_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_3nnz___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_3nnz_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_3ind___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_3ind_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_6values___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_6values_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxBase___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxBase_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_9valueType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_9valueType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_2__reduce_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_4__setstate_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes___init__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_rowOffsets, intptr_t __pyx_v_colIdx, intptr_t __pyx_v_values, cusparseIndexType_t __pyx_v_rowOffsetType, cusparseIndexType_t __pyx_v_colIdxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_4rows___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_4rows_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_4cols___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_4cols_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_3nnz___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_3nnz_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_10rowOffsets___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_10rowOffsets_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_6colIdx___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_6colIdx_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_6values___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_6values_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_13rowOffsetType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_13rowOffsetType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_10colIdxType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_10colIdxType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_7idxBase___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_7idxBase_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_9valueType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_9valueType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_2__reduce_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_4__setstate_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes___init__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self, int64_t __pyx_v_size, intptr_t __pyx_v_values, cudaDataType __pyx_v_valueType); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_4size___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_4size_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_6values___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_6values_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_9valueType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_9valueType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_2__reduce_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_4__setstate_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes___init__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_ld, intptr_t __pyx_v_values, cudaDataType __pyx_v_valueType, cusparseOrder_t __pyx_v_order); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_4rows___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_4rows_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_4cols___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_4cols_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_2ld___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_2ld_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_6values___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_6values_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_9valueType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_9valueType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_5order___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_5order_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_2__reduce_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_4__setstate_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes___init__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_v_self, int __pyx_v_count, int64_t __pyx_v_stride); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_5count___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_5count_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_6stride___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_v_self); /* proto */
static int __pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_6stride_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_2__reduce_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_4__setstate_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CuSparseError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_status); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CuSparseError_2__reduce__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_check_status(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_status); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_2getVersion(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_4get_build_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_6create(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_8createMatDescr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_10destroy(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_12destroyMatDescr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_descr); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_14setMatIndexBase(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_descr, PyObject *__pyx_v_base); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16setMatType(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_descr, PyObject *__pyx_v_typ); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_18setPointerMode(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_mode); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_20setStream(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_stream); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_22getStream(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_24sgthr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_nnz, size_t __pyx_v_y, size_t __pyx_v_xVal, size_t __pyx_v_xInd, int __pyx_v_idxBase); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_26dgthr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_nnz, size_t __pyx_v_y, size_t __pyx_v_xVal, size_t __pyx_v_xInd, int __pyx_v_idxBase); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_28cgthr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_nnz, size_t __pyx_v_y, size_t __pyx_v_xVal, size_t __pyx_v_xInd, int __pyx_v_idxBase); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_30zgthr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_nnz, size_t __pyx_v_y, size_t __pyx_v_xVal, size_t __pyx_v_xInd, int __pyx_v_idxBase); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_32scsrmv(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_x, size_t __pyx_v_beta, size_t __pyx_v_y); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_34dcsrmv(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_x, size_t __pyx_v_beta, size_t __pyx_v_y); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_36ccsrmv(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_x, size_t __pyx_v_beta, size_t __pyx_v_y); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_38zcsrmv(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_x, size_t __pyx_v_beta, size_t __pyx_v_y); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_40csrmvEx_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_alg, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, int __pyx_v_alphatype, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, int __pyx_v_csrValAtype, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_x, int __pyx_v_xtype, size_t __pyx_v_beta, int __pyx_v_betatype, size_t __pyx_v_y, int __pyx_v_ytype, int __pyx_v_executiontype); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_42csrmvEx(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_alg, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, int __pyx_v_alphatype, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, int __pyx_v_csrValAtype, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_x, int __pyx_v_xtype, size_t __pyx_v_beta, int __pyx_v_betatype, size_t __pyx_v_y, int __pyx_v_ytype, int __pyx_v_executiontype, size_t __pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_44scsrmm(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_46dcsrmm(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_48ccsrmm(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_50zcsrmm(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_52scsrmm2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_54dcsrmm2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_56ccsrmm2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_58zcsrmm2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_60xcsrgeamNnz(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_nnzTotalDevHostPtr); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_62scsrgeam(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_64dcsrgeam(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_66ccsrgeam(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_68zcsrgeam(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_70scsrgeam2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_72dcsrgeam2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_74ccsrgeam2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_76zcsrgeam2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_78xcsrgeam2Nnz(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_nnzTotalDevHostPtr, size_t __pyx_v_workspace); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_80scsrgeam2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_82dcsrgeam2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_84ccsrgeam2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_86zcsrgeam2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_88xcsrgemmNnz(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_nnzTotalDevHostPtr); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_90scsrgemm(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_92dcsrgemm(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_94ccsrgemm(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_96zcsrgemm(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_98createCsrgemm2Info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_100destroyCsrgemm2Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_102scsrgemm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_104dcsrgemm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_106ccsrgemm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_108zcsrgemm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_110xcsrgemm2Nnz(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_descrC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_nnzTotalDevHostPtr, size_t __pyx_v_info, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_112scsrgemm2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrValD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_info, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_114dcsrgemm2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrValD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_info, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_116ccsrgemm2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrValD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_info, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_118zcsrgemm2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrValD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_info, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_120xcoo2csr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_cooRowInd, int __pyx_v_nnz, int __pyx_v_m, size_t __pyx_v_csrRowPtr, int __pyx_v_idxBase); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_122scsc2dense(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_cscSortedValA, size_t __pyx_v_cscSortedRowIndA, size_t __pyx_v_cscSortedColPtrA, size_t __pyx_v_A, int __pyx_v_lda); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_124dcsc2dense(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_cscSortedValA, size_t __pyx_v_cscSortedRowIndA, size_t __pyx_v_cscSortedColPtrA, size_t __pyx_v_A, int __pyx_v_lda); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_126ccsc2dense(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_cscSortedValA, size_t __pyx_v_cscSortedRowIndA, size_t __pyx_v_cscSortedColPtrA, size_t __pyx_v_A, int __pyx_v_lda); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_128zcsc2dense(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_cscSortedValA, size_t __pyx_v_cscSortedRowIndA, size_t __pyx_v_cscSortedColPtrA, size_t __pyx_v_A, int __pyx_v_lda); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_130xcsr2coo(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_csrRowPtr, int __pyx_v_nnz, int __pyx_v_m, size_t __pyx_v_cooRowInd, int __pyx_v_idxBase); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_132scsr2csc(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_csrVal, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd, size_t __pyx_v_cscVal, size_t __pyx_v_cscRowInd, size_t __pyx_v_cscColPtr, int __pyx_v_copyValues, int __pyx_v_idxBase); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_134dcsr2csc(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_csrVal, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd, size_t __pyx_v_cscVal, size_t __pyx_v_cscRowInd, size_t __pyx_v_cscColPtr, int __pyx_v_copyValues, int __pyx_v_idxBase); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_136ccsr2csc(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_csrVal, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd, size_t __pyx_v_cscVal, size_t __pyx_v_cscRowInd, size_t __pyx_v_cscColPtr, int __pyx_v_copyValues, int __pyx_v_idxBase); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_138zcsr2csc(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_csrVal, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd, size_t __pyx_v_cscVal, size_t __pyx_v_cscRowInd, size_t __pyx_v_cscColPtr, int __pyx_v_copyValues, int __pyx_v_idxBase); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_140scsr2dense(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_A, int __pyx_v_lda); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_142dcsr2dense(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_A, int __pyx_v_lda); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_144ccsr2dense(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_A, int __pyx_v_lda); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_146zcsr2dense(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_A, int __pyx_v_lda); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_148snnz_compress(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_descr, size_t __pyx_v_values, size_t __pyx_v_rowPtr, size_t __pyx_v_nnzPerRow, float __pyx_v_tol); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_150dnnz_compress(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_descr, size_t __pyx_v_values, size_t __pyx_v_rowPtr, size_t __pyx_v_nnzPerRow, double __pyx_v_tol); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_152cnnz_compress(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_descr, size_t __pyx_v_values, size_t __pyx_v_rowPtr, size_t __pyx_v_nnzPerRow, __pyx_t_double_complex __pyx_v_tol); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_154znnz_compress(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_descr, size_t __pyx_v_values, size_t __pyx_v_rowPtr, size_t __pyx_v_nnzPerRow, __pyx_t_double_complex __pyx_v_tol); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_156scsr2csr_compress(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_inVal, size_t __pyx_v_inColInd, size_t __pyx_v_inRowPtr, int __pyx_v_inNnz, size_t __pyx_v_nnzPerRow, size_t __pyx_v_outVal, size_t __pyx_v_outColInd, size_t __pyx_v_outRowPtr, float __pyx_v_tol); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_158dcsr2csr_compress(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_inVal, size_t __pyx_v_inColInd, size_t __pyx_v_inRowPtr, int __pyx_v_inNnz, size_t __pyx_v_nnzPerRow, size_t __pyx_v_outVal, size_t __pyx_v_outColInd, size_t __pyx_v_outRowPtr, float __pyx_v_tol); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_160ccsr2csr_compress(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_inVal, size_t __pyx_v_inColInd, size_t __pyx_v_inRowPtr, int __pyx_v_inNnz, size_t __pyx_v_nnzPerRow, size_t __pyx_v_outVal, size_t __pyx_v_outColInd, size_t __pyx_v_outRowPtr, __pyx_t_double_complex __pyx_v_tol); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_162zcsr2csr_compress(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_inVal, size_t __pyx_v_inColInd, size_t __pyx_v_inRowPtr, int __pyx_v_inNnz, size_t __pyx_v_nnzPerRow, size_t __pyx_v_outVal, size_t __pyx_v_outColInd, size_t __pyx_v_outRowPtr, __pyx_t_double_complex __pyx_v_tol); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_164sdense2csc(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerCol, size_t __pyx_v_cscValA, size_t __pyx_v_cscRowIndA, size_t __pyx_v_cscColPtrA); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_166ddense2csc(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerCol, size_t __pyx_v_cscValA, size_t __pyx_v_cscRowIndA, size_t __pyx_v_cscColPtrA); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_168cdense2csc(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerCol, size_t __pyx_v_cscValA, size_t __pyx_v_cscRowIndA, size_t __pyx_v_cscColPtrA); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_170zdense2csc(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerCol, size_t __pyx_v_cscValA, size_t __pyx_v_cscRowIndA, size_t __pyx_v_cscColPtrA); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_172sdense2csr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRow, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_174ddense2csr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRow, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_176cdense2csr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRow, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_178zdense2csr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRow, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_180snnz(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRowColumn, size_t __pyx_v_nnzTotalDevHostPtr); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_182dnnz(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRowColumn, size_t __pyx_v_nnzTotalDevHostPtr); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_184cnnz(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRowColumn, size_t __pyx_v_nnzTotalDevHostPtr); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_186znnz(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRowColumn, size_t __pyx_v_nnzTotalDevHostPtr); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_188createIdentityPermutation(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_n, size_t __pyx_v_p); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_190xcoosort_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_cooRows, size_t __pyx_v_cooCols); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_192xcoosortByRow(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_cooRows, size_t __pyx_v_cooCols, size_t __pyx_v_P, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_194xcsrsort_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_196xcsrsort(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd, size_t __pyx_v_P, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_198xcscsort_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_cscColPtr, size_t __pyx_v_cscRowInd); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_200xcscsort(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_cscColPtr, size_t __pyx_v_cscRowInd, size_t __pyx_v_P, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_202createCsrilu02Info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_204destroyCsrilu02Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_206createBsrilu02Info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_208destroyBsrilu02Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_210createCsric02Info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_212destroyCsric02Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_214createBsric02Info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_216destroyBsric02Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_218scsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_220dcsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_222ccsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_224zcsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_226xcsrilu02_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_228scsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_230dcsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_232ccsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_234zcsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_236scsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_238dcsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_240ccsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_242zcsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_244scsrilu02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_246dcsrilu02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_248ccsrilu02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_250zcsrilu02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_252sbsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_254dbsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_256cbsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_258zbsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_260xbsrilu02_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_262sbsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_264dbsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_266cbsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_268zbsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_270sbsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_272dbsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_274cbsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_276zbsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_278sbsrilu02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_280dbsrilu02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_282cbsrilu02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_284zbsrilu02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_286xcsric02_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_288scsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_290dcsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_292ccsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_294zcsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_296scsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_298dcsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_300ccsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_302zcsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_304scsric02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_306dcsric02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_308ccsric02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_310zcsric02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_312xbsric02_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_314sbsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_316dbsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_318cbsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_320zbsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_322sbsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pInputBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_324dbsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pInputBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_326cbsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pInputBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_328zbsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pInputBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_330sbsric02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_332dbsric02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_334cbsric02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_336zbsric02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_338sgtsv2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_340dgtsv2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_342cgtsv2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_344zgtsv2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_346sgtsv2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_348dgtsv2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_350cgtsv2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_352zgtsv2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_354sgtsv2_nopivot_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_356dgtsv2_nopivot_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_358cgtsv2_nopivot_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_360zgtsv2_nopivot_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_362sgtsv2_nopivot(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_364dgtsv2_nopivot(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_366cgtsv2_nopivot(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_368zgtsv2_nopivot(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_370sgtsv2StridedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_bufferSizeInBytes); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_372dgtsv2StridedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_bufferSizeInBytes); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_374cgtsv2StridedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_bufferSizeInBytes); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_376zgtsv2StridedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_bufferSizeInBytes); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_378sgtsv2StridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_380dgtsv2StridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_382cgtsv2StridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_384zgtsv2StridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_386sgtsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_388dgtsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_390cgtsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_392zgtsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_394sgtsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_396dgtsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_398cgtsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_400zgtsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_402sgpsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_404dgpsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_406cgpsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_408zgpsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_410sgpsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_412dgpsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_414cgpsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_416zgpsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_418createSpVec(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_size, int64_t __pyx_v_nnz, intptr_t __pyx_v_indices, intptr_t __pyx_v_values, cusparseIndexType_t __pyx_v_idxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_420destroySpVec(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_422spVecGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_424spVecGetIndexBase(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_426spVecGetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_428spVecSetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, intptr_t __pyx_v_values); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_430createCoo(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_cooRowInd, intptr_t __pyx_v_cooColInd, intptr_t __pyx_v_cooValues, cusparseIndexType_t __pyx_v_cooIdxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_432createCooAoS(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_cooInd, intptr_t __pyx_v_cooValues, cusparseIndexType_t __pyx_v_cooIdxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_434createCsr(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_csrRowOffsets, intptr_t __pyx_v_csrColind, intptr_t __pyx_v_csrValues, cusparseIndexType_t __pyx_v_csrRowOffsetsType, cusparseIndexType_t __pyx_v_csrColIndType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_436destroySpMat(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_438cooGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_440cooAoSGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_442csrGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_444spMatGetFormat(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_446spMatGetIndexBase(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_448spMatGetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_450spMatSetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, intptr_t __pyx_v_values); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_452spMatGetStridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_454spMatSetStridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, int __pyx_v_batchCount); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_456createDnVec(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_size, intptr_t __pyx_v_values, cudaDataType __pyx_v_valueType); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_458destroyDnVec(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_460dnVecGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_462dnVecGetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_464dnVecSetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, intptr_t __pyx_v_values); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_466createDnMat(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_ld, intptr_t __pyx_v_values, cudaDataType __pyx_v_valueType, cusparseOrder_t __pyx_v_order); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_468destroyDnMat(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_470dnMatGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_472dnMatGetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_474dnMatSetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, intptr_t __pyx_v_values); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_476dnMatGetStridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_478dnMatSetStridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, int __pyx_v_batchCount, int64_t __pyx_v_batchStride); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_480spVV_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opX, size_t __pyx_v_vecX, size_t __pyx_v_vecY, intptr_t __pyx_v_result, cudaDataType __pyx_v_computeType); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_482spVV(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opX, size_t __pyx_v_vecX, size_t __pyx_v_vecY, intptr_t __pyx_v_result, cudaDataType __pyx_v_computeType, intptr_t __pyx_v_externalBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_484spMV_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_vecX, intptr_t __pyx_v_beta, size_t __pyx_v_vecY, cudaDataType __pyx_v_computeType, cusparseSpMVAlg_t __pyx_v_alg); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_486spMV(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_vecX, intptr_t __pyx_v_beta, size_t __pyx_v_vecY, cudaDataType __pyx_v_computeType, cusparseSpMVAlg_t __pyx_v_alg, intptr_t __pyx_v_externalBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_488spMM_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, cusparseOperation_t __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_matB, intptr_t __pyx_v_beta, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, cusparseSpMMAlg_t __pyx_v_alg); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_490spMM(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, cusparseOperation_t __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_matB, intptr_t __pyx_v_beta, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, cusparseSpMMAlg_t __pyx_v_alg, intptr_t __pyx_v_externalBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_492constrainedGeMM_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, cusparseOperation_t __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_matB, intptr_t __pyx_v_beta, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_494constrainedGeMM(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, cusparseOperation_t __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_matB, intptr_t __pyx_v_beta, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, intptr_t __pyx_v_externalBuffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_496csr2cscEx2_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, intptr_t __pyx_v_csrVal, intptr_t __pyx_v_csrRowPtr, intptr_t __pyx_v_csrColInd, intptr_t __pyx_v_cscVal, intptr_t __pyx_v_cscColPtr, intptr_t __pyx_v_cscRowInd, cudaDataType __pyx_v_valType, cusparseAction_t __pyx_v_copyValues, cusparseIndexBase_t __pyx_v_idxBase, cusparseCsr2CscAlg_t __pyx_v_alg); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_498csr2cscEx2(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, intptr_t __pyx_v_csrVal, intptr_t __pyx_v_csrRowPtr, intptr_t __pyx_v_csrColInd, intptr_t __pyx_v_cscVal, intptr_t __pyx_v_cscColPtr, intptr_t __pyx_v_cscRowInd, cudaDataType __pyx_v_valType, cusparseAction_t __pyx_v_copyValues, cusparseIndexBase_t __pyx_v_idxBase, cusparseCsr2CscAlg_t __pyx_v_alg, intptr_t __pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_500__pyx_unpickle_SpVecAttributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_502__pyx_unpickle_CooAttributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_504__pyx_unpickle_CooAoSAttributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_506__pyx_unpickle_CsrAttributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_508__pyx_unpickle_DnVecAttributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_510__pyx_unpickle_DnMatAttributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_512__pyx_unpickle_DnMatBatchAttributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_4cupy_4cuda_8cusparse_SpVecAttributes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cupy_4cuda_8cusparse_CooAttributes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cupy_4cuda_8cusparse_CooAoSAttributes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cupy_4cuda_8cusparse_CsrAttributes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cupy_4cuda_8cusparse_DnVecAttributes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cupy_4cuda_8cusparse_DnMatAttributes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cupy_4cuda_8cusparse_DnMatBatchAttributes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_6;
static PyObject *__pyx_int_7;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_9;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_10210616;
static PyObject *__pyx_int_69187622;
static PyObject *__pyx_int_133770810;
static PyObject *__pyx_int_164824378;
static PyObject *__pyx_int_191290712;
static PyObject *__pyx_int_213641179;
static PyObject *__pyx_int_221647839;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_codeobj__3;
static PyObject *__pyx_codeobj__5;
static PyObject *__pyx_codeobj__6;
static PyObject *__pyx_codeobj__8;
static PyObject *__pyx_codeobj__10;
static PyObject *__pyx_codeobj__12;
static PyObject *__pyx_codeobj__14;
static PyObject *__pyx_codeobj__16;
static PyObject *__pyx_codeobj__18;
static PyObject *__pyx_codeobj__20;
/* Late includes */

/* "cupy/cuda/cusparse.pyx":1185
 * cdef class SpVecAttributes:
 * 
 *     def __init__(self, int64_t size, int64_t nnz,             # <<<<<<<<<<<<<<
 *                  intptr_t idx, intptr_t values,
 *                  IndexType idxType, IndexBase idxBase, DataType valueType):
 */

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_size;
  int64_t __pyx_v_nnz;
  intptr_t __pyx_v_idx;
  intptr_t __pyx_v_values;
  cusparseIndexType_t __pyx_v_idxType;
  cusparseIndexBase_t __pyx_v_idxBase;
  cudaDataType __pyx_v_valueType;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_nnz,&__pyx_n_s_idx,&__pyx_n_s_values,&__pyx_n_s_idxType,&__pyx_n_s_idxBase,&__pyx_n_s_valueType,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 1); __PYX_ERR(0, 1185, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 2); __PYX_ERR(0, 1185, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 3); __PYX_ERR(0, 1185, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 4); __PYX_ERR(0, 1185, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 5); __PYX_ERR(0, 1185, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_valueType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 6); __PYX_ERR(0, 1185, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1185, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_size = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_size == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1185, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1185, __pyx_L3_error)
    __pyx_v_idx = PyInt_AsSsize_t(values[2]); if (unlikely((__pyx_v_idx == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1186, __pyx_L3_error)
    __pyx_v_values = PyInt_AsSsize_t(values[3]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1186, __pyx_L3_error)
    __pyx_v_idxType = __Pyx_PyInt_As_cusparseIndexType_t(values[4]); if (unlikely((__pyx_v_idxType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1187, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_cusparseIndexBase_t(values[5]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1187, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyInt_As_cudaDataType(values[6]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1187, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1185, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes___init__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self), __pyx_v_size, __pyx_v_nnz, __pyx_v_idx, __pyx_v_values, __pyx_v_idxType, __pyx_v_idxBase, __pyx_v_valueType);

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes___init__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, int64_t __pyx_v_size, int64_t __pyx_v_nnz, intptr_t __pyx_v_idx, intptr_t __pyx_v_values, cusparseIndexType_t __pyx_v_idxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cupy/cuda/cusparse.pyx":1188
 *                  intptr_t idx, intptr_t values,
 *                  IndexType idxType, IndexBase idxBase, DataType valueType):
 *         self.size = size             # <<<<<<<<<<<<<<
 *         self.nnz = nnz
 *         self.idx = idx
 */
  __pyx_v_self->size = __pyx_v_size;

  /* "cupy/cuda/cusparse.pyx":1189
 *                  IndexType idxType, IndexBase idxBase, DataType valueType):
 *         self.size = size
 *         self.nnz = nnz             # <<<<<<<<<<<<<<
 *         self.idx = idx
 *         self.values = values
 */
  __pyx_v_self->nnz = __pyx_v_nnz;

  /* "cupy/cuda/cusparse.pyx":1190
 *         self.size = size
 *         self.nnz = nnz
 *         self.idx = idx             # <<<<<<<<<<<<<<
 *         self.values = values
 *         self.idxType = idxType
 */
  __pyx_v_self->idx = __pyx_v_idx;

  /* "cupy/cuda/cusparse.pyx":1191
 *         self.nnz = nnz
 *         self.idx = idx
 *         self.values = values             # <<<<<<<<<<<<<<
 *         self.idxType = idxType
 *         self.idxBase = idxBase
 */
  __pyx_v_self->values = __pyx_v_values;

  /* "cupy/cuda/cusparse.pyx":1192
 *         self.idx = idx
 *         self.values = values
 *         self.idxType = idxType             # <<<<<<<<<<<<<<
 *         self.idxBase = idxBase
 *         self.valueType = valueType
 */
  __pyx_v_self->idxType = __pyx_v_idxType;

  /* "cupy/cuda/cusparse.pyx":1193
 *         self.values = values
 *         self.idxType = idxType
 *         self.idxBase = idxBase             # <<<<<<<<<<<<<<
 *         self.valueType = valueType
 * 
 */
  __pyx_v_self->idxBase = __pyx_v_idxBase;

  /* "cupy/cuda/cusparse.pyx":1194
 *         self.idxType = idxType
 *         self.idxBase = idxBase
 *         self.valueType = valueType             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->valueType = __pyx_v_valueType;

  /* "cupy/cuda/cusparse.pyx":1185
 * cdef class SpVecAttributes:
 * 
 *     def __init__(self, int64_t size, int64_t nnz,             # <<<<<<<<<<<<<<
 *                  intptr_t idx, intptr_t values,
 *                  IndexType idxType, IndexBase idxBase, DataType valueType):
 */

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

/* "cupy/cuda/cusparse.pxd":113
 * cdef class SpVecAttributes:
 *     cdef:
 *         public int64_t size             # <<<<<<<<<<<<<<
 *         public int64_t nnz
 *         public intptr_t idx
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_4size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_4size___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_4size___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_4size_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_4size_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 113, __pyx_L1_error)
  __pyx_v_self->size = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":114
 *     cdef:
 *         public int64_t size
 *         public int64_t nnz             # <<<<<<<<<<<<<<
 *         public intptr_t idx
 *         public intptr_t values
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_3nnz_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_3nnz_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_3nnz___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_3nnz___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->nnz); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.nnz.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_3nnz_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_3nnz_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_3nnz_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_3nnz_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 114, __pyx_L1_error)
  __pyx_v_self->nnz = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.nnz.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":115
 *         public int64_t size
 *         public int64_t nnz
 *         public intptr_t idx             # <<<<<<<<<<<<<<
 *         public intptr_t values
 *         public IndexType idxType
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_3idx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_3idx_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_3idx___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_3idx___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->idx); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.idx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_3idx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_3idx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_3idx_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_3idx_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = PyInt_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 115, __pyx_L1_error)
  __pyx_v_self->idx = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.idx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":116
 *         public int64_t nnz
 *         public intptr_t idx
 *         public intptr_t values             # <<<<<<<<<<<<<<
 *         public IndexType idxType
 *         public IndexBase idxBase
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_6values_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_6values___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_6values___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_6values_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_6values_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = PyInt_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 116, __pyx_L1_error)
  __pyx_v_self->values = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.values.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":117
 *         public intptr_t idx
 *         public intptr_t values
 *         public IndexType idxType             # <<<<<<<<<<<<<<
 *         public IndexBase idxBase
 *         public DataType valueType
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxType_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxType___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_cusparseIndexType_t(__pyx_v_self->idxType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.idxType.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxType_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  cusparseIndexType_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_cusparseIndexType_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 117, __pyx_L1_error)
  __pyx_v_self->idxType = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.idxType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":118
 *         public intptr_t values
 *         public IndexType idxType
 *         public IndexBase idxBase             # <<<<<<<<<<<<<<
 *         public DataType valueType
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxBase_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxBase_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxBase___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxBase___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_cusparseIndexBase_t(__pyx_v_self->idxBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.idxBase.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxBase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxBase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxBase_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxBase_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  cusparseIndexBase_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_cusparseIndexBase_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 118, __pyx_L1_error)
  __pyx_v_self->idxBase = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.idxBase.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":119
 *         public IndexType idxType
 *         public IndexBase idxBase
 *         public DataType valueType             # <<<<<<<<<<<<<<
 * 
 * cdef class CooAttributes:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_9valueType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_9valueType_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_9valueType___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_9valueType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.valueType.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_9valueType_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_9valueType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  cudaDataType __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_cudaDataType(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(1, 119, __pyx_L1_error)
  __pyx_v_self->valueType = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.valueType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_15SpVecAttributes_2__reduce_cython__[] = "SpVecAttributes.__reduce_cython__(self)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_3__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_4cupy_4cuda_8cusparse_15SpVecAttributes_2__reduce_cython__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_2__reduce_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.idx, self.idxBase, self.idxType, self.nnz, self.size, self.valueType, self.values)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->idx); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_cusparseIndexBase_t(__pyx_v_self->idxBase); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_cusparseIndexType_t(__pyx_v_self->idxType); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_self->nnz); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_self->size); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_7);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.idx, self.idxBase, self.idxType, self.nnz, self.size, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_8 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_v__dict = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "(tree fragment)":7
 *     state = (self.idx, self.idxBase, self.idxType, self.nnz, self.size, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_9 = (__pyx_v__dict != Py_None);
  __pyx_t_10 = (__pyx_t_9 != 0);
  if (__pyx_t_10) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v__dict);
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.idx, self.idxBase, self.idxType, self.nnz, self.size, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_SpVecAttributes, (type(self), 0x7f92e3a, None), state
 */
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_SpVecAttributes, (type(self), 0x7f92e3a, None), state
 *     else:
 */
  __pyx_t_10 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_10) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_SpVecAttributes, (type(self), 0x7f92e3a, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_SpVecAttributes, (type(self), 0x7f92e3a, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pyx_unpickle_SpVecAttributes); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_133770810);
    __Pyx_GIVEREF(__pyx_int_133770810);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_133770810);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_8, 2, Py_None);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
    __pyx_t_7 = 0;
    __pyx_t_8 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_SpVecAttributes, (type(self), 0x7f92e3a, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_SpVecAttributes, (type(self), 0x7f92e3a, None), state
 *     else:
 *         return __pyx_unpickle_SpVecAttributes, (type(self), 0x7f92e3a, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SpVecAttributes__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_SpVecAttributes); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_133770810);
    __Pyx_GIVEREF(__pyx_int_133770810);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_133770810);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_state);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
    __pyx_t_6 = 0;
    __pyx_t_8 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SpVecAttributes, (type(self), 0x7f92e3a, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SpVecAttributes__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_15SpVecAttributes_4__setstate_cython__[] = "SpVecAttributes.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_5__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_4cupy_4cuda_8cusparse_15SpVecAttributes_4__setstate_cython__(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15SpVecAttributes_4__setstate_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_SpVecAttributes, (type(self), 0x7f92e3a, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SpVecAttributes__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_SpVecAttributes__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SpVecAttributes, (type(self), 0x7f92e3a, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SpVecAttributes__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.SpVecAttributes.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1199
 * cdef class CooAttributes:
 * 
 *     def __init__(self, int64_t rows, int64_t cols, int64_t nnz,             # <<<<<<<<<<<<<<
 *                  intptr_t rowIdx, intptr_t colIdx, intptr_t values,
 *                  IndexType idxType, IndexBase idxBase, DataType valueType):
 */

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_rows;
  int64_t __pyx_v_cols;
  int64_t __pyx_v_nnz;
  intptr_t __pyx_v_rowIdx;
  intptr_t __pyx_v_colIdx;
  intptr_t __pyx_v_values;
  cusparseIndexType_t __pyx_v_idxType;
  cusparseIndexBase_t __pyx_v_idxBase;
  cudaDataType __pyx_v_valueType;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_nnz,&__pyx_n_s_rowIdx,&__pyx_n_s_colIdx,&__pyx_n_s_values,&__pyx_n_s_idxType,&__pyx_n_s_idxBase,&__pyx_n_s_valueType,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 1); __PYX_ERR(0, 1199, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 2); __PYX_ERR(0, 1199, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowIdx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 3); __PYX_ERR(0, 1199, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colIdx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 4); __PYX_ERR(0, 1199, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 5); __PYX_ERR(0, 1199, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 6); __PYX_ERR(0, 1199, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 7); __PYX_ERR(0, 1199, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_valueType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 8); __PYX_ERR(0, 1199, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1199, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_rows = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1199, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1199, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1199, __pyx_L3_error)
    __pyx_v_rowIdx = PyInt_AsSsize_t(values[3]); if (unlikely((__pyx_v_rowIdx == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1200, __pyx_L3_error)
    __pyx_v_colIdx = PyInt_AsSsize_t(values[4]); if (unlikely((__pyx_v_colIdx == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1200, __pyx_L3_error)
    __pyx_v_values = PyInt_AsSsize_t(values[5]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1200, __pyx_L3_error)
    __pyx_v_idxType = __Pyx_PyInt_As_cusparseIndexType_t(values[6]); if (unlikely((__pyx_v_idxType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_cusparseIndexBase_t(values[7]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyInt_As_cudaDataType(values[8]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1199, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes___init__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_nnz, __pyx_v_rowIdx, __pyx_v_colIdx, __pyx_v_values, __pyx_v_idxType, __pyx_v_idxBase, __pyx_v_valueType);

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes___init__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_rowIdx, intptr_t __pyx_v_colIdx, intptr_t __pyx_v_values, cusparseIndexType_t __pyx_v_idxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cupy/cuda/cusparse.pyx":1202
 *                  intptr_t rowIdx, intptr_t colIdx, intptr_t values,
 *                  IndexType idxType, IndexBase idxBase, DataType valueType):
 *         self.rows = rows             # <<<<<<<<<<<<<<
 *         self.cols = cols
 *         self.nnz = nnz
 */
  __pyx_v_self->rows = __pyx_v_rows;

  /* "cupy/cuda/cusparse.pyx":1203
 *                  IndexType idxType, IndexBase idxBase, DataType valueType):
 *         self.rows = rows
 *         self.cols = cols             # <<<<<<<<<<<<<<
 *         self.nnz = nnz
 *         self.rowIdx = rowIdx
 */
  __pyx_v_self->cols = __pyx_v_cols;

  /* "cupy/cuda/cusparse.pyx":1204
 *         self.rows = rows
 *         self.cols = cols
 *         self.nnz = nnz             # <<<<<<<<<<<<<<
 *         self.rowIdx = rowIdx
 *         self.colIdx = colIdx
 */
  __pyx_v_self->nnz = __pyx_v_nnz;

  /* "cupy/cuda/cusparse.pyx":1205
 *         self.cols = cols
 *         self.nnz = nnz
 *         self.rowIdx = rowIdx             # <<<<<<<<<<<<<<
 *         self.colIdx = colIdx
 *         self.values = values
 */
  __pyx_v_self->rowIdx = __pyx_v_rowIdx;

  /* "cupy/cuda/cusparse.pyx":1206
 *         self.nnz = nnz
 *         self.rowIdx = rowIdx
 *         self.colIdx = colIdx             # <<<<<<<<<<<<<<
 *         self.values = values
 *         self.idxType = idxType
 */
  __pyx_v_self->colIdx = __pyx_v_colIdx;

  /* "cupy/cuda/cusparse.pyx":1207
 *         self.rowIdx = rowIdx
 *         self.colIdx = colIdx
 *         self.values = values             # <<<<<<<<<<<<<<
 *         self.idxType = idxType
 *         self.idxBase = idxBase
 */
  __pyx_v_self->values = __pyx_v_values;

  /* "cupy/cuda/cusparse.pyx":1208
 *         self.colIdx = colIdx
 *         self.values = values
 *         self.idxType = idxType             # <<<<<<<<<<<<<<
 *         self.idxBase = idxBase
 *         self.valueType = valueType
 */
  __pyx_v_self->idxType = __pyx_v_idxType;

  /* "cupy/cuda/cusparse.pyx":1209
 *         self.values = values
 *         self.idxType = idxType
 *         self.idxBase = idxBase             # <<<<<<<<<<<<<<
 *         self.valueType = valueType
 * 
 */
  __pyx_v_self->idxBase = __pyx_v_idxBase;

  /* "cupy/cuda/cusparse.pyx":1210
 *         self.idxType = idxType
 *         self.idxBase = idxBase
 *         self.valueType = valueType             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->valueType = __pyx_v_valueType;

  /* "cupy/cuda/cusparse.pyx":1199
 * cdef class CooAttributes:
 * 
 *     def __init__(self, int64_t rows, int64_t cols, int64_t nnz,             # <<<<<<<<<<<<<<
 *                  intptr_t rowIdx, intptr_t colIdx, intptr_t values,
 *                  IndexType idxType, IndexBase idxBase, DataType valueType):
 */

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

/* "cupy/cuda/cusparse.pxd":123
 * cdef class CooAttributes:
 *     cdef:
 *         public int64_t rows             # <<<<<<<<<<<<<<
 *         public int64_t cols
 *         public int64_t nnz
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_4rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_4rows_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_4rows___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_4rows___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_4rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_4rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_4rows_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_4rows_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L1_error)
  __pyx_v_self->rows = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.rows.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":124
 *     cdef:
 *         public int64_t rows
 *         public int64_t cols             # <<<<<<<<<<<<<<
 *         public int64_t nnz
 *         public intptr_t rowIdx
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_4cols_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_4cols_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_4cols___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_4cols___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.cols.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_4cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_4cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_4cols_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_4cols_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 124, __pyx_L1_error)
  __pyx_v_self->cols = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.cols.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":125
 *         public int64_t rows
 *         public int64_t cols
 *         public int64_t nnz             # <<<<<<<<<<<<<<
 *         public intptr_t rowIdx
 *         public intptr_t colIdx
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_3nnz_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_3nnz_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_3nnz___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_3nnz___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->nnz); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.nnz.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_3nnz_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_3nnz_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_3nnz_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_3nnz_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 125, __pyx_L1_error)
  __pyx_v_self->nnz = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.nnz.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":126
 *         public int64_t cols
 *         public int64_t nnz
 *         public intptr_t rowIdx             # <<<<<<<<<<<<<<
 *         public intptr_t colIdx
 *         public intptr_t values
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6rowIdx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6rowIdx_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6rowIdx___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6rowIdx___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->rowIdx); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.rowIdx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6rowIdx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6rowIdx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6rowIdx_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6rowIdx_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = PyInt_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 126, __pyx_L1_error)
  __pyx_v_self->rowIdx = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.rowIdx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":127
 *         public int64_t nnz
 *         public intptr_t rowIdx
 *         public intptr_t colIdx             # <<<<<<<<<<<<<<
 *         public intptr_t values
 *         public IndexType idxType
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6colIdx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6colIdx_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6colIdx___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6colIdx___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->colIdx); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.colIdx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6colIdx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6colIdx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6colIdx_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6colIdx_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = PyInt_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 127, __pyx_L1_error)
  __pyx_v_self->colIdx = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.colIdx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":128
 *         public intptr_t rowIdx
 *         public intptr_t colIdx
 *         public intptr_t values             # <<<<<<<<<<<<<<
 *         public IndexType idxType
 *         public IndexBase idxBase
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6values_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6values___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6values___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6values_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_6values_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = PyInt_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 128, __pyx_L1_error)
  __pyx_v_self->values = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.values.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":129
 *         public intptr_t colIdx
 *         public intptr_t values
 *         public IndexType idxType             # <<<<<<<<<<<<<<
 *         public IndexBase idxBase
 *         public DataType valueType
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_7idxType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_7idxType_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_7idxType___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_7idxType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_cusparseIndexType_t(__pyx_v_self->idxType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.idxType.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_7idxType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_7idxType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_7idxType_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_7idxType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  cusparseIndexType_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_cusparseIndexType_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 129, __pyx_L1_error)
  __pyx_v_self->idxType = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.idxType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":130
 *         public intptr_t values
 *         public IndexType idxType
 *         public IndexBase idxBase             # <<<<<<<<<<<<<<
 *         public DataType valueType
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_7idxBase_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_7idxBase_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_7idxBase___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_7idxBase___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_cusparseIndexBase_t(__pyx_v_self->idxBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.idxBase.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_7idxBase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_7idxBase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_7idxBase_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_7idxBase_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  cusparseIndexBase_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_cusparseIndexBase_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 130, __pyx_L1_error)
  __pyx_v_self->idxBase = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.idxBase.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":131
 *         public IndexType idxType
 *         public IndexBase idxBase
 *         public DataType valueType             # <<<<<<<<<<<<<<
 * 
 * cdef class CooAoSAttributes:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_9valueType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_9valueType_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_9valueType___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_9valueType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.valueType.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_9valueType_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_9valueType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  cudaDataType __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_cudaDataType(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L1_error)
  __pyx_v_self->valueType = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.valueType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_13CooAttributes_2__reduce_cython__[] = "CooAttributes.__reduce_cython__(self)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_3__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_4cupy_4cuda_8cusparse_13CooAttributes_2__reduce_cython__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_2__reduce_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.colIdx, self.cols, self.idxBase, self.idxType, self.nnz, self.rowIdx, self.rows, self.valueType, self.values)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->colIdx); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_self->cols); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_cusparseIndexBase_t(__pyx_v_self->idxBase); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_cusparseIndexType_t(__pyx_v_self->idxType); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_self->nnz); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_self->rowIdx); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_self->rows); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyInt_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyTuple_New(9); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_t_9);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.colIdx, self.cols, self.idxBase, self.idxType, self.nnz, self.rowIdx, self.rows, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_10 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_v__dict = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "(tree fragment)":7
 *     state = (self.colIdx, self.cols, self.idxBase, self.idxType, self.nnz, self.rowIdx, self.rows, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_11 = (__pyx_v__dict != Py_None);
  __pyx_t_12 = (__pyx_t_11 != 0);
  if (__pyx_t_12) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v__dict);
    __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_9));
    __pyx_t_9 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.colIdx, self.cols, self.idxBase, self.idxType, self.nnz, self.rowIdx, self.rows, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_CooAttributes, (type(self), 0x41fb826, None), state
 */
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_CooAttributes, (type(self), 0x41fb826, None), state
 *     else:
 */
  __pyx_t_12 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_12) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_CooAttributes, (type(self), 0x41fb826, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_CooAttributes, (type(self), 0x41fb826, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_pyx_unpickle_CooAttributes); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_69187622);
    __Pyx_GIVEREF(__pyx_int_69187622);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_69187622);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_10, 2, Py_None);
    __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_state);
    __pyx_t_9 = 0;
    __pyx_t_10 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_CooAttributes, (type(self), 0x41fb826, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_CooAttributes, (type(self), 0x41fb826, None), state
 *     else:
 *         return __pyx_unpickle_CooAttributes, (type(self), 0x41fb826, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CooAttributes__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_pyx_unpickle_CooAttributes); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_69187622);
    __Pyx_GIVEREF(__pyx_int_69187622);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_69187622);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state);
    __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
    __pyx_t_8 = 0;
    __pyx_t_10 = 0;
    __pyx_r = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CooAttributes, (type(self), 0x41fb826, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CooAttributes__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_13CooAttributes_4__setstate_cython__[] = "CooAttributes.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_5__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_4cupy_4cuda_8cusparse_13CooAttributes_4__setstate_cython__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CooAttributes_4__setstate_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_CooAttributes, (type(self), 0x41fb826, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CooAttributes__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_CooAttributes__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CooAttributes, (type(self), 0x41fb826, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CooAttributes__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAttributes.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1215
 * cdef class CooAoSAttributes:
 * 
 *     def __init__(self, int64_t rows, int64_t cols, int64_t nnz,             # <<<<<<<<<<<<<<
 *                  intptr_t ind, intptr_t values,
 *                  IndexType idxType, IndexBase idxBase, DataType valueType):
 */

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_rows;
  int64_t __pyx_v_cols;
  int64_t __pyx_v_nnz;
  intptr_t __pyx_v_ind;
  intptr_t __pyx_v_values;
  cusparseIndexType_t __pyx_v_idxType;
  cusparseIndexBase_t __pyx_v_idxBase;
  cudaDataType __pyx_v_valueType;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_nnz,&__pyx_n_s_ind,&__pyx_n_s_values,&__pyx_n_s_idxType,&__pyx_n_s_idxBase,&__pyx_n_s_valueType,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 1); __PYX_ERR(0, 1215, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 2); __PYX_ERR(0, 1215, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ind)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 3); __PYX_ERR(0, 1215, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 4); __PYX_ERR(0, 1215, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 5); __PYX_ERR(0, 1215, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 6); __PYX_ERR(0, 1215, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_valueType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 7); __PYX_ERR(0, 1215, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1215, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_rows = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1215, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1215, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1215, __pyx_L3_error)
    __pyx_v_ind = PyInt_AsSsize_t(values[3]); if (unlikely((__pyx_v_ind == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1216, __pyx_L3_error)
    __pyx_v_values = PyInt_AsSsize_t(values[4]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1216, __pyx_L3_error)
    __pyx_v_idxType = __Pyx_PyInt_As_cusparseIndexType_t(values[5]); if (unlikely((__pyx_v_idxType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_cusparseIndexBase_t(values[6]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyInt_As_cudaDataType(values[7]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1215, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes___init__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_nnz, __pyx_v_ind, __pyx_v_values, __pyx_v_idxType, __pyx_v_idxBase, __pyx_v_valueType);

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

static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes___init__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_ind, intptr_t __pyx_v_values, cusparseIndexType_t __pyx_v_idxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cupy/cuda/cusparse.pyx":1218
 *                  intptr_t ind, intptr_t values,
 *                  IndexType idxType, IndexBase idxBase, DataType valueType):
 *         self.rows = rows             # <<<<<<<<<<<<<<
 *         self.cols = cols
 *         self.nnz = nnz
 */
  __pyx_v_self->rows = __pyx_v_rows;

  /* "cupy/cuda/cusparse.pyx":1219
 *                  IndexType idxType, IndexBase idxBase, DataType valueType):
 *         self.rows = rows
 *         self.cols = cols             # <<<<<<<<<<<<<<
 *         self.nnz = nnz
 *         self.ind = ind
 */
  __pyx_v_self->cols = __pyx_v_cols;

  /* "cupy/cuda/cusparse.pyx":1220
 *         self.rows = rows
 *         self.cols = cols
 *         self.nnz = nnz             # <<<<<<<<<<<<<<
 *         self.ind = ind
 *         self.values = values
 */
  __pyx_v_self->nnz = __pyx_v_nnz;

  /* "cupy/cuda/cusparse.pyx":1221
 *         self.cols = cols
 *         self.nnz = nnz
 *         self.ind = ind             # <<<<<<<<<<<<<<
 *         self.values = values
 *         self.idxType = idxType
 */
  __pyx_v_self->ind = __pyx_v_ind;

  /* "cupy/cuda/cusparse.pyx":1222
 *         self.nnz = nnz
 *         self.ind = ind
 *         self.values = values             # <<<<<<<<<<<<<<
 *         self.idxType = idxType
 *         self.idxBase = idxBase
 */
  __pyx_v_self->values = __pyx_v_values;

  /* "cupy/cuda/cusparse.pyx":1223
 *         self.ind = ind
 *         self.values = values
 *         self.idxType = idxType             # <<<<<<<<<<<<<<
 *         self.idxBase = idxBase
 *         self.valueType = valueType
 */
  __pyx_v_self->idxType = __pyx_v_idxType;

  /* "cupy/cuda/cusparse.pyx":1224
 *         self.values = values
 *         self.idxType = idxType
 *         self.idxBase = idxBase             # <<<<<<<<<<<<<<
 *         self.valueType = valueType
 * 
 */
  __pyx_v_self->idxBase = __pyx_v_idxBase;

  /* "cupy/cuda/cusparse.pyx":1225
 *         self.idxType = idxType
 *         self.idxBase = idxBase
 *         self.valueType = valueType             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->valueType = __pyx_v_valueType;

  /* "cupy/cuda/cusparse.pyx":1215
 * cdef class CooAoSAttributes:
 * 
 *     def __init__(self, int64_t rows, int64_t cols, int64_t nnz,             # <<<<<<<<<<<<<<
 *                  intptr_t ind, intptr_t values,
 *                  IndexType idxType, IndexBase idxBase, DataType valueType):
 */

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

/* "cupy/cuda/cusparse.pxd":135
 * cdef class CooAoSAttributes:
 *     cdef:
 *         public int64_t rows             # <<<<<<<<<<<<<<
 *         public int64_t cols
 *         public int64_t nnz
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_4rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_4rows_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_4rows___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_4rows___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_4rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_4rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_4rows_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_4rows_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 135, __pyx_L1_error)
  __pyx_v_self->rows = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.rows.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":136
 *     cdef:
 *         public int64_t rows
 *         public int64_t cols             # <<<<<<<<<<<<<<
 *         public int64_t nnz
 *         public intptr_t ind
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_4cols_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_4cols_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_4cols___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_4cols___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.cols.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_4cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_4cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_4cols_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_4cols_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 136, __pyx_L1_error)
  __pyx_v_self->cols = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.cols.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":137
 *         public int64_t rows
 *         public int64_t cols
 *         public int64_t nnz             # <<<<<<<<<<<<<<
 *         public intptr_t ind
 *         public intptr_t values
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_3nnz_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_3nnz_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_3nnz___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_3nnz___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->nnz); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.nnz.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_3nnz_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_3nnz_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_3nnz_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_3nnz_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 137, __pyx_L1_error)
  __pyx_v_self->nnz = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.nnz.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":138
 *         public int64_t cols
 *         public int64_t nnz
 *         public intptr_t ind             # <<<<<<<<<<<<<<
 *         public intptr_t values
 *         public IndexType idxType
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_3ind_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_3ind_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_3ind___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_3ind___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.ind.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_3ind_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_3ind_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_3ind_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_3ind_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = PyInt_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 138, __pyx_L1_error)
  __pyx_v_self->ind = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.ind.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":139
 *         public int64_t nnz
 *         public intptr_t ind
 *         public intptr_t values             # <<<<<<<<<<<<<<
 *         public IndexType idxType
 *         public IndexBase idxBase
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_6values_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_6values___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_6values___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_6values_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_6values_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = PyInt_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error)
  __pyx_v_self->values = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.values.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":140
 *         public intptr_t ind
 *         public intptr_t values
 *         public IndexType idxType             # <<<<<<<<<<<<<<
 *         public IndexBase idxBase
 *         public DataType valueType
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxType_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxType___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_cusparseIndexType_t(__pyx_v_self->idxType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.idxType.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxType_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  cusparseIndexType_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_cusparseIndexType_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 140, __pyx_L1_error)
  __pyx_v_self->idxType = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.idxType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":141
 *         public intptr_t values
 *         public IndexType idxType
 *         public IndexBase idxBase             # <<<<<<<<<<<<<<
 *         public DataType valueType
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxBase_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxBase_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxBase___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxBase___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_cusparseIndexBase_t(__pyx_v_self->idxBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.idxBase.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxBase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxBase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxBase_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxBase_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  cusparseIndexBase_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_cusparseIndexBase_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
  __pyx_v_self->idxBase = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.idxBase.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":142
 *         public IndexType idxType
 *         public IndexBase idxBase
 *         public DataType valueType             # <<<<<<<<<<<<<<
 * 
 * cdef class CsrAttributes:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_9valueType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_9valueType_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_9valueType___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_9valueType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.valueType.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_9valueType_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_9valueType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  cudaDataType __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_cudaDataType(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(1, 142, __pyx_L1_error)
  __pyx_v_self->valueType = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.valueType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_16CooAoSAttributes_2__reduce_cython__[] = "CooAoSAttributes.__reduce_cython__(self)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_3__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_4cupy_4cuda_8cusparse_16CooAoSAttributes_2__reduce_cython__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_2__reduce_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.cols, self.idxBase, self.idxType, self.ind, self.nnz, self.rows, self.valueType, self.values)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_cusparseIndexBase_t(__pyx_v_self->idxBase); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_cusparseIndexType_t(__pyx_v_self->idxType); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_self->ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_self->nnz); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_self->rows); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyTuple_New(8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_t_8);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.cols, self.idxBase, self.idxType, self.ind, self.nnz, self.rows, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_9 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_v__dict = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "(tree fragment)":7
 *     state = (self.cols, self.idxBase, self.idxType, self.ind, self.nnz, self.rows, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_10 = (__pyx_v__dict != Py_None);
  __pyx_t_11 = (__pyx_t_10 != 0);
  if (__pyx_t_11) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v__dict);
    __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_8));
    __pyx_t_8 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.cols, self.idxBase, self.idxType, self.ind, self.nnz, self.rows, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_CooAoSAttributes, (type(self), 0xd3613df, None), state
 */
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_CooAoSAttributes, (type(self), 0xd3613df, None), state
 *     else:
 */
  __pyx_t_11 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_11) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_CooAoSAttributes, (type(self), 0xd3613df, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_CooAoSAttributes, (type(self), 0xd3613df, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_pyx_unpickle_CooAoSAttributes); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_221647839);
    __Pyx_GIVEREF(__pyx_int_221647839);
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_int_221647839);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_9, 2, Py_None);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state);
    __pyx_t_8 = 0;
    __pyx_t_9 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_CooAoSAttributes, (type(self), 0xd3613df, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_CooAoSAttributes, (type(self), 0xd3613df, None), state
 *     else:
 *         return __pyx_unpickle_CooAoSAttributes, (type(self), 0xd3613df, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CooAoSAttributes__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pyx_unpickle_CooAoSAttributes); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_221647839);
    __Pyx_GIVEREF(__pyx_int_221647839);
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_int_221647839);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_state);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9);
    __pyx_t_7 = 0;
    __pyx_t_9 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CooAoSAttributes, (type(self), 0xd3613df, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CooAoSAttributes__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_16CooAoSAttributes_4__setstate_cython__[] = "CooAoSAttributes.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_5__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_4cupy_4cuda_8cusparse_16CooAoSAttributes_4__setstate_cython__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16CooAoSAttributes_4__setstate_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_CooAoSAttributes, (type(self), 0xd3613df, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CooAoSAttributes__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_CooAoSAttributes__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CooAoSAttributes, (type(self), 0xd3613df, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CooAoSAttributes__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CooAoSAttributes.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1230
 * cdef class CsrAttributes:
 * 
 *     def __init__(self, int64_t rows, int64_t cols, int64_t nnz,             # <<<<<<<<<<<<<<
 *                  intptr_t rowOffsets, intptr_t colIdx, intptr_t values,
 *                  IndexType rowOffsetType, IndexType colIdxType,
 */

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_rows;
  int64_t __pyx_v_cols;
  int64_t __pyx_v_nnz;
  intptr_t __pyx_v_rowOffsets;
  intptr_t __pyx_v_colIdx;
  intptr_t __pyx_v_values;
  cusparseIndexType_t __pyx_v_rowOffsetType;
  cusparseIndexType_t __pyx_v_colIdxType;
  cusparseIndexBase_t __pyx_v_idxBase;
  cudaDataType __pyx_v_valueType;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_nnz,&__pyx_n_s_rowOffsets,&__pyx_n_s_colIdx,&__pyx_n_s_values,&__pyx_n_s_rowOffsetType,&__pyx_n_s_colIdxType,&__pyx_n_s_idxBase,&__pyx_n_s_valueType,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 1); __PYX_ERR(0, 1230, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 2); __PYX_ERR(0, 1230, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowOffsets)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 3); __PYX_ERR(0, 1230, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colIdx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 4); __PYX_ERR(0, 1230, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 5); __PYX_ERR(0, 1230, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowOffsetType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 6); __PYX_ERR(0, 1230, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colIdxType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 7); __PYX_ERR(0, 1230, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 8); __PYX_ERR(0, 1230, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_valueType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 9); __PYX_ERR(0, 1230, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1230, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_rows = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1230, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1230, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1230, __pyx_L3_error)
    __pyx_v_rowOffsets = PyInt_AsSsize_t(values[3]); if (unlikely((__pyx_v_rowOffsets == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1231, __pyx_L3_error)
    __pyx_v_colIdx = PyInt_AsSsize_t(values[4]); if (unlikely((__pyx_v_colIdx == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1231, __pyx_L3_error)
    __pyx_v_values = PyInt_AsSsize_t(values[5]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1231, __pyx_L3_error)
    __pyx_v_rowOffsetType = __Pyx_PyInt_As_cusparseIndexType_t(values[6]); if (unlikely((__pyx_v_rowOffsetType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1232, __pyx_L3_error)
    __pyx_v_colIdxType = __Pyx_PyInt_As_cusparseIndexType_t(values[7]); if (unlikely((__pyx_v_colIdxType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1232, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_cusparseIndexBase_t(values[8]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1233, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyInt_As_cudaDataType(values[9]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1233, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1230, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes___init__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_nnz, __pyx_v_rowOffsets, __pyx_v_colIdx, __pyx_v_values, __pyx_v_rowOffsetType, __pyx_v_colIdxType, __pyx_v_idxBase, __pyx_v_valueType);

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes___init__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_rowOffsets, intptr_t __pyx_v_colIdx, intptr_t __pyx_v_values, cusparseIndexType_t __pyx_v_rowOffsetType, cusparseIndexType_t __pyx_v_colIdxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cupy/cuda/cusparse.pyx":1234
 *                  IndexType rowOffsetType, IndexType colIdxType,
 *                  IndexBase idxBase, DataType valueType):
 *         self.rows = rows             # <<<<<<<<<<<<<<
 *         self.cols = cols
 *         self.nnz = nnz
 */
  __pyx_v_self->rows = __pyx_v_rows;

  /* "cupy/cuda/cusparse.pyx":1235
 *                  IndexBase idxBase, DataType valueType):
 *         self.rows = rows
 *         self.cols = cols             # <<<<<<<<<<<<<<
 *         self.nnz = nnz
 *         self.rowOffsets = rowOffsets
 */
  __pyx_v_self->cols = __pyx_v_cols;

  /* "cupy/cuda/cusparse.pyx":1236
 *         self.rows = rows
 *         self.cols = cols
 *         self.nnz = nnz             # <<<<<<<<<<<<<<
 *         self.rowOffsets = rowOffsets
 *         self.colIdx = colIdx
 */
  __pyx_v_self->nnz = __pyx_v_nnz;

  /* "cupy/cuda/cusparse.pyx":1237
 *         self.cols = cols
 *         self.nnz = nnz
 *         self.rowOffsets = rowOffsets             # <<<<<<<<<<<<<<
 *         self.colIdx = colIdx
 *         self.values = values
 */
  __pyx_v_self->rowOffsets = __pyx_v_rowOffsets;

  /* "cupy/cuda/cusparse.pyx":1238
 *         self.nnz = nnz
 *         self.rowOffsets = rowOffsets
 *         self.colIdx = colIdx             # <<<<<<<<<<<<<<
 *         self.values = values
 *         self.rowOffsetType = rowOffsetType
 */
  __pyx_v_self->colIdx = __pyx_v_colIdx;

  /* "cupy/cuda/cusparse.pyx":1239
 *         self.rowOffsets = rowOffsets
 *         self.colIdx = colIdx
 *         self.values = values             # <<<<<<<<<<<<<<
 *         self.rowOffsetType = rowOffsetType
 *         self.colIdxType = colIdxType
 */
  __pyx_v_self->values = __pyx_v_values;

  /* "cupy/cuda/cusparse.pyx":1240
 *         self.colIdx = colIdx
 *         self.values = values
 *         self.rowOffsetType = rowOffsetType             # <<<<<<<<<<<<<<
 *         self.colIdxType = colIdxType
 *         self.idxBase = idxBase
 */
  __pyx_v_self->rowOffsetType = __pyx_v_rowOffsetType;

  /* "cupy/cuda/cusparse.pyx":1241
 *         self.values = values
 *         self.rowOffsetType = rowOffsetType
 *         self.colIdxType = colIdxType             # <<<<<<<<<<<<<<
 *         self.idxBase = idxBase
 *         self.valueType = valueType
 */
  __pyx_v_self->colIdxType = __pyx_v_colIdxType;

  /* "cupy/cuda/cusparse.pyx":1242
 *         self.rowOffsetType = rowOffsetType
 *         self.colIdxType = colIdxType
 *         self.idxBase = idxBase             # <<<<<<<<<<<<<<
 *         self.valueType = valueType
 * 
 */
  __pyx_v_self->idxBase = __pyx_v_idxBase;

  /* "cupy/cuda/cusparse.pyx":1243
 *         self.colIdxType = colIdxType
 *         self.idxBase = idxBase
 *         self.valueType = valueType             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->valueType = __pyx_v_valueType;

  /* "cupy/cuda/cusparse.pyx":1230
 * cdef class CsrAttributes:
 * 
 *     def __init__(self, int64_t rows, int64_t cols, int64_t nnz,             # <<<<<<<<<<<<<<
 *                  intptr_t rowOffsets, intptr_t colIdx, intptr_t values,
 *                  IndexType rowOffsetType, IndexType colIdxType,
 */

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

/* "cupy/cuda/cusparse.pxd":146
 * cdef class CsrAttributes:
 *     cdef:
 *         public int64_t rows             # <<<<<<<<<<<<<<
 *         public int64_t cols
 *         public int64_t nnz
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_4rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_4rows_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_4rows___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_4rows___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_4rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_4rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_4rows_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_4rows_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 146, __pyx_L1_error)
  __pyx_v_self->rows = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.rows.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":147
 *     cdef:
 *         public int64_t rows
 *         public int64_t cols             # <<<<<<<<<<<<<<
 *         public int64_t nnz
 *         public intptr_t rowOffsets
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_4cols_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_4cols_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_4cols___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_4cols___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.cols.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_4cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_4cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_4cols_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_4cols_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 147, __pyx_L1_error)
  __pyx_v_self->cols = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.cols.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":148
 *         public int64_t rows
 *         public int64_t cols
 *         public int64_t nnz             # <<<<<<<<<<<<<<
 *         public intptr_t rowOffsets
 *         public intptr_t colIdx
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_3nnz_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_3nnz_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_3nnz___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_3nnz___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->nnz); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.nnz.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_3nnz_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_3nnz_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_3nnz_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_3nnz_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 148, __pyx_L1_error)
  __pyx_v_self->nnz = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.nnz.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":149
 *         public int64_t cols
 *         public int64_t nnz
 *         public intptr_t rowOffsets             # <<<<<<<<<<<<<<
 *         public intptr_t colIdx
 *         public intptr_t values
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_10rowOffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_10rowOffsets_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_10rowOffsets___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_10rowOffsets___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->rowOffsets); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.rowOffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_10rowOffsets_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_10rowOffsets_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_10rowOffsets_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_10rowOffsets_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = PyInt_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error)
  __pyx_v_self->rowOffsets = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.rowOffsets.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":150
 *         public int64_t nnz
 *         public intptr_t rowOffsets
 *         public intptr_t colIdx             # <<<<<<<<<<<<<<
 *         public intptr_t values
 *         public IndexType rowOffsetType
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_6colIdx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_6colIdx_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_6colIdx___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_6colIdx___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->colIdx); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.colIdx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_6colIdx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_6colIdx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_6colIdx_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_6colIdx_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = PyInt_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 150, __pyx_L1_error)
  __pyx_v_self->colIdx = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.colIdx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":151
 *         public intptr_t rowOffsets
 *         public intptr_t colIdx
 *         public intptr_t values             # <<<<<<<<<<<<<<
 *         public IndexType rowOffsetType
 *         public IndexType colIdxType
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_6values_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_6values___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_6values___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_6values_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_6values_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = PyInt_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
  __pyx_v_self->values = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.values.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":152
 *         public intptr_t colIdx
 *         public intptr_t values
 *         public IndexType rowOffsetType             # <<<<<<<<<<<<<<
 *         public IndexType colIdxType
 *         public IndexBase idxBase
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_13rowOffsetType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_13rowOffsetType_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_13rowOffsetType___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_13rowOffsetType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_cusparseIndexType_t(__pyx_v_self->rowOffsetType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.rowOffsetType.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_13rowOffsetType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_13rowOffsetType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_13rowOffsetType_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_13rowOffsetType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  cusparseIndexType_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_cusparseIndexType_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 152, __pyx_L1_error)
  __pyx_v_self->rowOffsetType = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.rowOffsetType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":153
 *         public intptr_t values
 *         public IndexType rowOffsetType
 *         public IndexType colIdxType             # <<<<<<<<<<<<<<
 *         public IndexBase idxBase
 *         public DataType valueType
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_10colIdxType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_10colIdxType_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_10colIdxType___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_10colIdxType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_cusparseIndexType_t(__pyx_v_self->colIdxType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.colIdxType.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_10colIdxType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_10colIdxType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_10colIdxType_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_10colIdxType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  cusparseIndexType_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_cusparseIndexType_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 153, __pyx_L1_error)
  __pyx_v_self->colIdxType = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.colIdxType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":154
 *         public IndexType rowOffsetType
 *         public IndexType colIdxType
 *         public IndexBase idxBase             # <<<<<<<<<<<<<<
 *         public DataType valueType
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_7idxBase_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_7idxBase_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_7idxBase___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_7idxBase___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_cusparseIndexBase_t(__pyx_v_self->idxBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.idxBase.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_7idxBase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_7idxBase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_7idxBase_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_7idxBase_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  cusparseIndexBase_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_cusparseIndexBase_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 154, __pyx_L1_error)
  __pyx_v_self->idxBase = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.idxBase.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":155
 *         public IndexType colIdxType
 *         public IndexBase idxBase
 *         public DataType valueType             # <<<<<<<<<<<<<<
 * 
 * cdef class DnVecAttributes:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_9valueType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_9valueType_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_9valueType___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_9valueType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.valueType.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_9valueType_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_9valueType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  cudaDataType __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_cudaDataType(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(1, 155, __pyx_L1_error)
  __pyx_v_self->valueType = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.valueType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_13CsrAttributes_2__reduce_cython__[] = "CsrAttributes.__reduce_cython__(self)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_3__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_4cupy_4cuda_8cusparse_13CsrAttributes_2__reduce_cython__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_2__reduce_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.colIdx, self.colIdxType, self.cols, self.idxBase, self.nnz, self.rowOffsetType, self.rowOffsets, self.rows, self.valueType, self.values)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->colIdx); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_cusparseIndexType_t(__pyx_v_self->colIdxType); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_self->cols); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_cusparseIndexBase_t(__pyx_v_self->idxBase); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_self->nnz); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_From_cusparseIndexType_t(__pyx_v_self->rowOffsetType); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_self->rowOffsets); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyInt_From_int64_t(__pyx_v_self->rows); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyInt_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = PyTuple_New(10); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_11, 8, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_11, 9, __pyx_t_10);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.colIdx, self.colIdxType, self.cols, self.idxBase, self.nnz, self.rowOffsetType, self.rowOffsets, self.rows, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_11 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_v__dict = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "(tree fragment)":7
 *     state = (self.colIdx, self.colIdxType, self.cols, self.idxBase, self.nnz, self.rowOffsetType, self.rowOffsets, self.rows, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_12 = (__pyx_v__dict != Py_None);
  __pyx_t_13 = (__pyx_t_12 != 0);
  if (__pyx_t_13) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v__dict);
    __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_10));
    __pyx_t_10 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.colIdx, self.colIdxType, self.cols, self.idxBase, self.nnz, self.rowOffsetType, self.rowOffsets, self.rows, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_CsrAttributes, (type(self), 0x09bcd38, None), state
 */
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_CsrAttributes, (type(self), 0x09bcd38, None), state
 *     else:
 */
  __pyx_t_13 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_13) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_CsrAttributes, (type(self), 0x09bcd38, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_CsrAttributes, (type(self), 0x09bcd38, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_pyx_unpickle_CsrAttributes); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_10210616);
    __Pyx_GIVEREF(__pyx_int_10210616);
    PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_int_10210616);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_11, 2, Py_None);
    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_state);
    __pyx_t_10 = 0;
    __pyx_t_11 = 0;
    __pyx_r = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_CsrAttributes, (type(self), 0x09bcd38, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_CsrAttributes, (type(self), 0x09bcd38, None), state
 *     else:
 *         return __pyx_unpickle_CsrAttributes, (type(self), 0x09bcd38, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CsrAttributes__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_pyx_unpickle_CsrAttributes); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_10210616);
    __Pyx_GIVEREF(__pyx_int_10210616);
    PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_int_10210616);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_state);
    __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11);
    __pyx_t_9 = 0;
    __pyx_t_11 = 0;
    __pyx_r = __pyx_t_10;
    __pyx_t_10 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CsrAttributes, (type(self), 0x09bcd38, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CsrAttributes__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_13CsrAttributes_4__setstate_cython__[] = "CsrAttributes.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_5__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_4cupy_4cuda_8cusparse_13CsrAttributes_4__setstate_cython__(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CsrAttributes_4__setstate_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_CsrAttributes, (type(self), 0x09bcd38, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CsrAttributes__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_CsrAttributes__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CsrAttributes, (type(self), 0x09bcd38, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CsrAttributes__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CsrAttributes.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1248
 * cdef class DnVecAttributes:
 * 
 *     def __init__(self, int64_t size, intptr_t values, DataType valueType):             # <<<<<<<<<<<<<<
 *         self.size = size
 *         self.values = values
 */

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_size;
  intptr_t __pyx_v_values;
  cudaDataType __pyx_v_valueType;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_values,&__pyx_n_s_valueType,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 1248, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_valueType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 1248, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1248, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_size = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_size == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1248, __pyx_L3_error)
    __pyx_v_values = PyInt_AsSsize_t(values[1]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1248, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyInt_As_cudaDataType(values[2]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1248, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1248, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnVecAttributes.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes___init__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *)__pyx_v_self), __pyx_v_size, __pyx_v_values, __pyx_v_valueType);

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes___init__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self, int64_t __pyx_v_size, intptr_t __pyx_v_values, cudaDataType __pyx_v_valueType) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cupy/cuda/cusparse.pyx":1249
 * 
 *     def __init__(self, int64_t size, intptr_t values, DataType valueType):
 *         self.size = size             # <<<<<<<<<<<<<<
 *         self.values = values
 *         self.valueType = valueType
 */
  __pyx_v_self->size = __pyx_v_size;

  /* "cupy/cuda/cusparse.pyx":1250
 *     def __init__(self, int64_t size, intptr_t values, DataType valueType):
 *         self.size = size
 *         self.values = values             # <<<<<<<<<<<<<<
 *         self.valueType = valueType
 * 
 */
  __pyx_v_self->values = __pyx_v_values;

  /* "cupy/cuda/cusparse.pyx":1251
 *         self.size = size
 *         self.values = values
 *         self.valueType = valueType             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->valueType = __pyx_v_valueType;

  /* "cupy/cuda/cusparse.pyx":1248
 * cdef class DnVecAttributes:
 * 
 *     def __init__(self, int64_t size, intptr_t values, DataType valueType):             # <<<<<<<<<<<<<<
 *         self.size = size
 *         self.values = values
 */

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

/* "cupy/cuda/cusparse.pxd":159
 * cdef class DnVecAttributes:
 *     cdef:
 *         public int64_t size             # <<<<<<<<<<<<<<
 *         public intptr_t values
 *         public DataType valueType
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_4size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_4size___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_4size___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnVecAttributes.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_4size_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_4size_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 159, __pyx_L1_error)
  __pyx_v_self->size = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnVecAttributes.size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":160
 *     cdef:
 *         public int64_t size
 *         public intptr_t values             # <<<<<<<<<<<<<<
 *         public DataType valueType
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_6values_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_6values___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_6values___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnVecAttributes.values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_6values_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_6values_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = PyInt_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 160, __pyx_L1_error)
  __pyx_v_self->values = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnVecAttributes.values.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":161
 *         public int64_t size
 *         public intptr_t values
 *         public DataType valueType             # <<<<<<<<<<<<<<
 * 
 * cdef class DnMatAttributes:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_9valueType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_9valueType_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_9valueType___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_9valueType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnVecAttributes.valueType.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_9valueType_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_9valueType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  cudaDataType __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_cudaDataType(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(1, 161, __pyx_L1_error)
  __pyx_v_self->valueType = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnVecAttributes.valueType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_15DnVecAttributes_2__reduce_cython__[] = "DnVecAttributes.__reduce_cython__(self)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_3__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_4cupy_4cuda_8cusparse_15DnVecAttributes_2__reduce_cython__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_2__reduce_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.size, self.valueType, self.values)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.size, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v__dict = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "(tree fragment)":7
 *     state = (self.size, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_5 = (__pyx_v__dict != Py_None);
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__dict);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.size, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_DnVecAttributes, (type(self), 0xcbbe7db, None), state
 */
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_DnVecAttributes, (type(self), 0xcbbe7db, None), state
 *     else:
 */
  __pyx_t_6 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_DnVecAttributes, (type(self), 0xcbbe7db, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_DnVecAttributes, (type(self), 0xcbbe7db, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_DnVecAttributes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_213641179);
    __Pyx_GIVEREF(__pyx_int_213641179);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_213641179);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None);
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_DnVecAttributes, (type(self), 0xcbbe7db, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_DnVecAttributes, (type(self), 0xcbbe7db, None), state
 *     else:
 *         return __pyx_unpickle_DnVecAttributes, (type(self), 0xcbbe7db, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_DnVecAttributes__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_DnVecAttributes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_213641179);
    __Pyx_GIVEREF(__pyx_int_213641179);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_213641179);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnVecAttributes.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_DnVecAttributes, (type(self), 0xcbbe7db, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_DnVecAttributes__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_15DnVecAttributes_4__setstate_cython__[] = "DnVecAttributes.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_5__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_4cupy_4cuda_8cusparse_15DnVecAttributes_4__setstate_cython__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnVecAttributes_4__setstate_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_DnVecAttributes, (type(self), 0xcbbe7db, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_DnVecAttributes__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_DnVecAttributes__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_DnVecAttributes, (type(self), 0xcbbe7db, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_DnVecAttributes__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnVecAttributes.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1256
 * cdef class DnMatAttributes:
 * 
 *     def __init__(self, int64_t rows, int64_t cols, int64_t ld,             # <<<<<<<<<<<<<<
 *                  intptr_t values, DataType valueType, Order order):
 *         self.rows = rows
 */

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_rows;
  int64_t __pyx_v_cols;
  int64_t __pyx_v_ld;
  intptr_t __pyx_v_values;
  cudaDataType __pyx_v_valueType;
  cusparseOrder_t __pyx_v_order;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_ld,&__pyx_n_s_values,&__pyx_n_s_valueType,&__pyx_n_s_order,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 1); __PYX_ERR(0, 1256, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ld)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 2); __PYX_ERR(0, 1256, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 3); __PYX_ERR(0, 1256, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_valueType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 4); __PYX_ERR(0, 1256, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_order)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 5); __PYX_ERR(0, 1256, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1256, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_rows = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1256, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1256, __pyx_L3_error)
    __pyx_v_ld = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_ld == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1256, __pyx_L3_error)
    __pyx_v_values = PyInt_AsSsize_t(values[3]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1257, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyInt_As_cudaDataType(values[4]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1257, __pyx_L3_error)
    __pyx_v_order = __Pyx_PyInt_As_cusparseOrder_t(values[5]); if (unlikely((__pyx_v_order == ((cusparseOrder_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1257, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1256, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatAttributes.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes___init__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_ld, __pyx_v_values, __pyx_v_valueType, __pyx_v_order);

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes___init__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_ld, intptr_t __pyx_v_values, cudaDataType __pyx_v_valueType, cusparseOrder_t __pyx_v_order) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cupy/cuda/cusparse.pyx":1258
 *     def __init__(self, int64_t rows, int64_t cols, int64_t ld,
 *                  intptr_t values, DataType valueType, Order order):
 *         self.rows = rows             # <<<<<<<<<<<<<<
 *         self.cols = cols
 *         self.ld = ld
 */
  __pyx_v_self->rows = __pyx_v_rows;

  /* "cupy/cuda/cusparse.pyx":1259
 *                  intptr_t values, DataType valueType, Order order):
 *         self.rows = rows
 *         self.cols = cols             # <<<<<<<<<<<<<<
 *         self.ld = ld
 *         self.values = values
 */
  __pyx_v_self->cols = __pyx_v_cols;

  /* "cupy/cuda/cusparse.pyx":1260
 *         self.rows = rows
 *         self.cols = cols
 *         self.ld = ld             # <<<<<<<<<<<<<<
 *         self.values = values
 *         self.valueType = valueType
 */
  __pyx_v_self->ld = __pyx_v_ld;

  /* "cupy/cuda/cusparse.pyx":1261
 *         self.cols = cols
 *         self.ld = ld
 *         self.values = values             # <<<<<<<<<<<<<<
 *         self.valueType = valueType
 *         self.order = order
 */
  __pyx_v_self->values = __pyx_v_values;

  /* "cupy/cuda/cusparse.pyx":1262
 *         self.ld = ld
 *         self.values = values
 *         self.valueType = valueType             # <<<<<<<<<<<<<<
 *         self.order = order
 * 
 */
  __pyx_v_self->valueType = __pyx_v_valueType;

  /* "cupy/cuda/cusparse.pyx":1263
 *         self.values = values
 *         self.valueType = valueType
 *         self.order = order             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->order = __pyx_v_order;

  /* "cupy/cuda/cusparse.pyx":1256
 * cdef class DnMatAttributes:
 * 
 *     def __init__(self, int64_t rows, int64_t cols, int64_t ld,             # <<<<<<<<<<<<<<
 *                  intptr_t values, DataType valueType, Order order):
 *         self.rows = rows
 */

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

/* "cupy/cuda/cusparse.pxd":165
 * cdef class DnMatAttributes:
 *     cdef:
 *         public int64_t rows             # <<<<<<<<<<<<<<
 *         public int64_t cols
 *         public int64_t ld
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_4rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_4rows_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_4rows___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_4rows___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatAttributes.rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_4rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_4rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_4rows_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_4rows_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 165, __pyx_L1_error)
  __pyx_v_self->rows = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatAttributes.rows.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":166
 *     cdef:
 *         public int64_t rows
 *         public int64_t cols             # <<<<<<<<<<<<<<
 *         public int64_t ld
 *         public intptr_t values
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_4cols_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_4cols_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_4cols___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_4cols___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatAttributes.cols.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_4cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_4cols_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_4cols_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_4cols_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 166, __pyx_L1_error)
  __pyx_v_self->cols = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatAttributes.cols.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":167
 *         public int64_t rows
 *         public int64_t cols
 *         public int64_t ld             # <<<<<<<<<<<<<<
 *         public intptr_t values
 *         public DataType valueType
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_2ld_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_2ld_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_2ld___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_2ld___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->ld); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatAttributes.ld.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_2ld_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_2ld_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_2ld_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_2ld_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 167, __pyx_L1_error)
  __pyx_v_self->ld = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatAttributes.ld.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":168
 *         public int64_t cols
 *         public int64_t ld
 *         public intptr_t values             # <<<<<<<<<<<<<<
 *         public DataType valueType
 *         public Order order
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_6values_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_6values___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_6values___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatAttributes.values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_6values_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_6values_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = PyInt_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error)
  __pyx_v_self->values = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatAttributes.values.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":169
 *         public int64_t ld
 *         public intptr_t values
 *         public DataType valueType             # <<<<<<<<<<<<<<
 *         public Order order
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_9valueType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_9valueType_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_9valueType___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_9valueType___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatAttributes.valueType.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_9valueType_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_9valueType_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_9valueType_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  cudaDataType __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_cudaDataType(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(1, 169, __pyx_L1_error)
  __pyx_v_self->valueType = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatAttributes.valueType.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":170
 *         public intptr_t values
 *         public DataType valueType
 *         public Order order             # <<<<<<<<<<<<<<
 * 
 * cdef class DnMatBatchAttributes:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_5order_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_5order_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_5order___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_5order___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_cusparseOrder_t(__pyx_v_self->order); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatAttributes.order.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_5order_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_5order_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_5order_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_5order_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  cusparseOrder_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_cusparseOrder_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((cusparseOrder_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
  __pyx_v_self->order = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatAttributes.order.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_15DnMatAttributes_2__reduce_cython__[] = "DnMatAttributes.__reduce_cython__(self)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_3__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_4cupy_4cuda_8cusparse_15DnMatAttributes_2__reduce_cython__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_2__reduce_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.cols, self.ld, self.order, self.rows, self.valueType, self.values)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->cols); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_self->ld); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_cusparseOrder_t(__pyx_v_self->order); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_self->rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_cudaDataType(__pyx_v_self->valueType); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_self->values); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_6);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.cols, self.ld, self.order, self.rows, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_7 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_v__dict = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "(tree fragment)":7
 *     state = (self.cols, self.ld, self.order, self.rows, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_8 = (__pyx_v__dict != Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v__dict);
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.cols, self.ld, self.order, self.rows, self.valueType, self.values)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_DnMatAttributes, (type(self), 0x9d3053a, None), state
 */
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_DnMatAttributes, (type(self), 0x9d3053a, None), state
 *     else:
 */
  __pyx_t_9 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_9) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_DnMatAttributes, (type(self), 0x9d3053a, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_DnMatAttributes, (type(self), 0x9d3053a, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_DnMatAttributes); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_164824378);
    __Pyx_GIVEREF(__pyx_int_164824378);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_164824378);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_7, 2, Py_None);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_DnMatAttributes, (type(self), 0x9d3053a, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_DnMatAttributes, (type(self), 0x9d3053a, None), state
 *     else:
 *         return __pyx_unpickle_DnMatAttributes, (type(self), 0x9d3053a, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_DnMatAttributes__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_DnMatAttributes); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_164824378);
    __Pyx_GIVEREF(__pyx_int_164824378);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_164824378);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
    __pyx_t_5 = 0;
    __pyx_t_7 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatAttributes.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_DnMatAttributes, (type(self), 0x9d3053a, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_DnMatAttributes__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_15DnMatAttributes_4__setstate_cython__[] = "DnMatAttributes.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_5__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_4cupy_4cuda_8cusparse_15DnMatAttributes_4__setstate_cython__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_15DnMatAttributes_4__setstate_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_DnMatAttributes, (type(self), 0x9d3053a, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_DnMatAttributes__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_DnMatAttributes__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_DnMatAttributes, (type(self), 0x9d3053a, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_DnMatAttributes__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatAttributes.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1268
 * cdef class DnMatBatchAttributes:
 * 
 *     def __init__(self, int count, int64_t stride):             # <<<<<<<<<<<<<<
 *         self.count = count
 *         self.stride = stride
 */

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_count;
  int64_t __pyx_v_stride;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_count,&__pyx_n_s_stride,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stride)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1268, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1268, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_count = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1268, __pyx_L3_error)
    __pyx_v_stride = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_stride == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1268, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1268, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatBatchAttributes.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes___init__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *)__pyx_v_self), __pyx_v_count, __pyx_v_stride);

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

static int __pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes___init__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_v_self, int __pyx_v_count, int64_t __pyx_v_stride) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cupy/cuda/cusparse.pyx":1269
 * 
 *     def __init__(self, int count, int64_t stride):
 *         self.count = count             # <<<<<<<<<<<<<<
 *         self.stride = stride
 * 
 */
  __pyx_v_self->count = __pyx_v_count;

  /* "cupy/cuda/cusparse.pyx":1270
 *     def __init__(self, int count, int64_t stride):
 *         self.count = count
 *         self.stride = stride             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->stride = __pyx_v_stride;

  /* "cupy/cuda/cusparse.pyx":1268
 * cdef class DnMatBatchAttributes:
 * 
 *     def __init__(self, int count, int64_t stride):             # <<<<<<<<<<<<<<
 *         self.count = count
 *         self.stride = stride
 */

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

/* "cupy/cuda/cusparse.pxd":174
 * cdef class DnMatBatchAttributes:
 *     cdef:
 *         public int count             # <<<<<<<<<<<<<<
 *         public int64_t stride
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_5count_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_5count_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_5count___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_5count___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatBatchAttributes.count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_5count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_5count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_5count_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_5count_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 174, __pyx_L1_error)
  __pyx_v_self->count = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatBatchAttributes.count.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pxd":175
 *     cdef:
 *         public int count
 *         public int64_t stride             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t create() except? 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_6stride_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_6stride_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_6stride___get__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_6stride___get__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->stride); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatBatchAttributes.stride.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_6stride_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_6stride_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_6stride_2__set__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_6stride_2__set__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 175, __pyx_L1_error)
  __pyx_v_self->stride = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatBatchAttributes.stride.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_2__reduce_cython__[] = "DnMatBatchAttributes.__reduce_cython__(self)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_3__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_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_2__reduce_cython__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_2__reduce_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.count, self.stride)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_self->stride); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.count, self.stride)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v__dict = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":7
 *     state = (self.count, self.stride)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_4 = (__pyx_v__dict != Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.count, self.stride)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_DnMatBatchAttributes, (type(self), 0xb66dd58, None), state
 */
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_DnMatBatchAttributes, (type(self), 0xb66dd58, None), state
 *     else:
 */
  __pyx_t_5 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_5) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_DnMatBatchAttributes, (type(self), 0xb66dd58, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_DnMatBatchAttributes, (type(self), 0xb66dd58, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_DnMatBatchAttribu); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_191290712);
    __Pyx_GIVEREF(__pyx_int_191290712);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_191290712);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_DnMatBatchAttributes, (type(self), 0xb66dd58, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_DnMatBatchAttributes, (type(self), 0xb66dd58, None), state
 *     else:
 *         return __pyx_unpickle_DnMatBatchAttributes, (type(self), 0xb66dd58, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_DnMatBatchAttributes__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_DnMatBatchAttribu); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_191290712);
    __Pyx_GIVEREF(__pyx_int_191290712);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_191290712);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
    __pyx_t_1 = 0;
    __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatBatchAttributes.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_DnMatBatchAttributes, (type(self), 0xb66dd58, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_DnMatBatchAttributes__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_4__setstate_cython__[] = "DnMatBatchAttributes.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_5__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_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_4__setstate_cython__(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_4__setstate_cython__(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_DnMatBatchAttributes, (type(self), 0xb66dd58, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_DnMatBatchAttributes__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_DnMatBatchAttributes__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_DnMatBatchAttributes, (type(self), 0xb66dd58, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_DnMatBatchAttributes__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.DnMatBatchAttributes.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1275
 * class CuSparseError(RuntimeError):
 * 
 *     def __init__(self, int status):             # <<<<<<<<<<<<<<
 *         self.status = status
 *         super(CuSparseError, self).__init__('%s' % (STATUS[status]))
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CuSparseError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_13CuSparseError___init__[] = "CuSparseError.__init__(self, int status)";
static PyMethodDef __pyx_mdef_4cupy_4cuda_8cusparse_13CuSparseError_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_13CuSparseError_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_13CuSparseError___init__};
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CuSparseError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_status;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_status,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_status)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1275, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1275, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_status = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_status == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1275, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1275, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.CuSparseError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CuSparseError___init__(__pyx_self, __pyx_v_self, __pyx_v_status);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CuSparseError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_status) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cupy/cuda/cusparse.pyx":1276
 * 
 *     def __init__(self, int status):
 *         self.status = status             # <<<<<<<<<<<<<<
 *         super(CuSparseError, self).__init__('%s' % (STATUS[status]))
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_status, __pyx_t_1) < 0) __PYX_ERR(0, 1276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1277
 *     def __init__(self, int status):
 *         self.status = status
 *         super(CuSparseError, self).__init__('%s' % (STATUS[status]))             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CuSparseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_v_4cupy_4cuda_8cusparse_STATUS == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1277, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_4cupy_4cuda_8cusparse_STATUS, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1275
 * class CuSparseError(RuntimeError):
 * 
 *     def __init__(self, int status):             # <<<<<<<<<<<<<<
 *         self.status = status
 *         super(CuSparseError, self).__init__('%s' % (STATUS[status]))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CuSparseError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1279
 *         super(CuSparseError, self).__init__('%s' % (STATUS[status]))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return (type(self), (self.status,))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CuSparseError_3__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_13CuSparseError_2__reduce__[] = "CuSparseError.__reduce__(self)";
static PyMethodDef __pyx_mdef_4cupy_4cuda_8cusparse_13CuSparseError_3__reduce__ = {"__reduce__", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_13CuSparseError_3__reduce__, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_13CuSparseError_2__reduce__};
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13CuSparseError_3__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_13CuSparseError_2__reduce__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_13CuSparseError_2__reduce__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "cupy/cuda/cusparse.pyx":1280
 * 
 *     def __reduce__(self):
 *         return (type(self), (self.status,))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self)));
  __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_self)));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(__pyx_v_self)));
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":1279
 *         super(CuSparseError, self).__init__('%s' % (STATUS[status]))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return (type(self), (self.status,))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy.cuda.cusparse.CuSparseError.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1284
 * 
 * @cython.profile(False)
 * cpdef inline check_status(int status):             # <<<<<<<<<<<<<<
 *     if status != 0:
 *         raise CuSparseError(status)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_1check_status(PyObject *__pyx_self, PyObject *__pyx_arg_status); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_4cupy_4cuda_8cusparse_check_status(int __pyx_v_status, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_status", 0);

  /* "cupy/cuda/cusparse.pyx":1285
 * @cython.profile(False)
 * cpdef inline check_status(int status):
 *     if status != 0:             # <<<<<<<<<<<<<<
 *         raise CuSparseError(status)
 * 
 */
  __pyx_t_1 = ((__pyx_v_status != 0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cupy/cuda/cusparse.pyx":1286
 * cpdef inline check_status(int status):
 *     if status != 0:
 *         raise CuSparseError(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CuSparseError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1286, __pyx_L1_error)

    /* "cupy/cuda/cusparse.pyx":1285
 * @cython.profile(False)
 * cpdef inline check_status(int status):
 *     if status != 0:             # <<<<<<<<<<<<<<
 *         raise CuSparseError(status)
 * 
 */
  }

  /* "cupy/cuda/cusparse.pyx":1284
 * 
 * @cython.profile(False)
 * cpdef inline check_status(int status):             # <<<<<<<<<<<<<<
 *     if status != 0:
 *         raise CuSparseError(status)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cupy.cuda.cusparse.check_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_1check_status(PyObject *__pyx_self, PyObject *__pyx_arg_status); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_check_status[] = "check_status(int status)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_1check_status(PyObject *__pyx_self, PyObject *__pyx_arg_status) {
  int __pyx_v_status;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_status (wrapper)", 0);
  assert(__pyx_arg_status); {
    __pyx_v_status = __Pyx_PyInt_As_int(__pyx_arg_status); if (unlikely((__pyx_v_status == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1284, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.check_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_check_status(__pyx_self, ((int)__pyx_v_status));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_check_status(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_status) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_status", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.check_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1290
 * 
 * @cython.profile(False)
 * cdef inline cuComplex complex_to_cuda(complex value):             # <<<<<<<<<<<<<<
 *     cdef cuComplex value_cuda
 *     value_cuda.x = value.real
 */

static CYTHON_INLINE cuComplex __pyx_f_4cupy_4cuda_8cusparse_complex_to_cuda(__pyx_t_double_complex __pyx_v_value) {
  cuComplex __pyx_v_value_cuda;
  cuComplex __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  __Pyx_RefNannySetupContext("complex_to_cuda", 0);

  /* "cupy/cuda/cusparse.pyx":1292
 * cdef inline cuComplex complex_to_cuda(complex value):
 *     cdef cuComplex value_cuda
 *     value_cuda.x = value.real             # <<<<<<<<<<<<<<
 *     value_cuda.y = value.imag
 *     return value_cuda
 */
  __pyx_t_1 = __Pyx_CREAL(__pyx_v_value);
  __pyx_v_value_cuda.x = __pyx_t_1;

  /* "cupy/cuda/cusparse.pyx":1293
 *     cdef cuComplex value_cuda
 *     value_cuda.x = value.real
 *     value_cuda.y = value.imag             # <<<<<<<<<<<<<<
 *     return value_cuda
 * 
 */
  __pyx_t_1 = __Pyx_CIMAG(__pyx_v_value);
  __pyx_v_value_cuda.y = __pyx_t_1;

  /* "cupy/cuda/cusparse.pyx":1294
 *     value_cuda.x = value.real
 *     value_cuda.y = value.imag
 *     return value_cuda             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_value_cuda;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":1290
 * 
 * @cython.profile(False)
 * cdef inline cuComplex complex_to_cuda(complex value):             # <<<<<<<<<<<<<<
 *     cdef cuComplex value_cuda
 *     value_cuda.x = value.real
 */

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

/* "cupy/cuda/cusparse.pyx":1298
 * 
 * @cython.profile(False)
 * cdef inline cuDoubleComplex double_complex_to_cuda(double complex value):             # <<<<<<<<<<<<<<
 *     cdef cuDoubleComplex value_cuda
 *     value_cuda.x = value.real
 */

static CYTHON_INLINE cuDoubleComplex __pyx_f_4cupy_4cuda_8cusparse_double_complex_to_cuda(__pyx_t_double_complex __pyx_v_value) {
  cuDoubleComplex __pyx_v_value_cuda;
  cuDoubleComplex __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  __Pyx_RefNannySetupContext("double_complex_to_cuda", 0);

  /* "cupy/cuda/cusparse.pyx":1300
 * cdef inline cuDoubleComplex double_complex_to_cuda(double complex value):
 *     cdef cuDoubleComplex value_cuda
 *     value_cuda.x = value.real             # <<<<<<<<<<<<<<
 *     value_cuda.y = value.imag
 *     return value_cuda
 */
  __pyx_t_1 = __Pyx_CREAL(__pyx_v_value);
  __pyx_v_value_cuda.x = __pyx_t_1;

  /* "cupy/cuda/cusparse.pyx":1301
 *     cdef cuDoubleComplex value_cuda
 *     value_cuda.x = value.real
 *     value_cuda.y = value.imag             # <<<<<<<<<<<<<<
 *     return value_cuda
 * 
 */
  __pyx_t_1 = __Pyx_CIMAG(__pyx_v_value);
  __pyx_v_value_cuda.y = __pyx_t_1;

  /* "cupy/cuda/cusparse.pyx":1302
 *     value_cuda.x = value.real
 *     value_cuda.y = value.imag
 *     return value_cuda             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_value_cuda;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":1298
 * 
 * @cython.profile(False)
 * cdef inline cuDoubleComplex double_complex_to_cuda(double complex value):             # <<<<<<<<<<<<<<
 *     cdef cuDoubleComplex value_cuda
 *     value_cuda.x = value.real
 */

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

/* "cupy/cuda/cusparse.pyx":1305
 * 
 * 
 * cpdef int getVersion(size_t handle) except? -1:             # <<<<<<<<<<<<<<
 *     cdef int version
 *     status = cusparseGetVersion(<Handle>handle, &version)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_3getVersion(PyObject *__pyx_self, PyObject *__pyx_arg_handle); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_getVersion(size_t __pyx_v_handle, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_version;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getVersion", 0);

  /* "cupy/cuda/cusparse.pyx":1307
 * cpdef int getVersion(size_t handle) except? -1:
 *     cdef int version
 *     status = cusparseGetVersion(<Handle>handle, &version)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return version
 */
  __pyx_v_status = cusparseGetVersion(((cusparseHandle_t)__pyx_v_handle), (&__pyx_v_version));

  /* "cupy/cuda/cusparse.pyx":1308
 *     cdef int version
 *     status = cusparseGetVersion(<Handle>handle, &version)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return version
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1309
 *     status = cusparseGetVersion(<Handle>handle, &version)
 *     check_status(status)
 *     return version             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_version;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":1305
 * 
 * 
 * cpdef int getVersion(size_t handle) except? -1:             # <<<<<<<<<<<<<<
 *     cdef int version
 *     status = cusparseGetVersion(<Handle>handle, &version)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.getVersion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_3getVersion(PyObject *__pyx_self, PyObject *__pyx_arg_handle); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_2getVersion[] = "getVersion(size_t handle) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_3getVersion(PyObject *__pyx_self, PyObject *__pyx_arg_handle) {
  size_t __pyx_v_handle;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getVersion (wrapper)", 0);
  assert(__pyx_arg_handle); {
    __pyx_v_handle = __Pyx_PyInt_As_size_t(__pyx_arg_handle); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1305, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.getVersion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_2getVersion(__pyx_self, ((size_t)__pyx_v_handle));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_2getVersion(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getVersion", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_getVersion(__pyx_v_handle, 0); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1305, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy.cuda.cusparse.getVersion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1312
 * 
 * 
 * def get_build_version():             # <<<<<<<<<<<<<<
 *     return CUSPARSE_VERSION
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_5get_build_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_4get_build_version[] = "get_build_version()";
static PyMethodDef __pyx_mdef_4cupy_4cuda_8cusparse_5get_build_version = {"get_build_version", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_5get_build_version, METH_NOARGS, __pyx_doc_4cupy_4cuda_8cusparse_4get_build_version};
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_5get_build_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_build_version (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_4get_build_version(__pyx_self);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_4get_build_version(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_build_version", 0);

  /* "cupy/cuda/cusparse.pyx":1313
 * 
 * def get_build_version():
 *     return CUSPARSE_VERSION             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(CUSPARSE_VERSION); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":1312
 * 
 * 
 * def get_build_version():             # <<<<<<<<<<<<<<
 *     return CUSPARSE_VERSION
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.get_build_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1319
 * # cuSPARSE Helper Function
 * 
 * cpdef size_t create() except? 0:             # <<<<<<<<<<<<<<
 *     cdef Handle handle
 *     status = cusparseCreate(& handle)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_7create(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_create(CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseHandle_t __pyx_v_handle;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 0);

  /* "cupy/cuda/cusparse.pyx":1321
 * cpdef size_t create() except? 0:
 *     cdef Handle handle
 *     status = cusparseCreate(& handle)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t >handle
 */
  __pyx_v_status = cusparseCreate((&__pyx_v_handle));

  /* "cupy/cuda/cusparse.pyx":1322
 *     cdef Handle handle
 *     status = cusparseCreate(& handle)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t >handle
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1323
 *     status = cusparseCreate(& handle)
 *     check_status(status)
 *     return <size_t >handle             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((size_t)__pyx_v_handle);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":1319
 * # cuSPARSE Helper Function
 * 
 * cpdef size_t create() except? 0:             # <<<<<<<<<<<<<<
 *     cdef Handle handle
 *     status = cusparseCreate(& handle)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_7create(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_6create[] = "create() -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_7create(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_6create(__pyx_self);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_6create(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_create(0); if (unlikely(__pyx_t_1 == ((size_t)0) && PyErr_Occurred())) __PYX_ERR(0, 1319, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy.cuda.cusparse.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1326
 * 
 * 
 * cpdef size_t createMatDescr():             # <<<<<<<<<<<<<<
 *     cdef MatDescr desc
 *     status = cusparseCreateMatDescr(& desc)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_9createMatDescr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createMatDescr(CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseMatDescr_t __pyx_v_desc;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createMatDescr", 0);

  /* "cupy/cuda/cusparse.pyx":1328
 * cpdef size_t createMatDescr():
 *     cdef MatDescr desc
 *     status = cusparseCreateMatDescr(& desc)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>desc
 */
  __pyx_v_status = cusparseCreateMatDescr((&__pyx_v_desc));

  /* "cupy/cuda/cusparse.pyx":1329
 *     cdef MatDescr desc
 *     status = cusparseCreateMatDescr(& desc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>desc
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1330
 *     status = cusparseCreateMatDescr(& desc)
 *     check_status(status)
 *     return <size_t>desc             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((size_t)__pyx_v_desc);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":1326
 * 
 * 
 * cpdef size_t createMatDescr():             # <<<<<<<<<<<<<<
 *     cdef MatDescr desc
 *     status = cusparseCreateMatDescr(& desc)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.createMatDescr", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_9createMatDescr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_8createMatDescr[] = "createMatDescr() -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_9createMatDescr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createMatDescr (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_8createMatDescr(__pyx_self);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_8createMatDescr(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createMatDescr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_createMatDescr(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.createMatDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1333
 * 
 * 
 * cpdef destroy(size_t handle):             # <<<<<<<<<<<<<<
 *     status = cusparseDestroy(<Handle >handle)
 *     check_status(status)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_11destroy(PyObject *__pyx_self, PyObject *__pyx_arg_handle); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroy(size_t __pyx_v_handle, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroy", 0);

  /* "cupy/cuda/cusparse.pyx":1334
 * 
 * cpdef destroy(size_t handle):
 *     status = cusparseDestroy(<Handle >handle)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
  __pyx_v_status = cusparseDestroy(((cusparseHandle_t)__pyx_v_handle));

  /* "cupy/cuda/cusparse.pyx":1335
 * cpdef destroy(size_t handle):
 *     status = cusparseDestroy(<Handle >handle)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1333
 * 
 * 
 * cpdef destroy(size_t handle):             # <<<<<<<<<<<<<<
 *     status = cusparseDestroy(<Handle >handle)
 *     check_status(status)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_11destroy(PyObject *__pyx_self, PyObject *__pyx_arg_handle); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_10destroy[] = "destroy(size_t handle)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_11destroy(PyObject *__pyx_self, PyObject *__pyx_arg_handle) {
  size_t __pyx_v_handle;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroy (wrapper)", 0);
  assert(__pyx_arg_handle); {
    __pyx_v_handle = __Pyx_PyInt_As_size_t(__pyx_arg_handle); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1333, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_10destroy(__pyx_self, ((size_t)__pyx_v_handle));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_10destroy(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroy", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_destroy(__pyx_v_handle, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1338
 * 
 * 
 * cpdef destroyMatDescr(size_t descr):             # <<<<<<<<<<<<<<
 *     status = cusparseDestroyMatDescr(<MatDescr>descr)
 *     check_status(status)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13destroyMatDescr(PyObject *__pyx_self, PyObject *__pyx_arg_descr); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroyMatDescr(size_t __pyx_v_descr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyMatDescr", 0);

  /* "cupy/cuda/cusparse.pyx":1339
 * 
 * cpdef destroyMatDescr(size_t descr):
 *     status = cusparseDestroyMatDescr(<MatDescr>descr)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
  __pyx_v_status = cusparseDestroyMatDescr(((cusparseMatDescr_t)__pyx_v_descr));

  /* "cupy/cuda/cusparse.pyx":1340
 * cpdef destroyMatDescr(size_t descr):
 *     status = cusparseDestroyMatDescr(<MatDescr>descr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1338
 * 
 * 
 * cpdef destroyMatDescr(size_t descr):             # <<<<<<<<<<<<<<
 *     status = cusparseDestroyMatDescr(<MatDescr>descr)
 *     check_status(status)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyMatDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13destroyMatDescr(PyObject *__pyx_self, PyObject *__pyx_arg_descr); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_12destroyMatDescr[] = "destroyMatDescr(size_t descr)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_13destroyMatDescr(PyObject *__pyx_self, PyObject *__pyx_arg_descr) {
  size_t __pyx_v_descr;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyMatDescr (wrapper)", 0);
  assert(__pyx_arg_descr); {
    __pyx_v_descr = __Pyx_PyInt_As_size_t(__pyx_arg_descr); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1338, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyMatDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_12destroyMatDescr(__pyx_self, ((size_t)__pyx_v_descr));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_12destroyMatDescr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_descr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyMatDescr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_destroyMatDescr(__pyx_v_descr, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyMatDescr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1343
 * 
 * 
 * cpdef setMatIndexBase(size_t descr, base):             # <<<<<<<<<<<<<<
 *     status = cusparseSetMatIndexBase(<MatDescr>descr, base)
 *     check_status(status)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15setMatIndexBase(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_setMatIndexBase(size_t __pyx_v_descr, PyObject *__pyx_v_base, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  cusparseIndexBase_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setMatIndexBase", 0);

  /* "cupy/cuda/cusparse.pyx":1344
 * 
 * cpdef setMatIndexBase(size_t descr, base):
 *     status = cusparseSetMatIndexBase(<MatDescr>descr, base)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_As_cusparseIndexBase_t(__pyx_v_base); if (unlikely((__pyx_t_1 == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1344, __pyx_L1_error)
  __pyx_v_status = cusparseSetMatIndexBase(((cusparseMatDescr_t)__pyx_v_descr), __pyx_t_1);

  /* "cupy/cuda/cusparse.pyx":1345
 * cpdef setMatIndexBase(size_t descr, base):
 *     status = cusparseSetMatIndexBase(<MatDescr>descr, base)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cupy/cuda/cusparse.pyx":1343
 * 
 * 
 * cpdef setMatIndexBase(size_t descr, base):             # <<<<<<<<<<<<<<
 *     status = cusparseSetMatIndexBase(<MatDescr>descr, base)
 *     check_status(status)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy.cuda.cusparse.setMatIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15setMatIndexBase(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_14setMatIndexBase[] = "setMatIndexBase(size_t descr, base)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_15setMatIndexBase(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_descr;
  PyObject *__pyx_v_base = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setMatIndexBase (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_descr,&__pyx_n_s_base,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setMatIndexBase", 1, 2, 2, 1); __PYX_ERR(0, 1343, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMatIndexBase") < 0)) __PYX_ERR(0, 1343, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_descr = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1343, __pyx_L3_error)
    __pyx_v_base = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setMatIndexBase", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1343, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.setMatIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_14setMatIndexBase(__pyx_self, __pyx_v_descr, __pyx_v_base);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_14setMatIndexBase(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_descr, PyObject *__pyx_v_base) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setMatIndexBase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setMatIndexBase(__pyx_v_descr, __pyx_v_base, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.setMatIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1348
 * 
 * 
 * cpdef setMatType(size_t descr, typ):             # <<<<<<<<<<<<<<
 *     status = cusparseSetMatType(<MatDescr>descr, typ)
 *     check_status(status)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_17setMatType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_setMatType(size_t __pyx_v_descr, PyObject *__pyx_v_typ, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  cusparseMatrixType_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setMatType", 0);

  /* "cupy/cuda/cusparse.pyx":1349
 * 
 * cpdef setMatType(size_t descr, typ):
 *     status = cusparseSetMatType(<MatDescr>descr, typ)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_As_cusparseMatrixType_t(__pyx_v_typ); if (unlikely((__pyx_t_1 == ((cusparseMatrixType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1349, __pyx_L1_error)
  __pyx_v_status = cusparseSetMatType(((cusparseMatDescr_t)__pyx_v_descr), __pyx_t_1);

  /* "cupy/cuda/cusparse.pyx":1350
 * cpdef setMatType(size_t descr, typ):
 *     status = cusparseSetMatType(<MatDescr>descr, typ)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cupy/cuda/cusparse.pyx":1348
 * 
 * 
 * cpdef setMatType(size_t descr, typ):             # <<<<<<<<<<<<<<
 *     status = cusparseSetMatType(<MatDescr>descr, typ)
 *     check_status(status)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy.cuda.cusparse.setMatType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_17setMatType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_16setMatType[] = "setMatType(size_t descr, typ)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_17setMatType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_descr;
  PyObject *__pyx_v_typ = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setMatType (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_descr,&__pyx_n_s_typ,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typ)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setMatType", 1, 2, 2, 1); __PYX_ERR(0, 1348, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMatType") < 0)) __PYX_ERR(0, 1348, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_descr = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1348, __pyx_L3_error)
    __pyx_v_typ = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setMatType", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1348, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.setMatType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_16setMatType(__pyx_self, __pyx_v_descr, __pyx_v_typ);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_16setMatType(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_descr, PyObject *__pyx_v_typ) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setMatType", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setMatType(__pyx_v_descr, __pyx_v_typ, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.setMatType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1353
 * 
 * 
 * cpdef setPointerMode(size_t handle, int mode):             # <<<<<<<<<<<<<<
 *     status = cusparseSetPointerMode(<Handle>handle, <PointerMode>mode)
 *     check_status(status)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_19setPointerMode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_setPointerMode(size_t __pyx_v_handle, int __pyx_v_mode, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setPointerMode", 0);

  /* "cupy/cuda/cusparse.pyx":1354
 * 
 * cpdef setPointerMode(size_t handle, int mode):
 *     status = cusparseSetPointerMode(<Handle>handle, <PointerMode>mode)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
  __pyx_v_status = cusparseSetPointerMode(((cusparseHandle_t)__pyx_v_handle), ((cusparsePointerMode_t)__pyx_v_mode));

  /* "cupy/cuda/cusparse.pyx":1355
 * cpdef setPointerMode(size_t handle, int mode):
 *     status = cusparseSetPointerMode(<Handle>handle, <PointerMode>mode)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ########################################
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1353
 * 
 * 
 * cpdef setPointerMode(size_t handle, int mode):             # <<<<<<<<<<<<<<
 *     status = cusparseSetPointerMode(<Handle>handle, <PointerMode>mode)
 *     check_status(status)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.setPointerMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_19setPointerMode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_18setPointerMode[] = "setPointerMode(size_t handle, int mode)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_19setPointerMode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_mode;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setPointerMode (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_mode,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setPointerMode", 1, 2, 2, 1); __PYX_ERR(0, 1353, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPointerMode") < 0)) __PYX_ERR(0, 1353, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1353, __pyx_L3_error)
    __pyx_v_mode = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1353, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPointerMode", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1353, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.setPointerMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_18setPointerMode(__pyx_self, __pyx_v_handle, __pyx_v_mode);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_18setPointerMode(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_mode) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setPointerMode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setPointerMode(__pyx_v_handle, __pyx_v_mode, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.setPointerMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1360
 * # Stream
 * 
 * cpdef setStream(size_t handle, size_t stream):             # <<<<<<<<<<<<<<
 *     status = cusparseSetStream(<Handle>handle, <driver.Stream>stream)
 *     check_status(status)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_21setStream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_setStream(size_t __pyx_v_handle, size_t __pyx_v_stream, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setStream", 0);

  /* "cupy/cuda/cusparse.pyx":1361
 * 
 * cpdef setStream(size_t handle, size_t stream):
 *     status = cusparseSetStream(<Handle>handle, <driver.Stream>stream)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
  __pyx_v_status = cusparseSetStream(((cusparseHandle_t)__pyx_v_handle), ((cudaStream_t)__pyx_v_stream));

  /* "cupy/cuda/cusparse.pyx":1362
 * cpdef setStream(size_t handle, size_t stream):
 *     status = cusparseSetStream(<Handle>handle, <driver.Stream>stream)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1360
 * # Stream
 * 
 * cpdef setStream(size_t handle, size_t stream):             # <<<<<<<<<<<<<<
 *     status = cusparseSetStream(<Handle>handle, <driver.Stream>stream)
 *     check_status(status)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.setStream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_21setStream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_20setStream[] = "setStream(size_t handle, size_t stream)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_21setStream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  size_t __pyx_v_stream;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setStream (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_stream,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setStream", 1, 2, 2, 1); __PYX_ERR(0, 1360, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setStream") < 0)) __PYX_ERR(0, 1360, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1360, __pyx_L3_error)
    __pyx_v_stream = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_stream == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1360, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setStream", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1360, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.setStream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_20setStream(__pyx_self, __pyx_v_handle, __pyx_v_stream);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_20setStream(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_stream) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setStream", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_v_stream, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.setStream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1365
 * 
 * 
 * cpdef size_t getStream(size_t handle) except? 0:             # <<<<<<<<<<<<<<
 *     cdef driver.Stream stream
 *     status = cusparseGetStream(<Handle>handle, &stream)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_23getStream(PyObject *__pyx_self, PyObject *__pyx_arg_handle); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_getStream(size_t __pyx_v_handle, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cudaStream_t __pyx_v_stream;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getStream", 0);

  /* "cupy/cuda/cusparse.pyx":1367
 * cpdef size_t getStream(size_t handle) except? 0:
 *     cdef driver.Stream stream
 *     status = cusparseGetStream(<Handle>handle, &stream)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>stream
 */
  __pyx_v_status = cusparseGetStream(((cusparseHandle_t)__pyx_v_handle), (&__pyx_v_stream));

  /* "cupy/cuda/cusparse.pyx":1368
 *     cdef driver.Stream stream
 *     status = cusparseGetStream(<Handle>handle, &stream)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>stream
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1369
 *     status = cusparseGetStream(<Handle>handle, &stream)
 *     check_status(status)
 *     return <size_t>stream             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((size_t)__pyx_v_stream);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":1365
 * 
 * 
 * cpdef size_t getStream(size_t handle) except? 0:             # <<<<<<<<<<<<<<
 *     cdef driver.Stream stream
 *     status = cusparseGetStream(<Handle>handle, &stream)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.getStream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_23getStream(PyObject *__pyx_self, PyObject *__pyx_arg_handle); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_22getStream[] = "getStream(size_t handle) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_23getStream(PyObject *__pyx_self, PyObject *__pyx_arg_handle) {
  size_t __pyx_v_handle;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getStream (wrapper)", 0);
  assert(__pyx_arg_handle); {
    __pyx_v_handle = __Pyx_PyInt_As_size_t(__pyx_arg_handle); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1365, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.getStream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_22getStream(__pyx_self, ((size_t)__pyx_v_handle));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_22getStream(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getStream", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_getStream(__pyx_v_handle, 0); if (unlikely(__pyx_t_1 == ((size_t)0) && PyErr_Occurred())) __PYX_ERR(0, 1365, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy.cuda.cusparse.getStream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1375
 * # cuSPARSE Level1 Function
 * 
 * cpdef sgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd,             # <<<<<<<<<<<<<<
 *             int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_25sgthr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgthr(size_t __pyx_v_handle, int __pyx_v_nnz, size_t __pyx_v_y, size_t __pyx_v_xVal, size_t __pyx_v_xInd, int __pyx_v_idxBase, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgthr", 0);

  /* "cupy/cuda/cusparse.pyx":1377
 * cpdef sgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 *             int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseSgthr(
 *         <Handle>handle, nnz, <const float *>y, <float *>xVal,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1378
 *             int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseSgthr(             # <<<<<<<<<<<<<<
 *         <Handle>handle, nnz, <const float *>y, <float *>xVal,
 *         <const int *>xInd, <IndexBase>idxBase)
 */
  __pyx_v_status = cusparseSgthr(((cusparseHandle_t)__pyx_v_handle), __pyx_v_nnz, ((float const *)__pyx_v_y), ((float *)__pyx_v_xVal), ((int const *)__pyx_v_xInd), ((cusparseIndexBase_t)__pyx_v_idxBase));

  /* "cupy/cuda/cusparse.pyx":1381
 *         <Handle>handle, nnz, <const float *>y, <float *>xVal,
 *         <const int *>xInd, <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1375
 * # cuSPARSE Level1 Function
 * 
 * cpdef sgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd,             # <<<<<<<<<<<<<<
 *             int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_25sgthr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_24sgthr[] = "sgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd, int idxBase)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_25sgthr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_nnz;
  size_t __pyx_v_y;
  size_t __pyx_v_xVal;
  size_t __pyx_v_xInd;
  int __pyx_v_idxBase;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sgthr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_nnz,&__pyx_n_s_y,&__pyx_n_s_xVal,&__pyx_n_s_xInd,&__pyx_n_s_idxBase,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgthr", 1, 6, 6, 1); __PYX_ERR(0, 1375, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgthr", 1, 6, 6, 2); __PYX_ERR(0, 1375, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgthr", 1, 6, 6, 3); __PYX_ERR(0, 1375, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgthr", 1, 6, 6, 4); __PYX_ERR(0, 1375, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgthr", 1, 6, 6, 5); __PYX_ERR(0, 1375, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sgthr") < 0)) __PYX_ERR(0, 1375, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1375, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1375, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1375, __pyx_L3_error)
    __pyx_v_xVal = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_xVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1375, __pyx_L3_error)
    __pyx_v_xInd = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_xInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1375, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgthr", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1375, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_24sgthr(__pyx_self, __pyx_v_handle, __pyx_v_nnz, __pyx_v_y, __pyx_v_xVal, __pyx_v_xInd, __pyx_v_idxBase);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_24sgthr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_nnz, size_t __pyx_v_y, size_t __pyx_v_xVal, size_t __pyx_v_xInd, int __pyx_v_idxBase) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgthr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_sgthr(__pyx_v_handle, __pyx_v_nnz, __pyx_v_y, __pyx_v_xVal, __pyx_v_xInd, __pyx_v_idxBase, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1383
 *     check_status(status)
 * 
 * cpdef dgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd,             # <<<<<<<<<<<<<<
 *             int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_27dgthr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgthr(size_t __pyx_v_handle, int __pyx_v_nnz, size_t __pyx_v_y, size_t __pyx_v_xVal, size_t __pyx_v_xInd, int __pyx_v_idxBase, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgthr", 0);

  /* "cupy/cuda/cusparse.pyx":1385
 * cpdef dgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 *             int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDgthr(
 *         <Handle>handle, nnz, <const double *>y, <double *>xVal,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1386
 *             int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDgthr(             # <<<<<<<<<<<<<<
 *         <Handle>handle, nnz, <const double *>y, <double *>xVal,
 *         <const int *>xInd, <IndexBase>idxBase)
 */
  __pyx_v_status = cusparseDgthr(((cusparseHandle_t)__pyx_v_handle), __pyx_v_nnz, ((double const *)__pyx_v_y), ((double *)__pyx_v_xVal), ((int const *)__pyx_v_xInd), ((cusparseIndexBase_t)__pyx_v_idxBase));

  /* "cupy/cuda/cusparse.pyx":1389
 *         <Handle>handle, nnz, <const double *>y, <double *>xVal,
 *         <const int *>xInd, <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1383
 *     check_status(status)
 * 
 * cpdef dgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd,             # <<<<<<<<<<<<<<
 *             int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_27dgthr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_26dgthr[] = "dgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd, int idxBase)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_27dgthr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_nnz;
  size_t __pyx_v_y;
  size_t __pyx_v_xVal;
  size_t __pyx_v_xInd;
  int __pyx_v_idxBase;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dgthr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_nnz,&__pyx_n_s_y,&__pyx_n_s_xVal,&__pyx_n_s_xInd,&__pyx_n_s_idxBase,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgthr", 1, 6, 6, 1); __PYX_ERR(0, 1383, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgthr", 1, 6, 6, 2); __PYX_ERR(0, 1383, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgthr", 1, 6, 6, 3); __PYX_ERR(0, 1383, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgthr", 1, 6, 6, 4); __PYX_ERR(0, 1383, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgthr", 1, 6, 6, 5); __PYX_ERR(0, 1383, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dgthr") < 0)) __PYX_ERR(0, 1383, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1383, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1383, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1383, __pyx_L3_error)
    __pyx_v_xVal = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_xVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1383, __pyx_L3_error)
    __pyx_v_xInd = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_xInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1383, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1384, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgthr", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1383, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_26dgthr(__pyx_self, __pyx_v_handle, __pyx_v_nnz, __pyx_v_y, __pyx_v_xVal, __pyx_v_xInd, __pyx_v_idxBase);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_26dgthr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_nnz, size_t __pyx_v_y, size_t __pyx_v_xVal, size_t __pyx_v_xInd, int __pyx_v_idxBase) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgthr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dgthr(__pyx_v_handle, __pyx_v_nnz, __pyx_v_y, __pyx_v_xVal, __pyx_v_xInd, __pyx_v_idxBase, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1391
 *     check_status(status)
 * 
 * cpdef cgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd,             # <<<<<<<<<<<<<<
 *             int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_29cgthr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgthr(size_t __pyx_v_handle, int __pyx_v_nnz, size_t __pyx_v_y, size_t __pyx_v_xVal, size_t __pyx_v_xInd, int __pyx_v_idxBase, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgthr", 0);

  /* "cupy/cuda/cusparse.pyx":1393
 * cpdef cgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 *             int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCgthr(
 *         <Handle>handle, nnz, <const cuComplex *>y, <cuComplex *>xVal,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1394
 *             int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCgthr(             # <<<<<<<<<<<<<<
 *         <Handle>handle, nnz, <const cuComplex *>y, <cuComplex *>xVal,
 *         <const int *>xInd, <IndexBase>idxBase)
 */
  __pyx_v_status = cusparseCgthr(((cusparseHandle_t)__pyx_v_handle), __pyx_v_nnz, ((cuComplex const *)__pyx_v_y), ((cuComplex *)__pyx_v_xVal), ((int const *)__pyx_v_xInd), ((cusparseIndexBase_t)__pyx_v_idxBase));

  /* "cupy/cuda/cusparse.pyx":1397
 *         <Handle>handle, nnz, <const cuComplex *>y, <cuComplex *>xVal,
 *         <const int *>xInd, <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1391
 *     check_status(status)
 * 
 * cpdef cgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd,             # <<<<<<<<<<<<<<
 *             int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_29cgthr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_28cgthr[] = "cgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd, int idxBase)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_29cgthr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_nnz;
  size_t __pyx_v_y;
  size_t __pyx_v_xVal;
  size_t __pyx_v_xInd;
  int __pyx_v_idxBase;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cgthr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_nnz,&__pyx_n_s_y,&__pyx_n_s_xVal,&__pyx_n_s_xInd,&__pyx_n_s_idxBase,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgthr", 1, 6, 6, 1); __PYX_ERR(0, 1391, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgthr", 1, 6, 6, 2); __PYX_ERR(0, 1391, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgthr", 1, 6, 6, 3); __PYX_ERR(0, 1391, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgthr", 1, 6, 6, 4); __PYX_ERR(0, 1391, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgthr", 1, 6, 6, 5); __PYX_ERR(0, 1391, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cgthr") < 0)) __PYX_ERR(0, 1391, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1391, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1391, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1391, __pyx_L3_error)
    __pyx_v_xVal = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_xVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1391, __pyx_L3_error)
    __pyx_v_xInd = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_xInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1391, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1392, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgthr", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1391, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_28cgthr(__pyx_self, __pyx_v_handle, __pyx_v_nnz, __pyx_v_y, __pyx_v_xVal, __pyx_v_xInd, __pyx_v_idxBase);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_28cgthr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_nnz, size_t __pyx_v_y, size_t __pyx_v_xVal, size_t __pyx_v_xInd, int __pyx_v_idxBase) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgthr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cgthr(__pyx_v_handle, __pyx_v_nnz, __pyx_v_y, __pyx_v_xVal, __pyx_v_xInd, __pyx_v_idxBase, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1399
 *     check_status(status)
 * 
 * cpdef zgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd,             # <<<<<<<<<<<<<<
 *             int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_31zgthr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgthr(size_t __pyx_v_handle, int __pyx_v_nnz, size_t __pyx_v_y, size_t __pyx_v_xVal, size_t __pyx_v_xInd, int __pyx_v_idxBase, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgthr", 0);

  /* "cupy/cuda/cusparse.pyx":1401
 * cpdef zgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd,
 *             int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZgthr(
 *         <Handle>handle, nnz, <const cuDoubleComplex *>y,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1402
 *             int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZgthr(             # <<<<<<<<<<<<<<
 *         <Handle>handle, nnz, <const cuDoubleComplex *>y,
 *         <cuDoubleComplex *>xVal, <const int *>xInd, <IndexBase>idxBase)
 */
  __pyx_v_status = cusparseZgthr(((cusparseHandle_t)__pyx_v_handle), __pyx_v_nnz, ((cuDoubleComplex const *)__pyx_v_y), ((cuDoubleComplex *)__pyx_v_xVal), ((int const *)__pyx_v_xInd), ((cusparseIndexBase_t)__pyx_v_idxBase));

  /* "cupy/cuda/cusparse.pyx":1405
 *         <Handle>handle, nnz, <const cuDoubleComplex *>y,
 *         <cuDoubleComplex *>xVal, <const int *>xInd, <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ########################################
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1399
 *     check_status(status)
 * 
 * cpdef zgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd,             # <<<<<<<<<<<<<<
 *             int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_31zgthr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_30zgthr[] = "zgthr(size_t handle, int nnz, size_t y, size_t xVal, size_t xInd, int idxBase)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_31zgthr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_nnz;
  size_t __pyx_v_y;
  size_t __pyx_v_xVal;
  size_t __pyx_v_xInd;
  int __pyx_v_idxBase;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zgthr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_nnz,&__pyx_n_s_y,&__pyx_n_s_xVal,&__pyx_n_s_xInd,&__pyx_n_s_idxBase,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgthr", 1, 6, 6, 1); __PYX_ERR(0, 1399, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgthr", 1, 6, 6, 2); __PYX_ERR(0, 1399, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgthr", 1, 6, 6, 3); __PYX_ERR(0, 1399, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgthr", 1, 6, 6, 4); __PYX_ERR(0, 1399, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgthr", 1, 6, 6, 5); __PYX_ERR(0, 1399, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zgthr") < 0)) __PYX_ERR(0, 1399, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1399, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1399, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1399, __pyx_L3_error)
    __pyx_v_xVal = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_xVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1399, __pyx_L3_error)
    __pyx_v_xInd = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_xInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1399, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1400, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgthr", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1399, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_30zgthr(__pyx_self, __pyx_v_handle, __pyx_v_nnz, __pyx_v_y, __pyx_v_xVal, __pyx_v_xInd, __pyx_v_idxBase);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_30zgthr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_nnz, size_t __pyx_v_y, size_t __pyx_v_xVal, size_t __pyx_v_xInd, int __pyx_v_idxBase) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgthr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zgthr(__pyx_v_handle, __pyx_v_nnz, __pyx_v_y, __pyx_v_xVal, __pyx_v_xInd, __pyx_v_idxBase, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgthr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1410
 * # cuSPARSE Level2 Function
 * 
 * cpdef scsrmv(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int m, int n, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_33scsrmv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrmv(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_x, size_t __pyx_v_beta, size_t __pyx_v_y, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrmv", 0);

  /* "cupy/cuda/cusparse.pyx":1415
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA,
 *         size_t x, size_t beta, size_t y):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseScsrmv(
 *         <Handle>handle, <Operation>transA, m, n, nnz,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1416
 *         size_t x, size_t beta, size_t y):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseScsrmv(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, n, nnz,
 *         <const float *>alpha, <MatDescr>descrA, <const float *>csrSortedValA,
 */
  __pyx_v_status = cusparseScsrmv(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((float const *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), ((float const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((float const *)__pyx_v_x), ((float const *)__pyx_v_beta), ((float *)__pyx_v_y));

  /* "cupy/cuda/cusparse.pyx":1421
 *         <const int *>csrSortedRowPtrA, <const int *>csrSortedColIndA,
 *         <const float *>x, <const float *>beta, <float *>y)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dcsrmv(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1410
 * # cuSPARSE Level2 Function
 * 
 * cpdef scsrmv(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int m, int n, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_33scsrmv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_32scsrmv[] = "scsrmv(size_t handle, int transA, int m, int n, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t x, size_t beta, size_t y)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_33scsrmv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_x;
  size_t __pyx_v_beta;
  size_t __pyx_v_y;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrmv (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_x,&__pyx_n_s_beta,&__pyx_n_s_y,0};
    PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmv", 1, 13, 13, 1); __PYX_ERR(0, 1410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmv", 1, 13, 13, 2); __PYX_ERR(0, 1410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmv", 1, 13, 13, 3); __PYX_ERR(0, 1410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmv", 1, 13, 13, 4); __PYX_ERR(0, 1410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmv", 1, 13, 13, 5); __PYX_ERR(0, 1410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmv", 1, 13, 13, 6); __PYX_ERR(0, 1410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmv", 1, 13, 13, 7); __PYX_ERR(0, 1410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmv", 1, 13, 13, 8); __PYX_ERR(0, 1410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmv", 1, 13, 13, 9); __PYX_ERR(0, 1410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmv", 1, 13, 13, 10); __PYX_ERR(0, 1410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmv", 1, 13, 13, 11); __PYX_ERR(0, 1410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmv", 1, 13, 13, 12); __PYX_ERR(0, 1410, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsrmv") < 0)) __PYX_ERR(0, 1410, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 13) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1411, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1411, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1411, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1411, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1411, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1412, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1412, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1412, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1413, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1413, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1414, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1414, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1414, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrmv", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1410, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_32scsrmv(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_x, __pyx_v_beta, __pyx_v_y);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_32scsrmv(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_x, size_t __pyx_v_beta, size_t __pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrmv", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_scsrmv(__pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_x, __pyx_v_beta, __pyx_v_y, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1423
 *     check_status(status)
 * 
 * cpdef dcsrmv(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int m, int n, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_35dcsrmv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrmv(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_x, size_t __pyx_v_beta, size_t __pyx_v_y, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrmv", 0);

  /* "cupy/cuda/cusparse.pyx":1428
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA,
 *         size_t x, size_t beta, size_t y):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrmv(
 *         <Handle>handle, <Operation>transA, m, n, nnz,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1429
 *         size_t x, size_t beta, size_t y):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDcsrmv(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, n, nnz,
 *         <const double *>alpha, <MatDescr>descrA, <const double *>csrSortedValA,
 */
  __pyx_v_status = cusparseDcsrmv(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((double const *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), ((double const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((double const *)__pyx_v_x), ((double const *)__pyx_v_beta), ((double *)__pyx_v_y));

  /* "cupy/cuda/cusparse.pyx":1434
 *         <const int *>csrSortedRowPtrA, <const int *>csrSortedColIndA,
 *         <const double *>x, <const double *>beta, <double *>y)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef ccsrmv(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1423
 *     check_status(status)
 * 
 * cpdef dcsrmv(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int m, int n, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_35dcsrmv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_34dcsrmv[] = "dcsrmv(size_t handle, int transA, int m, int n, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t x, size_t beta, size_t y)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_35dcsrmv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_x;
  size_t __pyx_v_beta;
  size_t __pyx_v_y;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrmv (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_x,&__pyx_n_s_beta,&__pyx_n_s_y,0};
    PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmv", 1, 13, 13, 1); __PYX_ERR(0, 1423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmv", 1, 13, 13, 2); __PYX_ERR(0, 1423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmv", 1, 13, 13, 3); __PYX_ERR(0, 1423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmv", 1, 13, 13, 4); __PYX_ERR(0, 1423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmv", 1, 13, 13, 5); __PYX_ERR(0, 1423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmv", 1, 13, 13, 6); __PYX_ERR(0, 1423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmv", 1, 13, 13, 7); __PYX_ERR(0, 1423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmv", 1, 13, 13, 8); __PYX_ERR(0, 1423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmv", 1, 13, 13, 9); __PYX_ERR(0, 1423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmv", 1, 13, 13, 10); __PYX_ERR(0, 1423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmv", 1, 13, 13, 11); __PYX_ERR(0, 1423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmv", 1, 13, 13, 12); __PYX_ERR(0, 1423, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsrmv") < 0)) __PYX_ERR(0, 1423, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 13) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1424, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1424, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1424, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1424, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1424, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1425, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1425, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1425, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1426, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1426, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrmv", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1423, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_34dcsrmv(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_x, __pyx_v_beta, __pyx_v_y);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_34dcsrmv(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_x, size_t __pyx_v_beta, size_t __pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrmv", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dcsrmv(__pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_x, __pyx_v_beta, __pyx_v_y, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1436
 *     check_status(status)
 * 
 * cpdef ccsrmv(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int m, int n, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_37ccsrmv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrmv(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_x, size_t __pyx_v_beta, size_t __pyx_v_y, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrmv", 0);

  /* "cupy/cuda/cusparse.pyx":1441
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA,
 *         size_t x, size_t beta, size_t y):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrmv(
 *         <Handle>handle, <Operation>transA, m, n, nnz,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1442
 *         size_t x, size_t beta, size_t y):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCcsrmv(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, n, nnz,
 *         <const cuComplex *>alpha, <MatDescr>descrA,
 */
  __pyx_v_status = cusparseCcsrmv(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((cuComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), ((cuComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((cuComplex const *)__pyx_v_x), ((cuComplex const *)__pyx_v_beta), ((cuComplex *)__pyx_v_y));

  /* "cupy/cuda/cusparse.pyx":1448
 *         <const int *>csrSortedRowPtrA, <const int *>csrSortedColIndA,
 *         <const cuComplex *>x, <const cuComplex *>beta, <cuComplex *>y)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zcsrmv(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1436
 *     check_status(status)
 * 
 * cpdef ccsrmv(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int m, int n, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_37ccsrmv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_36ccsrmv[] = "ccsrmv(size_t handle, int transA, int m, int n, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t x, size_t beta, size_t y)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_37ccsrmv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_x;
  size_t __pyx_v_beta;
  size_t __pyx_v_y;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrmv (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_x,&__pyx_n_s_beta,&__pyx_n_s_y,0};
    PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmv", 1, 13, 13, 1); __PYX_ERR(0, 1436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmv", 1, 13, 13, 2); __PYX_ERR(0, 1436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmv", 1, 13, 13, 3); __PYX_ERR(0, 1436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmv", 1, 13, 13, 4); __PYX_ERR(0, 1436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmv", 1, 13, 13, 5); __PYX_ERR(0, 1436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmv", 1, 13, 13, 6); __PYX_ERR(0, 1436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmv", 1, 13, 13, 7); __PYX_ERR(0, 1436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmv", 1, 13, 13, 8); __PYX_ERR(0, 1436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmv", 1, 13, 13, 9); __PYX_ERR(0, 1436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmv", 1, 13, 13, 10); __PYX_ERR(0, 1436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmv", 1, 13, 13, 11); __PYX_ERR(0, 1436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmv", 1, 13, 13, 12); __PYX_ERR(0, 1436, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsrmv") < 0)) __PYX_ERR(0, 1436, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 13) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1437, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1437, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1437, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1437, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1437, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1438, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1438, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1438, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1439, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1439, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1440, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1440, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1440, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrmv", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1436, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_36ccsrmv(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_x, __pyx_v_beta, __pyx_v_y);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_36ccsrmv(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_x, size_t __pyx_v_beta, size_t __pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrmv", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ccsrmv(__pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_x, __pyx_v_beta, __pyx_v_y, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1450
 *     check_status(status)
 * 
 * cpdef zcsrmv(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int m, int n, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_39zcsrmv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrmv(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_x, size_t __pyx_v_beta, size_t __pyx_v_y, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrmv", 0);

  /* "cupy/cuda/cusparse.pyx":1455
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA,
 *         size_t x, size_t beta, size_t y):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrmv(
 *         <Handle>handle, <Operation>transA, m, n, nnz,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1456
 *         size_t x, size_t beta, size_t y):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZcsrmv(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, n, nnz,
 *         <const cuDoubleComplex *>alpha, <MatDescr>descrA,
 */
  __pyx_v_status = cusparseZcsrmv(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((cuDoubleComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), ((cuDoubleComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((cuDoubleComplex const *)__pyx_v_x), ((cuDoubleComplex const *)__pyx_v_beta), ((cuDoubleComplex *)__pyx_v_y));

  /* "cupy/cuda/cusparse.pyx":1463
 *         <const cuDoubleComplex *>x, <const cuDoubleComplex *>beta,
 *         <cuDoubleComplex *>y)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t csrmvEx_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1450
 *     check_status(status)
 * 
 * cpdef zcsrmv(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int m, int n, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_39zcsrmv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_38zcsrmv[] = "zcsrmv(size_t handle, int transA, int m, int n, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t x, size_t beta, size_t y)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_39zcsrmv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_x;
  size_t __pyx_v_beta;
  size_t __pyx_v_y;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrmv (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_x,&__pyx_n_s_beta,&__pyx_n_s_y,0};
    PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmv", 1, 13, 13, 1); __PYX_ERR(0, 1450, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmv", 1, 13, 13, 2); __PYX_ERR(0, 1450, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmv", 1, 13, 13, 3); __PYX_ERR(0, 1450, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmv", 1, 13, 13, 4); __PYX_ERR(0, 1450, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmv", 1, 13, 13, 5); __PYX_ERR(0, 1450, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmv", 1, 13, 13, 6); __PYX_ERR(0, 1450, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmv", 1, 13, 13, 7); __PYX_ERR(0, 1450, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmv", 1, 13, 13, 8); __PYX_ERR(0, 1450, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmv", 1, 13, 13, 9); __PYX_ERR(0, 1450, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmv", 1, 13, 13, 10); __PYX_ERR(0, 1450, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmv", 1, 13, 13, 11); __PYX_ERR(0, 1450, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmv", 1, 13, 13, 12); __PYX_ERR(0, 1450, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsrmv") < 0)) __PYX_ERR(0, 1450, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 13) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1451, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1451, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1451, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1451, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1451, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1452, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1452, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1452, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1453, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1453, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1454, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1454, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1454, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrmv", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1450, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_38zcsrmv(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_x, __pyx_v_beta, __pyx_v_y);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_38zcsrmv(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_x, size_t __pyx_v_beta, size_t __pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrmv", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zcsrmv(__pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_x, __pyx_v_beta, __pyx_v_y, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrmv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1465
 *     check_status(status)
 * 
 * cpdef size_t csrmvEx_bufferSize(             # <<<<<<<<<<<<<<
 *         size_t handle, int alg, int transA, int m, int n,
 *         int nnz, size_t alpha, int alphatype, size_t descrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_41csrmvEx_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_csrmvEx_bufferSize(size_t __pyx_v_handle, int __pyx_v_alg, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, int __pyx_v_alphatype, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, int __pyx_v_csrValAtype, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_x, int __pyx_v_xtype, size_t __pyx_v_beta, int __pyx_v_betatype, size_t __pyx_v_y, int __pyx_v_ytype, int __pyx_v_executiontype, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("csrmvEx_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":1472
 *         int betatype, size_t y, int ytype, int executiontype):
 *     cdef size_t bufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCsrmvEx_bufferSize(
 *         <Handle>handle, <AlgMode>alg, <Operation>transA, m,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1473
 *     cdef size_t bufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCsrmvEx_bufferSize(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <AlgMode>alg, <Operation>transA, m,
 *         n, nnz, <const void *>alpha, <DataType>alphatype,
 */
  __pyx_v_status = cusparseCsrmvEx_bufferSize(((cusparseHandle_t)__pyx_v_handle), ((cusparseAlgMode_t)__pyx_v_alg), ((cusparseOperation_t)__pyx_v_transA), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((void const *)__pyx_v_alpha), ((cudaDataType)__pyx_v_alphatype), ((cusparseMatDescr_t)__pyx_v_descrA), ((void const *)__pyx_v_csrValA), ((cudaDataType)__pyx_v_csrValAtype), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((void const *)__pyx_v_x), ((cudaDataType)__pyx_v_xtype), ((void const *)__pyx_v_beta), ((cudaDataType)__pyx_v_betatype), ((void *)__pyx_v_y), ((cudaDataType)__pyx_v_ytype), ((cudaDataType)__pyx_v_executiontype), (&__pyx_v_bufferSizeInBytes));

  /* "cupy/cuda/cusparse.pyx":1481
 *         <DataType>betatype, <void *>y, <DataType>ytype,
 *         <DataType>executiontype, &bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1482
 *         <DataType>executiontype, &bufferSizeInBytes)
 *     check_status(status)
 *     return bufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef csrmvEx(
 */
  __pyx_r = __pyx_v_bufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":1465
 *     check_status(status)
 * 
 * cpdef size_t csrmvEx_bufferSize(             # <<<<<<<<<<<<<<
 *         size_t handle, int alg, int transA, int m, int n,
 *         int nnz, size_t alpha, int alphatype, size_t descrA,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.csrmvEx_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_41csrmvEx_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_40csrmvEx_bufferSize[] = "csrmvEx_bufferSize(size_t handle, int alg, int transA, int m, int n, int nnz, size_t alpha, int alphatype, size_t descrA, size_t csrValA, int csrValAtype, size_t csrRowPtrA, size_t csrColIndA, size_t x, int xtype, size_t beta, int betatype, size_t y, int ytype, int executiontype) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_41csrmvEx_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_alg;
  int __pyx_v_transA;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  size_t __pyx_v_alpha;
  int __pyx_v_alphatype;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrValA;
  int __pyx_v_csrValAtype;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_x;
  int __pyx_v_xtype;
  size_t __pyx_v_beta;
  int __pyx_v_betatype;
  size_t __pyx_v_y;
  int __pyx_v_ytype;
  int __pyx_v_executiontype;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("csrmvEx_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_alg,&__pyx_n_s_transA,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_alpha,&__pyx_n_s_alphatype,&__pyx_n_s_descrA,&__pyx_n_s_csrValA,&__pyx_n_s_csrValAtype,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_x,&__pyx_n_s_xtype,&__pyx_n_s_beta,&__pyx_n_s_betatype,&__pyx_n_s_y,&__pyx_n_s_ytype,&__pyx_n_s_executiontype,0};
    PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        CYTHON_FALLTHROUGH;
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 1); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 2); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 3); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 4); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 5); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 6); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alphatype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 7); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 8); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 9); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValAtype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 10); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 11); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 12); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 13); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xtype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 14); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 15); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_betatype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 16); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 17); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ytype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 18); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 19:
        if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_executiontype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, 19); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "csrmvEx_bufferSize") < 0)) __PYX_ERR(0, 1465, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
      values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1466, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_alg == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1466, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1466, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1466, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1466, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1467, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1467, __pyx_L3_error)
    __pyx_v_alphatype = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_alphatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1467, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1467, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1468, __pyx_L3_error)
    __pyx_v_csrValAtype = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_csrValAtype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1468, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1468, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1469, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1469, __pyx_L3_error)
    __pyx_v_xtype = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_xtype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1469, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1469, __pyx_L3_error)
    __pyx_v_betatype = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_betatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1470, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1470, __pyx_L3_error)
    __pyx_v_ytype = __Pyx_PyInt_As_int(values[18]); if (unlikely((__pyx_v_ytype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1470, __pyx_L3_error)
    __pyx_v_executiontype = __Pyx_PyInt_As_int(values[19]); if (unlikely((__pyx_v_executiontype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1470, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("csrmvEx_bufferSize", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1465, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.csrmvEx_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_40csrmvEx_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_alg, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_alphatype, __pyx_v_descrA, __pyx_v_csrValA, __pyx_v_csrValAtype, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_x, __pyx_v_xtype, __pyx_v_beta, __pyx_v_betatype, __pyx_v_y, __pyx_v_ytype, __pyx_v_executiontype);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_40csrmvEx_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_alg, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, int __pyx_v_alphatype, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, int __pyx_v_csrValAtype, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_x, int __pyx_v_xtype, size_t __pyx_v_beta, int __pyx_v_betatype, size_t __pyx_v_y, int __pyx_v_ytype, int __pyx_v_executiontype) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("csrmvEx_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_csrmvEx_bufferSize(__pyx_v_handle, __pyx_v_alg, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_alphatype, __pyx_v_descrA, __pyx_v_csrValA, __pyx_v_csrValAtype, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_x, __pyx_v_xtype, __pyx_v_beta, __pyx_v_betatype, __pyx_v_y, __pyx_v_ytype, __pyx_v_executiontype, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.csrmvEx_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1484
 *     return bufferSizeInBytes
 * 
 * cpdef csrmvEx(             # <<<<<<<<<<<<<<
 *         size_t handle, int alg, int transA, int m, int n,
 *         int nnz, size_t alpha, int alphatype, size_t descrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_43csrmvEx(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_csrmvEx(size_t __pyx_v_handle, int __pyx_v_alg, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, int __pyx_v_alphatype, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, int __pyx_v_csrValAtype, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_x, int __pyx_v_xtype, size_t __pyx_v_beta, int __pyx_v_betatype, size_t __pyx_v_y, int __pyx_v_ytype, int __pyx_v_executiontype, size_t __pyx_v_buffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("csrmvEx", 0);

  /* "cupy/cuda/cusparse.pyx":1491
 *         int betatype, size_t y, int ytype, int executiontype,
 *         size_t buffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCsrmvEx(
 *         <Handle>handle, <AlgMode>alg, <Operation>transA, m,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1492
 *         size_t buffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCsrmvEx(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <AlgMode>alg, <Operation>transA, m,
 *         n, nnz, <const void *>alpha, <DataType>alphatype,
 */
  __pyx_v_status = cusparseCsrmvEx(((cusparseHandle_t)__pyx_v_handle), ((cusparseAlgMode_t)__pyx_v_alg), ((cusparseOperation_t)__pyx_v_transA), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((void const *)__pyx_v_alpha), ((cudaDataType)__pyx_v_alphatype), ((cusparseMatDescr_t)__pyx_v_descrA), ((void const *)__pyx_v_csrValA), ((cudaDataType)__pyx_v_csrValAtype), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((void const *)__pyx_v_x), ((cudaDataType)__pyx_v_xtype), ((void const *)__pyx_v_beta), ((cudaDataType)__pyx_v_betatype), ((void *)__pyx_v_y), ((cudaDataType)__pyx_v_ytype), ((cudaDataType)__pyx_v_executiontype), ((void *)__pyx_v_buffer));

  /* "cupy/cuda/cusparse.pyx":1500
 *         <DataType>betatype, <void *>y, <DataType>ytype,
 *         <DataType>executiontype, <void *>buffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ########################################
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1484
 *     return bufferSizeInBytes
 * 
 * cpdef csrmvEx(             # <<<<<<<<<<<<<<
 *         size_t handle, int alg, int transA, int m, int n,
 *         int nnz, size_t alpha, int alphatype, size_t descrA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.csrmvEx", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_43csrmvEx(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_42csrmvEx[] = "csrmvEx(size_t handle, int alg, int transA, int m, int n, int nnz, size_t alpha, int alphatype, size_t descrA, size_t csrValA, int csrValAtype, size_t csrRowPtrA, size_t csrColIndA, size_t x, int xtype, size_t beta, int betatype, size_t y, int ytype, int executiontype, size_t buffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_43csrmvEx(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_alg;
  int __pyx_v_transA;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  size_t __pyx_v_alpha;
  int __pyx_v_alphatype;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrValA;
  int __pyx_v_csrValAtype;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_x;
  int __pyx_v_xtype;
  size_t __pyx_v_beta;
  int __pyx_v_betatype;
  size_t __pyx_v_y;
  int __pyx_v_ytype;
  int __pyx_v_executiontype;
  size_t __pyx_v_buffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("csrmvEx (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_alg,&__pyx_n_s_transA,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_alpha,&__pyx_n_s_alphatype,&__pyx_n_s_descrA,&__pyx_n_s_csrValA,&__pyx_n_s_csrValAtype,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_x,&__pyx_n_s_xtype,&__pyx_n_s_beta,&__pyx_n_s_betatype,&__pyx_n_s_y,&__pyx_n_s_ytype,&__pyx_n_s_executiontype,&__pyx_n_s_buffer,0};
    PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
        CYTHON_FALLTHROUGH;
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        CYTHON_FALLTHROUGH;
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 1); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 2); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 3); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 4); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 5); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 6); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alphatype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 7); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 8); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 9); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValAtype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 10); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 11); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 12); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 13); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xtype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 14); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 15); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_betatype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 16); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 17); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ytype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 18); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 19:
        if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_executiontype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 19); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 20:
        if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, 20); __PYX_ERR(0, 1484, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "csrmvEx") < 0)) __PYX_ERR(0, 1484, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 21) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
      values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
      values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1485, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_alg == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1485, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1485, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1485, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1485, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1486, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1486, __pyx_L3_error)
    __pyx_v_alphatype = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_alphatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1486, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1486, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1487, __pyx_L3_error)
    __pyx_v_csrValAtype = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_csrValAtype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1487, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1487, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1488, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1488, __pyx_L3_error)
    __pyx_v_xtype = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_xtype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1488, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1488, __pyx_L3_error)
    __pyx_v_betatype = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_betatype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1489, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_y == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1489, __pyx_L3_error)
    __pyx_v_ytype = __Pyx_PyInt_As_int(values[18]); if (unlikely((__pyx_v_ytype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1489, __pyx_L3_error)
    __pyx_v_executiontype = __Pyx_PyInt_As_int(values[19]); if (unlikely((__pyx_v_executiontype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1489, __pyx_L3_error)
    __pyx_v_buffer = __Pyx_PyInt_As_size_t(values[20]); if (unlikely((__pyx_v_buffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1490, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("csrmvEx", 1, 21, 21, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1484, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.csrmvEx", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_42csrmvEx(__pyx_self, __pyx_v_handle, __pyx_v_alg, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_alphatype, __pyx_v_descrA, __pyx_v_csrValA, __pyx_v_csrValAtype, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_x, __pyx_v_xtype, __pyx_v_beta, __pyx_v_betatype, __pyx_v_y, __pyx_v_ytype, __pyx_v_executiontype, __pyx_v_buffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_42csrmvEx(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_alg, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_alpha, int __pyx_v_alphatype, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, int __pyx_v_csrValAtype, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_x, int __pyx_v_xtype, size_t __pyx_v_beta, int __pyx_v_betatype, size_t __pyx_v_y, int __pyx_v_ytype, int __pyx_v_executiontype, size_t __pyx_v_buffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("csrmvEx", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_csrmvEx(__pyx_v_handle, __pyx_v_alg, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_alphatype, __pyx_v_descrA, __pyx_v_csrValA, __pyx_v_csrValAtype, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_x, __pyx_v_xtype, __pyx_v_beta, __pyx_v_betatype, __pyx_v_y, __pyx_v_ytype, __pyx_v_executiontype, __pyx_v_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.csrmvEx", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1505
 * # cuSPARSE Level3 Function
 * 
 * cpdef scsrmm(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_45scsrmm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrmm(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrmm", 0);

  /* "cupy/cuda/cusparse.pyx":1510
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA,
 *         size_t B, int ldb, size_t beta, size_t C, int ldc):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseScsrmm(
 *         <Handle>handle, <Operation>transA, m, n, k, nnz,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1511
 *         size_t B, int ldb, size_t beta, size_t C, int ldc):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseScsrmm(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, n, k, nnz,
 *         <const float *>alpha, <MatDescr>descrA, <const float *>csrSortedValA,
 */
  __pyx_v_status = cusparseScsrmm(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, ((float const *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), ((float const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((float const *)__pyx_v_B), __pyx_v_ldb, ((float const *)__pyx_v_beta), ((float *)__pyx_v_C), __pyx_v_ldc);

  /* "cupy/cuda/cusparse.pyx":1516
 *         <const int *>csrSortedRowPtrA, <const int *>csrSortedColIndA,
 *         <const float *>B, ldb, <const float *>beta, <float *>C, ldc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dcsrmm(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1505
 * # cuSPARSE Level3 Function
 * 
 * cpdef scsrmm(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_45scsrmm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_44scsrmm[] = "scsrmm(size_t handle, int transA, int m, int n, int k, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb, size_t beta, size_t C, int ldc)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_45scsrmm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  int __pyx_v_nnz;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_beta;
  size_t __pyx_v_C;
  int __pyx_v_ldc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrmm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_nnz,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_beta,&__pyx_n_s_C,&__pyx_n_s_ldc,0};
    PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, 1); __PYX_ERR(0, 1505, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, 2); __PYX_ERR(0, 1505, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, 3); __PYX_ERR(0, 1505, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, 4); __PYX_ERR(0, 1505, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, 5); __PYX_ERR(0, 1505, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, 6); __PYX_ERR(0, 1505, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, 7); __PYX_ERR(0, 1505, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, 8); __PYX_ERR(0, 1505, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, 9); __PYX_ERR(0, 1505, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, 10); __PYX_ERR(0, 1505, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, 11); __PYX_ERR(0, 1505, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, 12); __PYX_ERR(0, 1505, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, 13); __PYX_ERR(0, 1505, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, 14); __PYX_ERR(0, 1505, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, 15); __PYX_ERR(0, 1505, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsrmm") < 0)) __PYX_ERR(0, 1505, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 16) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1506, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1506, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1506, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1506, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1506, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1506, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1507, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1507, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1507, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1508, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1508, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1509, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1509, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1509, __pyx_L3_error)
    __pyx_v_C = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_C == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1509, __pyx_L3_error)
    __pyx_v_ldc = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_ldc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1509, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrmm", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1505, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_44scsrmm(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_B, __pyx_v_ldb, __pyx_v_beta, __pyx_v_C, __pyx_v_ldc);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_44scsrmm(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrmm", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_scsrmm(__pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_B, __pyx_v_ldb, __pyx_v_beta, __pyx_v_C, __pyx_v_ldc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1518
 *     check_status(status)
 * 
 * cpdef dcsrmm(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_47dcsrmm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrmm(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrmm", 0);

  /* "cupy/cuda/cusparse.pyx":1523
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA,
 *         size_t B, int ldb, size_t beta, size_t C, int ldc):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrmm(
 *         <Handle>handle, <Operation>transA, m, n, k, nnz,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1524
 *         size_t B, int ldb, size_t beta, size_t C, int ldc):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDcsrmm(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, n, k, nnz,
 *         <const double *>alpha, <MatDescr>descrA, <const double *>csrSortedValA,
 */
  __pyx_v_status = cusparseDcsrmm(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, ((double const *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), ((double const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((double const *)__pyx_v_B), __pyx_v_ldb, ((double const *)__pyx_v_beta), ((double *)__pyx_v_C), __pyx_v_ldc);

  /* "cupy/cuda/cusparse.pyx":1529
 *         <const int *>csrSortedRowPtrA, <const int *>csrSortedColIndA,
 *         <const double *>B, ldb, <const double *>beta, <double *>C, ldc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef ccsrmm(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1518
 *     check_status(status)
 * 
 * cpdef dcsrmm(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_47dcsrmm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_46dcsrmm[] = "dcsrmm(size_t handle, int transA, int m, int n, int k, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb, size_t beta, size_t C, int ldc)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_47dcsrmm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  int __pyx_v_nnz;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_beta;
  size_t __pyx_v_C;
  int __pyx_v_ldc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrmm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_nnz,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_beta,&__pyx_n_s_C,&__pyx_n_s_ldc,0};
    PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, 1); __PYX_ERR(0, 1518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, 2); __PYX_ERR(0, 1518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, 3); __PYX_ERR(0, 1518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, 4); __PYX_ERR(0, 1518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, 5); __PYX_ERR(0, 1518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, 6); __PYX_ERR(0, 1518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, 7); __PYX_ERR(0, 1518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, 8); __PYX_ERR(0, 1518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, 9); __PYX_ERR(0, 1518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, 10); __PYX_ERR(0, 1518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, 11); __PYX_ERR(0, 1518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, 12); __PYX_ERR(0, 1518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, 13); __PYX_ERR(0, 1518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, 14); __PYX_ERR(0, 1518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, 15); __PYX_ERR(0, 1518, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsrmm") < 0)) __PYX_ERR(0, 1518, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 16) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1519, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1519, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1519, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1519, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1519, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1519, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1520, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1520, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1520, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1521, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1521, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1522, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1522, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1522, __pyx_L3_error)
    __pyx_v_C = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_C == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1522, __pyx_L3_error)
    __pyx_v_ldc = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_ldc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1522, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrmm", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1518, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_46dcsrmm(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_B, __pyx_v_ldb, __pyx_v_beta, __pyx_v_C, __pyx_v_ldc);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_46dcsrmm(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrmm", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dcsrmm(__pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_B, __pyx_v_ldb, __pyx_v_beta, __pyx_v_C, __pyx_v_ldc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1531
 *     check_status(status)
 * 
 * cpdef ccsrmm(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_49ccsrmm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrmm(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrmm", 0);

  /* "cupy/cuda/cusparse.pyx":1536
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA,
 *         size_t B, int ldb, size_t beta, size_t C, int ldc):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrmm(
 *         <Handle>handle, <Operation>transA, m, n, k, nnz,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1537
 *         size_t B, int ldb, size_t beta, size_t C, int ldc):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCcsrmm(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, n, k, nnz,
 *         <const cuComplex *>alpha, <MatDescr>descrA,
 */
  __pyx_v_status = cusparseCcsrmm(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, ((cuComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), ((cuComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((cuComplex const *)__pyx_v_B), __pyx_v_ldb, ((cuComplex const *)__pyx_v_beta), ((cuComplex *)__pyx_v_C), __pyx_v_ldc);

  /* "cupy/cuda/cusparse.pyx":1544
 *         <const cuComplex *>B, ldb, <const cuComplex *>beta,
 *         <cuComplex *>C, ldc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zcsrmm(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1531
 *     check_status(status)
 * 
 * cpdef ccsrmm(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_49ccsrmm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_48ccsrmm[] = "ccsrmm(size_t handle, int transA, int m, int n, int k, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb, size_t beta, size_t C, int ldc)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_49ccsrmm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  int __pyx_v_nnz;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_beta;
  size_t __pyx_v_C;
  int __pyx_v_ldc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrmm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_nnz,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_beta,&__pyx_n_s_C,&__pyx_n_s_ldc,0};
    PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, 1); __PYX_ERR(0, 1531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, 2); __PYX_ERR(0, 1531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, 3); __PYX_ERR(0, 1531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, 4); __PYX_ERR(0, 1531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, 5); __PYX_ERR(0, 1531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, 6); __PYX_ERR(0, 1531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, 7); __PYX_ERR(0, 1531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, 8); __PYX_ERR(0, 1531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, 9); __PYX_ERR(0, 1531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, 10); __PYX_ERR(0, 1531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, 11); __PYX_ERR(0, 1531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, 12); __PYX_ERR(0, 1531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, 13); __PYX_ERR(0, 1531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, 14); __PYX_ERR(0, 1531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, 15); __PYX_ERR(0, 1531, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsrmm") < 0)) __PYX_ERR(0, 1531, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 16) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1532, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1532, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1532, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1532, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1532, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1532, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1533, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1533, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1533, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1534, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1534, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1535, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1535, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1535, __pyx_L3_error)
    __pyx_v_C = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_C == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1535, __pyx_L3_error)
    __pyx_v_ldc = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_ldc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1535, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrmm", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1531, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_48ccsrmm(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_B, __pyx_v_ldb, __pyx_v_beta, __pyx_v_C, __pyx_v_ldc);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_48ccsrmm(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrmm", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ccsrmm(__pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_B, __pyx_v_ldb, __pyx_v_beta, __pyx_v_C, __pyx_v_ldc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1546
 *     check_status(status)
 * 
 * cpdef zcsrmm(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_51zcsrmm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrmm(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrmm", 0);

  /* "cupy/cuda/cusparse.pyx":1551
 *         size_t csrSortedRowPtrA, size_t csrSortedColIndA,
 *         size_t B, int ldb, size_t beta, size_t C, int ldc):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrmm(
 *         <Handle>handle, <Operation>transA, m, n, k, nnz,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1552
 *         size_t B, int ldb, size_t beta, size_t C, int ldc):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZcsrmm(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, m, n, k, nnz,
 *         <const cuDoubleComplex *>alpha, <MatDescr>descrA,
 */
  __pyx_v_status = cusparseZcsrmm(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, ((cuDoubleComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), ((cuDoubleComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((cuDoubleComplex const *)__pyx_v_B), __pyx_v_ldb, ((cuDoubleComplex const *)__pyx_v_beta), ((cuDoubleComplex *)__pyx_v_C), __pyx_v_ldc);

  /* "cupy/cuda/cusparse.pyx":1559
 *         <const cuDoubleComplex *>B, ldb,
 *         <const cuDoubleComplex *>beta, <cuDoubleComplex *>C, ldc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef scsrmm2(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1546
 *     check_status(status)
 * 
 * cpdef zcsrmm(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrSortedValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_51zcsrmm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_50zcsrmm[] = "zcsrmm(size_t handle, int transA, int m, int n, int k, int nnz, size_t alpha, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t B, int ldb, size_t beta, size_t C, int ldc)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_51zcsrmm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  int __pyx_v_nnz;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_beta;
  size_t __pyx_v_C;
  int __pyx_v_ldc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrmm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_nnz,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_beta,&__pyx_n_s_C,&__pyx_n_s_ldc,0};
    PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, 1); __PYX_ERR(0, 1546, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, 2); __PYX_ERR(0, 1546, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, 3); __PYX_ERR(0, 1546, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, 4); __PYX_ERR(0, 1546, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, 5); __PYX_ERR(0, 1546, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, 6); __PYX_ERR(0, 1546, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, 7); __PYX_ERR(0, 1546, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, 8); __PYX_ERR(0, 1546, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, 9); __PYX_ERR(0, 1546, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, 10); __PYX_ERR(0, 1546, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, 11); __PYX_ERR(0, 1546, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, 12); __PYX_ERR(0, 1546, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, 13); __PYX_ERR(0, 1546, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, 14); __PYX_ERR(0, 1546, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, 15); __PYX_ERR(0, 1546, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsrmm") < 0)) __PYX_ERR(0, 1546, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 16) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1547, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1547, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1547, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1547, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1547, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1547, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1548, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1548, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1548, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1549, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1549, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1550, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1550, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1550, __pyx_L3_error)
    __pyx_v_C = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_C == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1550, __pyx_L3_error)
    __pyx_v_ldc = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_ldc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1550, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrmm", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1546, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_50zcsrmm(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_B, __pyx_v_ldb, __pyx_v_beta, __pyx_v_C, __pyx_v_ldc);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_50zcsrmm(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrmm", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zcsrmm(__pyx_v_handle, __pyx_v_transA, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_B, __pyx_v_ldb, __pyx_v_beta, __pyx_v_C, __pyx_v_ldc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrmm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1561
 *     check_status(status)
 * 
 * cpdef scsrmm2(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_53scsrmm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrmm2(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrmm2", 0);

  /* "cupy/cuda/cusparse.pyx":1566
 *         size_t csrRowPtrA, size_t csrColIndA,
 *         size_t B, int ldb, size_t beta, size_t C, int ldc):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseScsrmm2(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k, nnz,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1567
 *         size_t B, int ldb, size_t beta, size_t C, int ldc):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseScsrmm2(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k, nnz,
 *         <const float *>alpha, <MatDescr>descrA, <const float *>csrValA,
 */
  __pyx_v_status = cusparseScsrmm2(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, ((float const *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), ((float const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((float const *)__pyx_v_B), __pyx_v_ldb, ((float const *)__pyx_v_beta), ((float *)__pyx_v_C), __pyx_v_ldc);

  /* "cupy/cuda/cusparse.pyx":1572
 *         <const int *>csrRowPtrA, <const int *>csrColIndA,
 *         <const float *>B, ldb, <const float *>beta, <float *>C, ldc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dcsrmm2(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1561
 *     check_status(status)
 * 
 * cpdef scsrmm2(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_53scsrmm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_52scsrmm2[] = "scsrmm2(size_t handle, int transA, int transB, int m, int n, int k, int nnz, size_t alpha, size_t descrA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t B, int ldb, size_t beta, size_t C, int ldc)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_53scsrmm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  int __pyx_v_nnz;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_beta;
  size_t __pyx_v_C;
  int __pyx_v_ldc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrmm2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_transB,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_nnz,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_beta,&__pyx_n_s_C,&__pyx_n_s_ldc,0};
    PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, 1); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, 2); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, 3); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, 4); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, 5); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, 6); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, 7); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, 8); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, 9); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, 10); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, 11); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, 12); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, 13); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, 14); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, 15); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, 16); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsrmm2") < 0)) __PYX_ERR(0, 1561, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 17) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1562, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1562, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1562, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1562, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1562, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1562, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1562, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1563, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1563, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1563, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1564, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1564, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1565, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1565, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1565, __pyx_L3_error)
    __pyx_v_C = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_C == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1565, __pyx_L3_error)
    __pyx_v_ldc = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_ldc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1565, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrmm2", 1, 17, 17, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1561, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_52scsrmm2(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_B, __pyx_v_ldb, __pyx_v_beta, __pyx_v_C, __pyx_v_ldc);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_52scsrmm2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrmm2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_scsrmm2(__pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_B, __pyx_v_ldb, __pyx_v_beta, __pyx_v_C, __pyx_v_ldc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1574
 *     check_status(status)
 * 
 * cpdef dcsrmm2(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_55dcsrmm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrmm2(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrmm2", 0);

  /* "cupy/cuda/cusparse.pyx":1579
 *         size_t csrRowPtrA, size_t csrColIndA,
 *         size_t B, int ldb, size_t beta, size_t C, int ldc):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrmm2(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k, nnz,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1580
 *         size_t B, int ldb, size_t beta, size_t C, int ldc):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDcsrmm2(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k, nnz,
 *         <const double *>alpha, <MatDescr>descrA, <const double *>csrValA,
 */
  __pyx_v_status = cusparseDcsrmm2(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, ((double const *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), ((double const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((double const *)__pyx_v_B), __pyx_v_ldb, ((double const *)__pyx_v_beta), ((double *)__pyx_v_C), __pyx_v_ldc);

  /* "cupy/cuda/cusparse.pyx":1585
 *         <const int *>csrRowPtrA, <const int *>csrColIndA,
 *         <const double *>B, ldb, <const double *>beta, <double *>C, ldc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef ccsrmm2(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1574
 *     check_status(status)
 * 
 * cpdef dcsrmm2(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_55dcsrmm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_54dcsrmm2[] = "dcsrmm2(size_t handle, int transA, int transB, int m, int n, int k, int nnz, size_t alpha, size_t descrA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t B, int ldb, size_t beta, size_t C, int ldc)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_55dcsrmm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  int __pyx_v_nnz;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_beta;
  size_t __pyx_v_C;
  int __pyx_v_ldc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrmm2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_transB,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_nnz,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_beta,&__pyx_n_s_C,&__pyx_n_s_ldc,0};
    PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, 1); __PYX_ERR(0, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, 2); __PYX_ERR(0, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, 3); __PYX_ERR(0, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, 4); __PYX_ERR(0, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, 5); __PYX_ERR(0, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, 6); __PYX_ERR(0, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, 7); __PYX_ERR(0, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, 8); __PYX_ERR(0, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, 9); __PYX_ERR(0, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, 10); __PYX_ERR(0, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, 11); __PYX_ERR(0, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, 12); __PYX_ERR(0, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, 13); __PYX_ERR(0, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, 14); __PYX_ERR(0, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, 15); __PYX_ERR(0, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, 16); __PYX_ERR(0, 1574, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsrmm2") < 0)) __PYX_ERR(0, 1574, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 17) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1575, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1575, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1575, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1575, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1575, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1575, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1575, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1576, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1576, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1576, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1577, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1577, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1578, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1578, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1578, __pyx_L3_error)
    __pyx_v_C = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_C == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1578, __pyx_L3_error)
    __pyx_v_ldc = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_ldc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1578, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrmm2", 1, 17, 17, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1574, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_54dcsrmm2(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_B, __pyx_v_ldb, __pyx_v_beta, __pyx_v_C, __pyx_v_ldc);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_54dcsrmm2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrmm2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dcsrmm2(__pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_B, __pyx_v_ldb, __pyx_v_beta, __pyx_v_C, __pyx_v_ldc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1587
 *     check_status(status)
 * 
 * cpdef ccsrmm2(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_57ccsrmm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrmm2(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrmm2", 0);

  /* "cupy/cuda/cusparse.pyx":1592
 *         size_t csrRowPtrA, size_t csrColIndA,
 *         size_t B, int ldb, size_t beta, size_t C, int ldc):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrmm2(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k, nnz,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1593
 *         size_t B, int ldb, size_t beta, size_t C, int ldc):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCcsrmm2(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k, nnz,
 *         <const cuComplex *>alpha, <MatDescr>descrA, <const cuComplex *>csrValA,
 */
  __pyx_v_status = cusparseCcsrmm2(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, ((cuComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), ((cuComplex const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((cuComplex const *)__pyx_v_B), __pyx_v_ldb, ((cuComplex const *)__pyx_v_beta), ((cuComplex *)__pyx_v_C), __pyx_v_ldc);

  /* "cupy/cuda/cusparse.pyx":1599
 *         <const cuComplex *>B, ldb, <const cuComplex *>beta,
 *         <cuComplex *>C, ldc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zcsrmm2(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1587
 *     check_status(status)
 * 
 * cpdef ccsrmm2(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_57ccsrmm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_56ccsrmm2[] = "ccsrmm2(size_t handle, int transA, int transB, int m, int n, int k, int nnz, size_t alpha, size_t descrA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t B, int ldb, size_t beta, size_t C, int ldc)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_57ccsrmm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  int __pyx_v_nnz;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_beta;
  size_t __pyx_v_C;
  int __pyx_v_ldc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrmm2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_transB,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_nnz,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_beta,&__pyx_n_s_C,&__pyx_n_s_ldc,0};
    PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, 1); __PYX_ERR(0, 1587, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, 2); __PYX_ERR(0, 1587, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, 3); __PYX_ERR(0, 1587, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, 4); __PYX_ERR(0, 1587, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, 5); __PYX_ERR(0, 1587, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, 6); __PYX_ERR(0, 1587, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, 7); __PYX_ERR(0, 1587, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, 8); __PYX_ERR(0, 1587, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, 9); __PYX_ERR(0, 1587, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, 10); __PYX_ERR(0, 1587, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, 11); __PYX_ERR(0, 1587, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, 12); __PYX_ERR(0, 1587, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, 13); __PYX_ERR(0, 1587, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, 14); __PYX_ERR(0, 1587, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, 15); __PYX_ERR(0, 1587, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, 16); __PYX_ERR(0, 1587, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsrmm2") < 0)) __PYX_ERR(0, 1587, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 17) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1588, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1588, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1588, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1588, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1588, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1588, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1588, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1589, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1589, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1589, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1590, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1590, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1591, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1591, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1591, __pyx_L3_error)
    __pyx_v_C = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_C == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1591, __pyx_L3_error)
    __pyx_v_ldc = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_ldc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1591, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrmm2", 1, 17, 17, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1587, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_56ccsrmm2(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_B, __pyx_v_ldb, __pyx_v_beta, __pyx_v_C, __pyx_v_ldc);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_56ccsrmm2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrmm2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ccsrmm2(__pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_B, __pyx_v_ldb, __pyx_v_beta, __pyx_v_C, __pyx_v_ldc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1601
 *     check_status(status)
 * 
 * cpdef zcsrmm2(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_59zcsrmm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrmm2(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrmm2", 0);

  /* "cupy/cuda/cusparse.pyx":1606
 *         size_t csrRowPtrA, size_t csrColIndA,
 *         size_t B, int ldb, size_t beta, size_t C, int ldc):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrmm2(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k, nnz,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1607
 *         size_t B, int ldb, size_t beta, size_t C, int ldc):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZcsrmm2(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k, nnz,
 *         <const cuDoubleComplex *>alpha, <MatDescr>descrA,
 */
  __pyx_v_status = cusparseZcsrmm2(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, ((cuDoubleComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), ((cuDoubleComplex const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((cuDoubleComplex const *)__pyx_v_B), __pyx_v_ldb, ((cuDoubleComplex const *)__pyx_v_beta), ((cuDoubleComplex *)__pyx_v_C), __pyx_v_ldc);

  /* "cupy/cuda/cusparse.pyx":1614
 *         <const cuDoubleComplex *>B, ldb,
 *         <const cuDoubleComplex *>beta, <cuDoubleComplex *>C, ldc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ########################################
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1601
 *     check_status(status)
 * 
 * cpdef zcsrmm2(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k, int nnz,
 *         size_t alpha, size_t descrA, size_t csrValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_59zcsrmm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_58zcsrmm2[] = "zcsrmm2(size_t handle, int transA, int transB, int m, int n, int k, int nnz, size_t alpha, size_t descrA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t B, int ldb, size_t beta, size_t C, int ldc)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_59zcsrmm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  int __pyx_v_nnz;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_beta;
  size_t __pyx_v_C;
  int __pyx_v_ldc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrmm2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_transB,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_nnz,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_beta,&__pyx_n_s_C,&__pyx_n_s_ldc,0};
    PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, 1); __PYX_ERR(0, 1601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, 2); __PYX_ERR(0, 1601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, 3); __PYX_ERR(0, 1601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, 4); __PYX_ERR(0, 1601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, 5); __PYX_ERR(0, 1601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, 6); __PYX_ERR(0, 1601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, 7); __PYX_ERR(0, 1601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, 8); __PYX_ERR(0, 1601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, 9); __PYX_ERR(0, 1601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, 10); __PYX_ERR(0, 1601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, 11); __PYX_ERR(0, 1601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, 12); __PYX_ERR(0, 1601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, 13); __PYX_ERR(0, 1601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, 14); __PYX_ERR(0, 1601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, 15); __PYX_ERR(0, 1601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, 16); __PYX_ERR(0, 1601, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsrmm2") < 0)) __PYX_ERR(0, 1601, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 17) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1602, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1602, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1602, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1602, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1602, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1602, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1602, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1603, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1603, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1603, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1604, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1604, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1605, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1605, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1605, __pyx_L3_error)
    __pyx_v_C = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_C == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1605, __pyx_L3_error)
    __pyx_v_ldc = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_ldc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1605, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrmm2", 1, 17, 17, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1601, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_58zcsrmm2(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_B, __pyx_v_ldb, __pyx_v_beta, __pyx_v_C, __pyx_v_ldc);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_58zcsrmm2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, int __pyx_v_nnz, size_t __pyx_v_alpha, size_t __pyx_v_descrA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_beta, size_t __pyx_v_C, int __pyx_v_ldc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrmm2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zcsrmm2(__pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_nnz, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_B, __pyx_v_ldb, __pyx_v_beta, __pyx_v_C, __pyx_v_ldc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrmm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1619
 * # cuSPARSE Extra Function
 * 
 * cpdef xcsrgeamNnz(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA, int nnzA,
 *         size_t csrRowPtrA, size_t csrColIndA, size_t descrB,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_61xcsrgeamNnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcsrgeamNnz(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_nnzTotalDevHostPtr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsrgeamNnz", 0);

  /* "cupy/cuda/cusparse.pyx":1624
 *         int nnzB, size_t csrRowPtrB, size_t csrColIndB,
 *         size_t descrC, size_t csrRowPtrC, size_t nnzTotalDevHostPtr):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseXcsrgeamNnz(
 *         <Handle>handle, m, n, <const MatDescr>descrA, nnzA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1625
 *         size_t descrC, size_t csrRowPtrC, size_t nnzTotalDevHostPtr):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseXcsrgeamNnz(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const MatDescr>descrA, nnzA,
 *         <const int *>csrRowPtrA, <const int *>csrColIndA,
 */
  __pyx_v_status = cusparseXcsrgeamNnz(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_nnzTotalDevHostPtr));

  /* "cupy/cuda/cusparse.pyx":1631
 *         <const int *>csrColIndB, <const MatDescr>descrC, <int *>csrRowPtrC,
 *         <int *>nnzTotalDevHostPtr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef scsrgeam(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1619
 * # cuSPARSE Extra Function
 * 
 * cpdef xcsrgeamNnz(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA, int nnzA,
 *         size_t csrRowPtrA, size_t csrColIndA, size_t descrB,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrgeamNnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_61xcsrgeamNnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_60xcsrgeamNnz[] = "xcsrgeamNnz(size_t handle, int m, int n, size_t descrA, int nnzA, size_t csrRowPtrA, size_t csrColIndA, size_t descrB, int nnzB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrRowPtrC, size_t nnzTotalDevHostPtr)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_61xcsrgeamNnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_nnzTotalDevHostPtr;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsrgeamNnz (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_nnzTotalDevHostPtr,0};
    PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeamNnz", 1, 14, 14, 1); __PYX_ERR(0, 1619, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeamNnz", 1, 14, 14, 2); __PYX_ERR(0, 1619, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeamNnz", 1, 14, 14, 3); __PYX_ERR(0, 1619, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeamNnz", 1, 14, 14, 4); __PYX_ERR(0, 1619, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeamNnz", 1, 14, 14, 5); __PYX_ERR(0, 1619, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeamNnz", 1, 14, 14, 6); __PYX_ERR(0, 1619, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeamNnz", 1, 14, 14, 7); __PYX_ERR(0, 1619, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeamNnz", 1, 14, 14, 8); __PYX_ERR(0, 1619, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeamNnz", 1, 14, 14, 9); __PYX_ERR(0, 1619, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeamNnz", 1, 14, 14, 10); __PYX_ERR(0, 1619, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeamNnz", 1, 14, 14, 11); __PYX_ERR(0, 1619, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeamNnz", 1, 14, 14, 12); __PYX_ERR(0, 1619, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzTotalDevHostPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeamNnz", 1, 14, 14, 13); __PYX_ERR(0, 1619, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xcsrgeamNnz") < 0)) __PYX_ERR(0, 1619, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 14) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1620, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1620, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1620, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1620, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1620, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1621, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1621, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1621, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1622, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1622, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1622, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1623, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1623, __pyx_L3_error)
    __pyx_v_nnzTotalDevHostPtr = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_nnzTotalDevHostPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1623, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsrgeamNnz", 1, 14, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1619, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrgeamNnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_60xcsrgeamNnz(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrRowPtrC, __pyx_v_nnzTotalDevHostPtr);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_60xcsrgeamNnz(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_nnzTotalDevHostPtr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsrgeamNnz", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_xcsrgeamNnz(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrRowPtrC, __pyx_v_nnzTotalDevHostPtr, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrgeamNnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1633
 *     check_status(status)
 * 
 * cpdef scsrgeam(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_63scsrgeam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrgeam(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrgeam", 0);

  /* "cupy/cuda/cusparse.pyx":1640
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseScsrgeam(
 *         <Handle>handle, m, n, <const float *>alpha,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1641
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseScsrgeam(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const float *>alpha,
 *         <const MatDescr>descrA, nnzA, <const float *>csrValA,
 */
  __pyx_v_status = cusparseScsrgeam(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((float const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((float const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((float const *)__pyx_v_beta), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((float const *)__pyx_v_csrValB), ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((float *)__pyx_v_csrValC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC));

  /* "cupy/cuda/cusparse.pyx":1649
 *         <const MatDescr>descrC, <float *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dcsrgeam(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1633
 *     check_status(status)
 * 
 * cpdef scsrgeam(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_63scsrgeam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_62scsrgeam[] = "scsrgeam(size_t handle, int m, int n, size_t alpha, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t beta, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_63scsrgeam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrgeam (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_beta,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,0};
    PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 1); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 2); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 3); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 4); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 5); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 6); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 7); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 8); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 9); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 10); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 11); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 12); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 13); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 14); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 15); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 16); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 17); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, 18); __PYX_ERR(0, 1633, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsrgeam") < 0)) __PYX_ERR(0, 1633, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 19) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1634, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1634, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1634, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1634, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1634, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1635, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1635, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1635, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1636, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1636, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1636, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1637, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1637, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1637, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1638, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1638, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1638, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1639, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1639, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrgeam", 1, 19, 19, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1633, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_62scsrgeam(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_62scsrgeam(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrgeam", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_scsrgeam(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1651
 *     check_status(status)
 * 
 * cpdef dcsrgeam(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_65dcsrgeam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrgeam(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrgeam", 0);

  /* "cupy/cuda/cusparse.pyx":1658
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrgeam(
 *         <Handle>handle, m, n, <const double *>alpha,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1659
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDcsrgeam(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const double *>alpha,
 *         <const MatDescr>descrA, nnzA, <const double *>csrValA,
 */
  __pyx_v_status = cusparseDcsrgeam(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((double const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((double const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((double const *)__pyx_v_beta), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((double const *)__pyx_v_csrValB), ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((double *)__pyx_v_csrValC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC));

  /* "cupy/cuda/cusparse.pyx":1667
 *         <const MatDescr>descrC, <double *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef ccsrgeam(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1651
 *     check_status(status)
 * 
 * cpdef dcsrgeam(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_65dcsrgeam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_64dcsrgeam[] = "dcsrgeam(size_t handle, int m, int n, size_t alpha, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t beta, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_65dcsrgeam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrgeam (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_beta,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,0};
    PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 1); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 2); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 3); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 4); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 5); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 6); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 7); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 8); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 9); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 10); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 11); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 12); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 13); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 14); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 15); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 16); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 17); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, 18); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsrgeam") < 0)) __PYX_ERR(0, 1651, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 19) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1652, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1652, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1652, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1652, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1652, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1653, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1653, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1653, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1654, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1654, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1654, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1655, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1655, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1655, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1656, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1656, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1656, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1657, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1657, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrgeam", 1, 19, 19, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1651, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_64dcsrgeam(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_64dcsrgeam(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrgeam", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dcsrgeam(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1669
 *     check_status(status)
 * 
 * cpdef ccsrgeam(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_67ccsrgeam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrgeam(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrgeam", 0);

  /* "cupy/cuda/cusparse.pyx":1676
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrgeam(
 *         <Handle>handle, m, n, <const cuComplex *>alpha,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1677
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCcsrgeam(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const cuComplex *>alpha,
 *         <const MatDescr>descrA, nnzA, <const cuComplex *>csrValA,
 */
  __pyx_v_status = cusparseCcsrgeam(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cuComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((cuComplex const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((cuComplex const *)__pyx_v_beta), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((cuComplex const *)__pyx_v_csrValB), ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((cuComplex *)__pyx_v_csrValC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC));

  /* "cupy/cuda/cusparse.pyx":1686
 *         <const MatDescr>descrC, <cuComplex *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zcsrgeam(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1669
 *     check_status(status)
 * 
 * cpdef ccsrgeam(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_67ccsrgeam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_66ccsrgeam[] = "ccsrgeam(size_t handle, int m, int n, size_t alpha, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t beta, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_67ccsrgeam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrgeam (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_beta,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,0};
    PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 1); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 2); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 3); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 4); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 5); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 6); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 7); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 8); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 9); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 10); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 11); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 12); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 13); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 14); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 15); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 16); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 17); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, 18); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsrgeam") < 0)) __PYX_ERR(0, 1669, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 19) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1670, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1670, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1670, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1670, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1670, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1671, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1671, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1671, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1672, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1672, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1672, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1673, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1673, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1673, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1674, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1674, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1674, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1675, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1675, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrgeam", 1, 19, 19, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1669, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_66ccsrgeam(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_66ccsrgeam(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrgeam", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ccsrgeam(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1688
 *     check_status(status)
 * 
 * cpdef zcsrgeam(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_69zcsrgeam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrgeam(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrgeam", 0);

  /* "cupy/cuda/cusparse.pyx":1695
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrgeam(
 *         <Handle>handle, m, n, <const cuDoubleComplex *>alpha,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1696
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZcsrgeam(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const cuDoubleComplex *>alpha,
 *         <const MatDescr>descrA, nnzA, <const cuDoubleComplex *>csrValA,
 */
  __pyx_v_status = cusparseZcsrgeam(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cuDoubleComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((cuDoubleComplex const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((cuDoubleComplex const *)__pyx_v_beta), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((cuDoubleComplex const *)__pyx_v_csrValB), ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((cuDoubleComplex *)__pyx_v_csrValC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC));

  /* "cupy/cuda/cusparse.pyx":1705
 *         <const MatDescr>descrC, <cuDoubleComplex *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t scsrgeam2_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1688
 *     check_status(status)
 * 
 * cpdef zcsrgeam(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_69zcsrgeam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_68zcsrgeam[] = "zcsrgeam(size_t handle, int m, int n, size_t alpha, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t beta, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_69zcsrgeam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrgeam (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_beta,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,0};
    PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 1); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 2); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 3); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 4); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 5); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 6); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 7); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 8); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 9); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 10); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 11); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 12); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 13); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 14); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 15); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 16); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 17); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, 18); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsrgeam") < 0)) __PYX_ERR(0, 1688, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 19) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1689, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1689, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1689, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1689, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1689, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1690, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1690, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1690, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1691, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1691, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1691, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1692, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1692, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1692, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1693, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1693, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1693, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1694, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1694, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrgeam", 1, 19, 19, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1688, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_68zcsrgeam(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_68zcsrgeam(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrgeam", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zcsrgeam(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrgeam", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1707
 *     check_status(status)
 * 
 * cpdef size_t scsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_71scsrgeam2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_scsrgeam2_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSize;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrgeam2_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":1715
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     cdef size_t bufferSize
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseScsrgeam2_bufferSizeExt(
 *         <Handle>handle, m, n, <const float *>alpha,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1716
 *     cdef size_t bufferSize
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseScsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const float *>alpha,
 *         <const MatDescr>descrA, nnzA, <const float *>csrValA,
 */
  __pyx_v_status = cusparseScsrgeam2_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((float const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((float const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((float const *)__pyx_v_beta), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((float const *)__pyx_v_csrValB), ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((float *)__pyx_v_csrValC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC), (&__pyx_v_bufferSize));

  /* "cupy/cuda/cusparse.pyx":1724
 *         <const MatDescr>descrC, <float *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1725
 *         <int *>csrColIndC, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t dcsrgeam2_bufferSizeExt(
 */
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":1707
 *     check_status(status)
 * 
 * cpdef size_t scsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.scsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_71scsrgeam2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_70scsrgeam2_bufferSizeExt[] = "scsrgeam2_bufferSizeExt(size_t handle, int m, int n, size_t alpha, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t beta, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_71scsrgeam2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrgeam2_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_beta,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,0};
    PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 1); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 2); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 3); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 4); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 5); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 6); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 7); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 8); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 9); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 10); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 11); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 12); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 13); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 14); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 15); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 16); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 17); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, 18); __PYX_ERR(0, 1707, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsrgeam2_bufferSizeExt") < 0)) __PYX_ERR(0, 1707, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 19) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1708, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1708, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1708, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1708, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1708, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1709, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1709, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1709, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1710, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1710, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1710, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1711, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1711, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1711, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1712, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1712, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1712, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1713, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1713, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrgeam2_bufferSizeExt", 1, 19, 19, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1707, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_70scsrgeam2_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_70scsrgeam2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrgeam2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_scsrgeam2_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1727
 *     return bufferSize
 * 
 * cpdef size_t dcsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_73dcsrgeam2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_dcsrgeam2_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSize;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrgeam2_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":1735
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     cdef size_t bufferSize
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrgeam2_bufferSizeExt(
 *         <Handle>handle, m, n, <const double *>alpha,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1736
 *     cdef size_t bufferSize
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDcsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const double *>alpha,
 *         <const MatDescr>descrA, nnzA, <const double *>csrValA,
 */
  __pyx_v_status = cusparseDcsrgeam2_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((double const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((double const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((double const *)__pyx_v_beta), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((double const *)__pyx_v_csrValB), ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((double *)__pyx_v_csrValC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC), (&__pyx_v_bufferSize));

  /* "cupy/cuda/cusparse.pyx":1744
 *         <const MatDescr>descrC, <double *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1745
 *         <int *>csrColIndC, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t ccsrgeam2_bufferSizeExt(
 */
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":1727
 *     return bufferSize
 * 
 * cpdef size_t dcsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.dcsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_73dcsrgeam2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_72dcsrgeam2_bufferSizeExt[] = "dcsrgeam2_bufferSizeExt(size_t handle, int m, int n, size_t alpha, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t beta, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_73dcsrgeam2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrgeam2_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_beta,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,0};
    PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 1); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 2); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 3); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 4); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 5); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 6); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 7); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 8); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 9); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 10); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 11); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 12); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 13); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 14); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 15); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 16); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 17); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, 18); __PYX_ERR(0, 1727, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsrgeam2_bufferSizeExt") < 0)) __PYX_ERR(0, 1727, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 19) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1728, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1728, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1728, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1728, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1728, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1729, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1729, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1729, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1730, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1730, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1730, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1731, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1731, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1731, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1732, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1732, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1732, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1733, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1733, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrgeam2_bufferSizeExt", 1, 19, 19, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1727, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_72dcsrgeam2_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_72dcsrgeam2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrgeam2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_dcsrgeam2_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1747
 *     return bufferSize
 * 
 * cpdef size_t ccsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_75ccsrgeam2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_ccsrgeam2_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSize;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrgeam2_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":1755
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     cdef size_t bufferSize
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrgeam2_bufferSizeExt(
 *         <Handle>handle, m, n, <const cuComplex *>alpha,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1756
 *     cdef size_t bufferSize
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCcsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const cuComplex *>alpha,
 *         <const MatDescr>descrA, nnzA, <const cuComplex *>csrValA,
 */
  __pyx_v_status = cusparseCcsrgeam2_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cuComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((cuComplex const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((cuComplex const *)__pyx_v_beta), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((cuComplex const *)__pyx_v_csrValB), ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((cuComplex *)__pyx_v_csrValC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC), (&__pyx_v_bufferSize));

  /* "cupy/cuda/cusparse.pyx":1765
 *         <const MatDescr>descrC, <cuComplex *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1766
 *         <int *>csrColIndC, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t zcsrgeam2_bufferSizeExt(
 */
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":1747
 *     return bufferSize
 * 
 * cpdef size_t ccsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.ccsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_75ccsrgeam2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_74ccsrgeam2_bufferSizeExt[] = "ccsrgeam2_bufferSizeExt(size_t handle, int m, int n, size_t alpha, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t beta, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_75ccsrgeam2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrgeam2_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_beta,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,0};
    PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 1); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 2); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 3); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 4); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 5); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 6); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 7); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 8); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 9); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 10); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 11); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 12); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 13); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 14); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 15); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 16); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 17); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, 18); __PYX_ERR(0, 1747, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsrgeam2_bufferSizeExt") < 0)) __PYX_ERR(0, 1747, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 19) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1748, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1748, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1748, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1748, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1748, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1749, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1749, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1749, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1750, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1750, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1750, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1751, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1751, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1751, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1752, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1752, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1752, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1753, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1753, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrgeam2_bufferSizeExt", 1, 19, 19, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1747, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_74ccsrgeam2_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_74ccsrgeam2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrgeam2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_ccsrgeam2_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1768
 *     return bufferSize
 * 
 * cpdef size_t zcsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_77zcsrgeam2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_zcsrgeam2_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSize;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrgeam2_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":1776
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     cdef size_t bufferSize
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrgeam2_bufferSizeExt(
 *         <Handle>handle, m, n, <const cuDoubleComplex *>alpha,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1777
 *     cdef size_t bufferSize
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZcsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const cuDoubleComplex *>alpha,
 *         <const MatDescr>descrA, nnzA, <const cuDoubleComplex *>csrValA,
 */
  __pyx_v_status = cusparseZcsrgeam2_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cuDoubleComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((cuDoubleComplex const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((cuDoubleComplex const *)__pyx_v_beta), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((cuDoubleComplex const *)__pyx_v_csrValB), ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((cuDoubleComplex *)__pyx_v_csrValC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC), (&__pyx_v_bufferSize));

  /* "cupy/cuda/cusparse.pyx":1786
 *         <const MatDescr>descrC, <cuDoubleComplex *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1787
 *         <int *>csrColIndC, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef xcsrgeam2Nnz(
 */
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":1768
 *     return bufferSize
 * 
 * cpdef size_t zcsrgeam2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.zcsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_77zcsrgeam2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_76zcsrgeam2_bufferSizeExt[] = "zcsrgeam2_bufferSizeExt(size_t handle, int m, int n, size_t alpha, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t beta, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_77zcsrgeam2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrgeam2_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_beta,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,0};
    PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 1); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 2); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 3); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 4); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 5); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 6); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 7); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 8); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 9); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 10); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 11); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 12); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 13); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 14); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 15); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 16); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 17); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, 18); __PYX_ERR(0, 1768, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsrgeam2_bufferSizeExt") < 0)) __PYX_ERR(0, 1768, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 19) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1769, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1769, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1769, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1769, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1769, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1770, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1770, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1770, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1771, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1771, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1771, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1772, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1772, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1772, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1773, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1773, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1773, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1774, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1774, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrgeam2_bufferSizeExt", 1, 19, 19, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1768, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_76zcsrgeam2_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_76zcsrgeam2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrgeam2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_zcsrgeam2_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrgeam2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1789
 *     return bufferSize
 * 
 * cpdef xcsrgeam2Nnz(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA, int nnzA,
 *         size_t csrRowPtrA, size_t csrColIndA, size_t descrB,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_79xcsrgeam2Nnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcsrgeam2Nnz(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_nnzTotalDevHostPtr, size_t __pyx_v_workspace, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsrgeam2Nnz", 0);

  /* "cupy/cuda/cusparse.pyx":1795
 *         size_t descrC, size_t csrRowPtrC, size_t nnzTotalDevHostPtr,
 *         size_t workspace):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseXcsrgeam2Nnz(
 *         <Handle>handle, m, n, <const MatDescr>descrA, nnzA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1796
 *         size_t workspace):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseXcsrgeam2Nnz(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const MatDescr>descrA, nnzA,
 *         <const int *>csrRowPtrA, <const int *>csrColIndA,
 */
  __pyx_v_status = cusparseXcsrgeam2Nnz(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_nnzTotalDevHostPtr), ((void *)__pyx_v_workspace));

  /* "cupy/cuda/cusparse.pyx":1802
 *         <const int *>csrColIndB, <const MatDescr>descrC, <int *>csrRowPtrC,
 *         <int *>nnzTotalDevHostPtr, <void*> workspace)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t scsrgeam2(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1789
 *     return bufferSize
 * 
 * cpdef xcsrgeam2Nnz(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA, int nnzA,
 *         size_t csrRowPtrA, size_t csrColIndA, size_t descrB,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrgeam2Nnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_79xcsrgeam2Nnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_78xcsrgeam2Nnz[] = "xcsrgeam2Nnz(size_t handle, int m, int n, size_t descrA, int nnzA, size_t csrRowPtrA, size_t csrColIndA, size_t descrB, int nnzB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrRowPtrC, size_t nnzTotalDevHostPtr, size_t workspace)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_79xcsrgeam2Nnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_nnzTotalDevHostPtr;
  size_t __pyx_v_workspace;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsrgeam2Nnz (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_nnzTotalDevHostPtr,&__pyx_n_s_workspace,0};
    PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, 1); __PYX_ERR(0, 1789, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, 2); __PYX_ERR(0, 1789, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, 3); __PYX_ERR(0, 1789, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, 4); __PYX_ERR(0, 1789, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, 5); __PYX_ERR(0, 1789, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, 6); __PYX_ERR(0, 1789, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, 7); __PYX_ERR(0, 1789, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, 8); __PYX_ERR(0, 1789, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, 9); __PYX_ERR(0, 1789, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, 10); __PYX_ERR(0, 1789, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, 11); __PYX_ERR(0, 1789, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, 12); __PYX_ERR(0, 1789, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzTotalDevHostPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, 13); __PYX_ERR(0, 1789, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workspace)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, 14); __PYX_ERR(0, 1789, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xcsrgeam2Nnz") < 0)) __PYX_ERR(0, 1789, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 15) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1790, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1790, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1790, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1790, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1790, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1791, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1791, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1791, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1792, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1792, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1792, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1793, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1793, __pyx_L3_error)
    __pyx_v_nnzTotalDevHostPtr = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_nnzTotalDevHostPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1793, __pyx_L3_error)
    __pyx_v_workspace = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_workspace == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1794, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsrgeam2Nnz", 1, 15, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1789, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrgeam2Nnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_78xcsrgeam2Nnz(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrRowPtrC, __pyx_v_nnzTotalDevHostPtr, __pyx_v_workspace);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_78xcsrgeam2Nnz(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_nnzTotalDevHostPtr, size_t __pyx_v_workspace) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsrgeam2Nnz", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_xcsrgeam2Nnz(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrRowPtrC, __pyx_v_nnzTotalDevHostPtr, __pyx_v_workspace, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrgeam2Nnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1804
 *     check_status(status)
 * 
 * cpdef size_t scsrgeam2(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_81scsrgeam2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_scsrgeam2(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_buffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrgeam2", 0);

  /* "cupy/cuda/cusparse.pyx":1811
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC, size_t buffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseScsrgeam2(
 *         <Handle>handle, m, n, <const float *>alpha,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1812
 *         size_t csrRowPtrC, size_t csrColIndC, size_t buffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseScsrgeam2(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const float *>alpha,
 *         <const MatDescr>descrA, nnzA, <const float *>csrValA,
 */
  __pyx_v_status = cusparseScsrgeam2(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((float const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((float const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((float const *)__pyx_v_beta), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((float const *)__pyx_v_csrValB), ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((float *)__pyx_v_csrValC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC), ((void *)__pyx_v_buffer));

  /* "cupy/cuda/cusparse.pyx":1820
 *         <const MatDescr>descrC, <float *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC, <void*>buffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t dcsrgeam2(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1804
 *     check_status(status)
 * 
 * cpdef size_t scsrgeam2(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.scsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_81scsrgeam2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_80scsrgeam2[] = "scsrgeam2(size_t handle, int m, int n, size_t alpha, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t beta, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC, size_t buffer) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_81scsrgeam2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  size_t __pyx_v_buffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrgeam2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_beta,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,&__pyx_n_s_buffer,0};
    PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        CYTHON_FALLTHROUGH;
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 1); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 2); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 3); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 4); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 5); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 6); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 7); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 8); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 9); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 10); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 11); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 12); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 13); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 14); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 15); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 16); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 17); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 18); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 19:
        if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, 19); __PYX_ERR(0, 1804, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsrgeam2") < 0)) __PYX_ERR(0, 1804, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
      values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1805, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1805, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1805, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1805, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1805, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1806, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1806, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1806, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1807, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1807, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1807, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1808, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1808, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1808, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1809, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1809, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1809, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1810, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1810, __pyx_L3_error)
    __pyx_v_buffer = __Pyx_PyInt_As_size_t(values[19]); if (unlikely((__pyx_v_buffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1810, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrgeam2", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1804, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_80scsrgeam2(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, __pyx_v_buffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_80scsrgeam2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_buffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrgeam2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_scsrgeam2(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, __pyx_v_buffer, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1822
 *     check_status(status)
 * 
 * cpdef size_t dcsrgeam2(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_83dcsrgeam2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_dcsrgeam2(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_buffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrgeam2", 0);

  /* "cupy/cuda/cusparse.pyx":1829
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC, size_t buffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrgeam2(
 *         <Handle>handle, m, n, <const double *>alpha,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1830
 *         size_t csrRowPtrC, size_t csrColIndC, size_t buffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDcsrgeam2(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const double *>alpha,
 *         <const MatDescr>descrA, nnzA, <const double *>csrValA,
 */
  __pyx_v_status = cusparseDcsrgeam2(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((double const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((double const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((double const *)__pyx_v_beta), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((double const *)__pyx_v_csrValB), ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((double *)__pyx_v_csrValC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC), ((void *)__pyx_v_buffer));

  /* "cupy/cuda/cusparse.pyx":1838
 *         <const MatDescr>descrC, <double *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC, <void*>buffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t ccsrgeam2(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1822
 *     check_status(status)
 * 
 * cpdef size_t dcsrgeam2(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.dcsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_83dcsrgeam2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_82dcsrgeam2[] = "dcsrgeam2(size_t handle, int m, int n, size_t alpha, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t beta, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC, size_t buffer) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_83dcsrgeam2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  size_t __pyx_v_buffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrgeam2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_beta,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,&__pyx_n_s_buffer,0};
    PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        CYTHON_FALLTHROUGH;
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 1); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 2); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 3); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 4); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 5); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 6); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 7); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 8); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 9); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 10); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 11); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 12); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 13); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 14); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 15); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 16); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 17); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 18); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 19:
        if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, 19); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsrgeam2") < 0)) __PYX_ERR(0, 1822, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
      values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1823, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1823, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1823, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1823, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1823, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1824, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1824, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1824, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1825, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1825, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1825, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1826, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1826, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1826, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1827, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1827, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1827, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1828, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1828, __pyx_L3_error)
    __pyx_v_buffer = __Pyx_PyInt_As_size_t(values[19]); if (unlikely((__pyx_v_buffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1828, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrgeam2", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1822, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_82dcsrgeam2(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, __pyx_v_buffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_82dcsrgeam2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_buffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrgeam2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_dcsrgeam2(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, __pyx_v_buffer, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1840
 *     check_status(status)
 * 
 * cpdef size_t ccsrgeam2(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_85ccsrgeam2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_ccsrgeam2(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_buffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrgeam2", 0);

  /* "cupy/cuda/cusparse.pyx":1847
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC, size_t buffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrgeam2(
 *         <Handle>handle, m, n, <const cuComplex *>alpha,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1848
 *         size_t csrRowPtrC, size_t csrColIndC, size_t buffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCcsrgeam2(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const cuComplex *>alpha,
 *         <const MatDescr>descrA, nnzA, <const cuComplex *>csrValA,
 */
  __pyx_v_status = cusparseCcsrgeam2(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cuComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((cuComplex const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((cuComplex const *)__pyx_v_beta), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((cuComplex const *)__pyx_v_csrValB), ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((cuComplex *)__pyx_v_csrValC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC), ((void *)__pyx_v_buffer));

  /* "cupy/cuda/cusparse.pyx":1857
 *         <const MatDescr>descrC, <cuComplex *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC, <void*>buffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t zcsrgeam2(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1840
 *     check_status(status)
 * 
 * cpdef size_t ccsrgeam2(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.ccsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_85ccsrgeam2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_84ccsrgeam2[] = "ccsrgeam2(size_t handle, int m, int n, size_t alpha, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t beta, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC, size_t buffer) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_85ccsrgeam2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  size_t __pyx_v_buffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrgeam2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_beta,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,&__pyx_n_s_buffer,0};
    PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        CYTHON_FALLTHROUGH;
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 1); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 2); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 3); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 4); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 5); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 6); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 7); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 8); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 9); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 10); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 11); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 12); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 13); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 14); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 15); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 16); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 17); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 18); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 19:
        if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, 19); __PYX_ERR(0, 1840, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsrgeam2") < 0)) __PYX_ERR(0, 1840, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
      values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1841, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1841, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1841, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1841, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1841, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1842, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1842, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1842, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1843, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1843, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1843, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1844, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1844, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1844, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1845, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1845, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1845, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1846, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1846, __pyx_L3_error)
    __pyx_v_buffer = __Pyx_PyInt_As_size_t(values[19]); if (unlikely((__pyx_v_buffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1846, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrgeam2", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1840, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_84ccsrgeam2(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, __pyx_v_buffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_84ccsrgeam2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_buffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrgeam2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_ccsrgeam2(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, __pyx_v_buffer, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1859
 *     check_status(status)
 * 
 * cpdef size_t zcsrgeam2(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_87zcsrgeam2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_zcsrgeam2(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_buffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrgeam2", 0);

  /* "cupy/cuda/cusparse.pyx":1866
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC, size_t buffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrgeam2(
 *         <Handle>handle, m, n, <const cuDoubleComplex *>alpha,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1867
 *         size_t csrRowPtrC, size_t csrColIndC, size_t buffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZcsrgeam2(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const cuDoubleComplex *>alpha,
 *         <const MatDescr>descrA, nnzA, <const cuDoubleComplex *>csrValA,
 */
  __pyx_v_status = cusparseZcsrgeam2(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cuDoubleComplex const *)__pyx_v_alpha), ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((cuDoubleComplex const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((cuDoubleComplex const *)__pyx_v_beta), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((cuDoubleComplex const *)__pyx_v_csrValB), ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((cuDoubleComplex *)__pyx_v_csrValC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC), ((void *)__pyx_v_buffer));

  /* "cupy/cuda/cusparse.pyx":1876
 *         <const MatDescr>descrC, <cuDoubleComplex *>csrValC, <int *>csrRowPtrC,
 *         <int *>csrColIndC, <void*>buffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef xcsrgemmNnz(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1859
 *     check_status(status)
 * 
 * cpdef size_t zcsrgeam2(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA,
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.zcsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_87zcsrgeam2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_86zcsrgeam2[] = "zcsrgeam2(size_t handle, int m, int n, size_t alpha, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t beta, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC, size_t buffer) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_87zcsrgeam2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  size_t __pyx_v_buffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrgeam2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_beta,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,&__pyx_n_s_buffer,0};
    PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        CYTHON_FALLTHROUGH;
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 1); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 2); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 3); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 4); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 5); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 6); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 7); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 8); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 9); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 10); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 11); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 12); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 13); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 14); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 15); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 16); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 17); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 18); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 19:
        if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, 19); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsrgeam2") < 0)) __PYX_ERR(0, 1859, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
      values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1860, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1860, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1860, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1860, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1860, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1861, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1861, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1861, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1862, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1862, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1862, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1863, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1863, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1863, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1864, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1864, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1864, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1865, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1865, __pyx_L3_error)
    __pyx_v_buffer = __Pyx_PyInt_As_size_t(values[19]); if (unlikely((__pyx_v_buffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1865, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrgeam2", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1859, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_86zcsrgeam2(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, __pyx_v_buffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_86zcsrgeam2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_beta, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_buffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrgeam2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_zcsrgeam2(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_beta, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, __pyx_v_buffer, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrgeam2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1878
 *     check_status(status)
 * 
 * cpdef xcsrgemmNnz(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k,
 *         size_t descrA, int nnzA, size_t csrRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_89xcsrgemmNnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcsrgemmNnz(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_nnzTotalDevHostPtr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsrgemmNnz", 0);

  /* "cupy/cuda/cusparse.pyx":1884
 *         size_t csrRowPtrB, size_t csrColIndB,
 *         size_t descrC, size_t csrRowPtrC, size_t nnzTotalDevHostPtr):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseXcsrgemmNnz(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1885
 *         size_t descrC, size_t csrRowPtrC, size_t nnzTotalDevHostPtr):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseXcsrgemmNnz(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k,
 *         <const MatDescr>descrA, nnzA, <const int *>csrRowPtrA,
 */
  __pyx_v_status = cusparseXcsrgemmNnz(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_n, __pyx_v_k, ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_nnzTotalDevHostPtr));

  /* "cupy/cuda/cusparse.pyx":1891
 *         <const int *>csrRowPtrB, <const int *>csrColIndB,
 *         <const MatDescr>descrC, <int *>csrRowPtrC, <int *>nnzTotalDevHostPtr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef scsrgemm(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1878
 *     check_status(status)
 * 
 * cpdef xcsrgemmNnz(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k,
 *         size_t descrA, int nnzA, size_t csrRowPtrA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrgemmNnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_89xcsrgemmNnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_88xcsrgemmNnz[] = "xcsrgemmNnz(size_t handle, int transA, int transB, int m, int n, int k, size_t descrA, int nnzA, size_t csrRowPtrA, size_t csrColIndA, size_t descrB, int nnzB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrRowPtrC, size_t nnzTotalDevHostPtr)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_89xcsrgemmNnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_nnzTotalDevHostPtr;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsrgemmNnz (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_transB,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_nnzTotalDevHostPtr,0};
    PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, 1); __PYX_ERR(0, 1878, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, 2); __PYX_ERR(0, 1878, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, 3); __PYX_ERR(0, 1878, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, 4); __PYX_ERR(0, 1878, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, 5); __PYX_ERR(0, 1878, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, 6); __PYX_ERR(0, 1878, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, 7); __PYX_ERR(0, 1878, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, 8); __PYX_ERR(0, 1878, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, 9); __PYX_ERR(0, 1878, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, 10); __PYX_ERR(0, 1878, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, 11); __PYX_ERR(0, 1878, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, 12); __PYX_ERR(0, 1878, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, 13); __PYX_ERR(0, 1878, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, 14); __PYX_ERR(0, 1878, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, 15); __PYX_ERR(0, 1878, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzTotalDevHostPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, 16); __PYX_ERR(0, 1878, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xcsrgemmNnz") < 0)) __PYX_ERR(0, 1878, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 17) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1879, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1879, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1879, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1879, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1879, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1879, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1880, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1880, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1880, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1881, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1881, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1881, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1882, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1882, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1883, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1883, __pyx_L3_error)
    __pyx_v_nnzTotalDevHostPtr = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_nnzTotalDevHostPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1883, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsrgemmNnz", 1, 17, 17, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1878, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrgemmNnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_88xcsrgemmNnz(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrRowPtrC, __pyx_v_nnzTotalDevHostPtr);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_88xcsrgemmNnz(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_nnzTotalDevHostPtr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsrgemmNnz", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_xcsrgemmNnz(__pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrRowPtrC, __pyx_v_nnzTotalDevHostPtr, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrgemmNnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1893
 *     check_status(status)
 * 
 * cpdef scsrgemm(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k,
 *         size_t descrA, const int nnzA, size_t csrValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_91scsrgemm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrgemm(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int const __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int const __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrgemm", 0);

  /* "cupy/cuda/cusparse.pyx":1900
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseScsrgemm(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1901
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseScsrgemm(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k,
 *         <const MatDescr>descrA, nnzA, <const float *>csrValA,
 */
  __pyx_v_status = cusparseScsrgemm(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_n, __pyx_v_k, ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((float const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((float const *)__pyx_v_csrValB), ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((float *)__pyx_v_csrValC), ((int const *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC));

  /* "cupy/cuda/cusparse.pyx":1909
 *         <const MatDescr>descrC, <float *>csrValC,
 *         <const int *>csrRowPtrC, <int *>csrColIndC)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dcsrgemm(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1893
 *     check_status(status)
 * 
 * cpdef scsrgemm(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k,
 *         size_t descrA, const int nnzA, size_t csrValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_91scsrgemm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_90scsrgemm[] = "scsrgemm(size_t handle, int transA, int transB, int m, int n, int k, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_91scsrgemm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrgemm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_transB,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,0};
    PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        CYTHON_FALLTHROUGH;
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 1); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 2); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 3); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 4); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 5); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 6); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 7); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 8); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 9); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 10); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 11); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 12); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 13); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 14); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 15); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 16); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 17); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 18); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 19:
        if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, 19); __PYX_ERR(0, 1893, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsrgemm") < 0)) __PYX_ERR(0, 1893, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
      values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1894, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1894, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1894, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1894, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1894, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1894, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1895, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1895, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1895, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1896, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1896, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1896, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1897, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1897, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1897, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1898, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1898, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1898, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1899, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[19]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1899, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrgemm", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1893, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_90scsrgemm(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_90scsrgemm(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrgemm", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_scsrgemm(__pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1911
 *     check_status(status)
 * 
 * cpdef dcsrgemm(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k,
 *         size_t descrA, const int nnzA, size_t csrValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_93dcsrgemm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrgemm(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int const __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int const __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrgemm", 0);

  /* "cupy/cuda/cusparse.pyx":1918
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrgemm(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1919
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDcsrgemm(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k,
 *         <const MatDescr>descrA, nnzA, <const double *>csrValA,
 */
  __pyx_v_status = cusparseDcsrgemm(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_n, __pyx_v_k, ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((double const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((double const *)__pyx_v_csrValB), ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((double *)__pyx_v_csrValC), ((int const *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC));

  /* "cupy/cuda/cusparse.pyx":1927
 *         <const MatDescr>descrC, <double *>csrValC,
 *         <const int *>csrRowPtrC, <int *>csrColIndC)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef ccsrgemm(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1911
 *     check_status(status)
 * 
 * cpdef dcsrgemm(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k,
 *         size_t descrA, const int nnzA, size_t csrValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_93dcsrgemm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_92dcsrgemm[] = "dcsrgemm(size_t handle, int transA, int transB, int m, int n, int k, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_93dcsrgemm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrgemm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_transB,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,0};
    PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        CYTHON_FALLTHROUGH;
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 1); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 2); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 3); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 4); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 5); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 6); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 7); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 8); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 9); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 10); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 11); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 12); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 13); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 14); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 15); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 16); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 17); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 18); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 19:
        if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, 19); __PYX_ERR(0, 1911, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsrgemm") < 0)) __PYX_ERR(0, 1911, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
      values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1912, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1912, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1912, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1912, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1912, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1912, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1914, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1914, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1914, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1915, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1915, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1915, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1916, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1916, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1916, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1917, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[19]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1917, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrgemm", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1911, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_92dcsrgemm(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_92dcsrgemm(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrgemm", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dcsrgemm(__pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1929
 *     check_status(status)
 * 
 * cpdef ccsrgemm(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k,
 *         size_t descrA, const int nnzA, size_t csrValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_95ccsrgemm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrgemm(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int const __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int const __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrgemm", 0);

  /* "cupy/cuda/cusparse.pyx":1936
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrgemm(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1937
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCcsrgemm(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k,
 *         <const MatDescr>descrA, nnzA, <const cuComplex *>csrValA,
 */
  __pyx_v_status = cusparseCcsrgemm(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_n, __pyx_v_k, ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((cuComplex const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((cuComplex const *)__pyx_v_csrValB), ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((cuComplex *)__pyx_v_csrValC), ((int const *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC));

  /* "cupy/cuda/cusparse.pyx":1945
 *         <const MatDescr>descrC, <cuComplex *>csrValC,
 *         <const int *>csrRowPtrC, <int *>csrColIndC)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zcsrgemm(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1929
 *     check_status(status)
 * 
 * cpdef ccsrgemm(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k,
 *         size_t descrA, const int nnzA, size_t csrValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_95ccsrgemm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_94ccsrgemm[] = "ccsrgemm(size_t handle, int transA, int transB, int m, int n, int k, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_95ccsrgemm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrgemm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_transB,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,0};
    PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        CYTHON_FALLTHROUGH;
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 1); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 2); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 3); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 4); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 5); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 6); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 7); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 8); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 9); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 10); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 11); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 12); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 13); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 14); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 15); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 16); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 17); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 18); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 19:
        if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, 19); __PYX_ERR(0, 1929, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsrgemm") < 0)) __PYX_ERR(0, 1929, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
      values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1930, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1930, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1930, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1930, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1930, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1930, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1931, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1931, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1931, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1932, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1932, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1932, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1933, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1933, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1933, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1934, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1934, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1934, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1935, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[19]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1935, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrgemm", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1929, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_94ccsrgemm(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_94ccsrgemm(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrgemm", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ccsrgemm(__pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1947
 *     check_status(status)
 * 
 * cpdef zcsrgemm(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k,
 *         size_t descrA, const int nnzA, size_t csrValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_97zcsrgemm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrgemm(size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int const __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int const __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrgemm", 0);

  /* "cupy/cuda/cusparse.pyx":1954
 *         size_t csrColIndB, size_t descrC, size_t csrValC,
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrgemm(
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1955
 *         size_t csrRowPtrC, size_t csrColIndC):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZcsrgemm(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Operation>transA, <Operation>transB, m, n, k,
 *         <const MatDescr>descrA, nnzA, <const cuDoubleComplex *>csrValA,
 */
  __pyx_v_status = cusparseZcsrgemm(((cusparseHandle_t)__pyx_v_handle), ((cusparseOperation_t)__pyx_v_transA), ((cusparseOperation_t)__pyx_v_transB), __pyx_v_m, __pyx_v_n, __pyx_v_k, ((cusparseMatDescr_t const )__pyx_v_descrA), __pyx_v_nnzA, ((cuDoubleComplex const *)__pyx_v_csrValA), ((int const *)__pyx_v_csrRowPtrA), ((int const *)__pyx_v_csrColIndA), ((cusparseMatDescr_t const )__pyx_v_descrB), __pyx_v_nnzB, ((cuDoubleComplex const *)__pyx_v_csrValB), ((int const *)__pyx_v_csrRowPtrB), ((int const *)__pyx_v_csrColIndB), ((cusparseMatDescr_t const )__pyx_v_descrC), ((cuDoubleComplex *)__pyx_v_csrValC), ((int const *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC));

  /* "cupy/cuda/cusparse.pyx":1963
 *         <const MatDescr>descrC, <cuDoubleComplex *>csrValC,
 *         <const int *>csrRowPtrC, <int *>csrColIndC)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t createCsrgemm2Info():
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1947
 *     check_status(status)
 * 
 * cpdef zcsrgemm(             # <<<<<<<<<<<<<<
 *         size_t handle, int transA, int transB, int m, int n, int k,
 *         size_t descrA, const int nnzA, size_t csrValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_97zcsrgemm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_96zcsrgemm[] = "zcsrgemm(size_t handle, int transA, int transB, int m, int n, int k, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_97zcsrgemm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_transA;
  int __pyx_v_transB;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrgemm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_transA,&__pyx_n_s_transB,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,0};
    PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        CYTHON_FALLTHROUGH;
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 1); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 2); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 3); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 4); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 5); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 6); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 7); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 8); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 9); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 10); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 11); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 12); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 13); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 14); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 15); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 16); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 17); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 18); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 19:
        if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, 19); __PYX_ERR(0, 1947, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsrgemm") < 0)) __PYX_ERR(0, 1947, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
      values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1948, __pyx_L3_error)
    __pyx_v_transA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_transA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1948, __pyx_L3_error)
    __pyx_v_transB = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_transB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1948, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1948, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1948, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1948, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1949, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1949, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1949, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1950, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1950, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1950, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1951, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1951, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1951, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1952, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1952, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1952, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1953, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[19]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1953, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrgemm", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1947, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_96zcsrgemm(__pyx_self, __pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_96zcsrgemm(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_transA, int __pyx_v_transB, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrgemm", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zcsrgemm(__pyx_v_handle, __pyx_v_transA, __pyx_v_transB, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrgemm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1965
 *     check_status(status)
 * 
 * cpdef size_t createCsrgemm2Info():             # <<<<<<<<<<<<<<
 *     cdef csrgemm2Info_t info
 *     with nogil:
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_99createCsrgemm2Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createCsrgemm2Info(CYTHON_UNUSED int __pyx_skip_dispatch) {
  csrgemm2Info_t __pyx_v_info;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createCsrgemm2Info", 0);

  /* "cupy/cuda/cusparse.pyx":1967
 * cpdef size_t createCsrgemm2Info():
 *     cdef csrgemm2Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateCsrgemm2Info(&info)
 *     check_status(status)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":1968
 *     cdef csrgemm2Info_t info
 *     with nogil:
 *         status = cusparseCreateCsrgemm2Info(&info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>info
 */
        __pyx_v_status = cusparseCreateCsrgemm2Info((&__pyx_v_info));
      }

      /* "cupy/cuda/cusparse.pyx":1967
 * cpdef size_t createCsrgemm2Info():
 *     cdef csrgemm2Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateCsrgemm2Info(&info)
 *     check_status(status)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":1969
 *     with nogil:
 *         status = cusparseCreateCsrgemm2Info(&info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>info
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1970
 *         status = cusparseCreateCsrgemm2Info(&info)
 *     check_status(status)
 *     return <size_t>info             # <<<<<<<<<<<<<<
 * 
 * cpdef destroyCsrgemm2Info(size_t info):
 */
  __pyx_r = ((size_t)__pyx_v_info);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":1965
 *     check_status(status)
 * 
 * cpdef size_t createCsrgemm2Info():             # <<<<<<<<<<<<<<
 *     cdef csrgemm2Info_t info
 *     with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.createCsrgemm2Info", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_99createCsrgemm2Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_98createCsrgemm2Info[] = "createCsrgemm2Info() -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_99createCsrgemm2Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createCsrgemm2Info (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_98createCsrgemm2Info(__pyx_self);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_98createCsrgemm2Info(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createCsrgemm2Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_createCsrgemm2Info(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.createCsrgemm2Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1972
 *     return <size_t>info
 * 
 * cpdef destroyCsrgemm2Info(size_t info):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyCsrgemm2Info(<csrgemm2Info_t>info)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_101destroyCsrgemm2Info(PyObject *__pyx_self, PyObject *__pyx_arg_info); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroyCsrgemm2Info(size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyCsrgemm2Info", 0);

  /* "cupy/cuda/cusparse.pyx":1973
 * 
 * cpdef destroyCsrgemm2Info(size_t info):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyCsrgemm2Info(<csrgemm2Info_t>info)
 *     check_status(status)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":1974
 * cpdef destroyCsrgemm2Info(size_t info):
 *     with nogil:
 *         status = cusparseDestroyCsrgemm2Info(<csrgemm2Info_t>info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
        __pyx_v_status = cusparseDestroyCsrgemm2Info(((csrgemm2Info_t)__pyx_v_info));
      }

      /* "cupy/cuda/cusparse.pyx":1973
 * 
 * cpdef destroyCsrgemm2Info(size_t info):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyCsrgemm2Info(<csrgemm2Info_t>info)
 *     check_status(status)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":1975
 *     with nogil:
 *         status = cusparseDestroyCsrgemm2Info(<csrgemm2Info_t>info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t scsrgemm2_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1972
 *     return <size_t>info
 * 
 * cpdef destroyCsrgemm2Info(size_t info):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyCsrgemm2Info(<csrgemm2Info_t>info)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyCsrgemm2Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_101destroyCsrgemm2Info(PyObject *__pyx_self, PyObject *__pyx_arg_info); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_100destroyCsrgemm2Info[] = "destroyCsrgemm2Info(size_t info)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_101destroyCsrgemm2Info(PyObject *__pyx_self, PyObject *__pyx_arg_info) {
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyCsrgemm2Info (wrapper)", 0);
  assert(__pyx_arg_info); {
    __pyx_v_info = __Pyx_PyInt_As_size_t(__pyx_arg_info); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1972, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyCsrgemm2Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_100destroyCsrgemm2Info(__pyx_self, ((size_t)__pyx_v_info));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_100destroyCsrgemm2Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyCsrgemm2Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_destroyCsrgemm2Info(__pyx_v_info, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyCsrgemm2Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1977
 *     check_status(status)
 * 
 * cpdef size_t scsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k,
 *         size_t alpha,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_103scsrgemm2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_scsrgemm2_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSize;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrgemm2_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":1986
 *         size_t info):
 *     cdef size_t bufferSize
 *     status = cusparseScsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, k,
 *         <float*>alpha,
 */
  __pyx_v_status = cusparseScsrgemm2_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_k, ((float *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), __pyx_v_nnzA, ((int *)__pyx_v_csrRowPtrA), ((int *)__pyx_v_csrColIndA), ((cusparseMatDescr_t)__pyx_v_descrB), __pyx_v_nnzB, ((int *)__pyx_v_csrRowPtrB), ((int *)__pyx_v_csrColIndB), ((float *)__pyx_v_beta), ((cusparseMatDescr_t)__pyx_v_descrD), __pyx_v_nnzD, ((int *)__pyx_v_csrRowPtrD), ((int *)__pyx_v_csrColIndD), ((csrgemm2Info_t)__pyx_v_info), (&__pyx_v_bufferSize));

  /* "cupy/cuda/cusparse.pyx":1994
 *         <MatDescr>descrD, nnzD, <int*>csrRowPtrD, <int*>csrColIndD,
 *         <csrgemm2Info_t>info, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1995
 *         <csrgemm2Info_t>info, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t dcsrgemm2_bufferSizeExt(
 */
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":1977
 *     check_status(status)
 * 
 * cpdef size_t scsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k,
 *         size_t alpha,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.scsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_103scsrgemm2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_102scsrgemm2_bufferSizeExt[] = "scsrgemm2_bufferSizeExt(size_t handle, int m, int n, int k, size_t alpha, size_t descrA, int nnzA, size_t csrRowPtrA, size_t csrColIndA, size_t descrB, int nnzB, size_t csrRowPtrB, size_t csrColIndB, size_t beta, size_t descrD, int nnzD, size_t csrRowPtrD, size_t csrColIndD, size_t info) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_103scsrgemm2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrD;
  int __pyx_v_nnzD;
  size_t __pyx_v_csrRowPtrD;
  size_t __pyx_v_csrColIndD;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrgemm2_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_beta,&__pyx_n_s_descrD,&__pyx_n_s_nnzD,&__pyx_n_s_csrRowPtrD,&__pyx_n_s_csrColIndD,&__pyx_n_s_info,0};
    PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 1); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 2); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 3); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 4); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 5); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 6); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 7); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 8); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 9); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 10); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 11); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 12); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 13); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 14); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 15); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 16); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 17); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, 18); __PYX_ERR(0, 1977, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsrgemm2_bufferSizeExt") < 0)) __PYX_ERR(0, 1977, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 19) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1978, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1978, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1978, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1978, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1979, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1980, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1980, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1980, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1980, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1981, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1981, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1981, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1981, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1982, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1983, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1983, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1983, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1983, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1984, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrgemm2_bufferSizeExt", 1, 19, 19, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1977, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_102scsrgemm2_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_beta, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_102scsrgemm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrgemm2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_scsrgemm2_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_beta, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":1997
 *     return bufferSize
 * 
 * cpdef size_t dcsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k,
 *         size_t alpha,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_105dcsrgemm2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_dcsrgemm2_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSize;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrgemm2_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":2006
 *         size_t info):
 *     cdef size_t bufferSize
 *     status = cusparseDcsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, k,
 *         <double*>alpha,
 */
  __pyx_v_status = cusparseDcsrgemm2_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_k, ((double *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), __pyx_v_nnzA, ((int *)__pyx_v_csrRowPtrA), ((int *)__pyx_v_csrColIndA), ((cusparseMatDescr_t)__pyx_v_descrB), __pyx_v_nnzB, ((int *)__pyx_v_csrRowPtrB), ((int *)__pyx_v_csrColIndB), ((double *)__pyx_v_beta), ((cusparseMatDescr_t)__pyx_v_descrD), __pyx_v_nnzD, ((int *)__pyx_v_csrRowPtrD), ((int *)__pyx_v_csrColIndD), ((csrgemm2Info_t)__pyx_v_info), (&__pyx_v_bufferSize));

  /* "cupy/cuda/cusparse.pyx":2014
 *         <MatDescr>descrD, nnzD, <int*>csrRowPtrD, <int*>csrColIndD,
 *         <csrgemm2Info_t>info, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2015
 *         <csrgemm2Info_t>info, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t ccsrgemm2_bufferSizeExt(
 */
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":1997
 *     return bufferSize
 * 
 * cpdef size_t dcsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k,
 *         size_t alpha,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.dcsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_105dcsrgemm2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_104dcsrgemm2_bufferSizeExt[] = "dcsrgemm2_bufferSizeExt(size_t handle, int m, int n, int k, size_t alpha, size_t descrA, int nnzA, size_t csrRowPtrA, size_t csrColIndA, size_t descrB, int nnzB, size_t csrRowPtrB, size_t csrColIndB, size_t beta, size_t descrD, int nnzD, size_t csrRowPtrD, size_t csrColIndD, size_t info) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_105dcsrgemm2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrD;
  int __pyx_v_nnzD;
  size_t __pyx_v_csrRowPtrD;
  size_t __pyx_v_csrColIndD;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrgemm2_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_beta,&__pyx_n_s_descrD,&__pyx_n_s_nnzD,&__pyx_n_s_csrRowPtrD,&__pyx_n_s_csrColIndD,&__pyx_n_s_info,0};
    PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 1); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 2); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 3); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 4); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 5); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 6); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 7); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 8); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 9); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 10); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 11); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 12); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 13); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 14); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 15); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 16); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 17); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, 18); __PYX_ERR(0, 1997, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsrgemm2_bufferSizeExt") < 0)) __PYX_ERR(0, 1997, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 19) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1998, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1998, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1998, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1998, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1999, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2000, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2000, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2000, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2000, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2001, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2001, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2001, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2001, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2002, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2003, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2003, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2003, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2003, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2004, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrgemm2_bufferSizeExt", 1, 19, 19, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1997, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_104dcsrgemm2_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_beta, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_104dcsrgemm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrgemm2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_dcsrgemm2_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_beta, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2017
 *     return bufferSize
 * 
 * cpdef size_t ccsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k,
 *         size_t alpha,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_107ccsrgemm2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_ccsrgemm2_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSize;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrgemm2_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":2026
 *         size_t info):
 *     cdef size_t bufferSize
 *     status = cusparseCcsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, k,
 *         <cuComplex*>alpha,
 */
  __pyx_v_status = cusparseCcsrgemm2_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_k, ((cuComplex *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), __pyx_v_nnzA, ((int *)__pyx_v_csrRowPtrA), ((int *)__pyx_v_csrColIndA), ((cusparseMatDescr_t)__pyx_v_descrB), __pyx_v_nnzB, ((int *)__pyx_v_csrRowPtrB), ((int *)__pyx_v_csrColIndB), ((cuComplex *)__pyx_v_beta), ((cusparseMatDescr_t)__pyx_v_descrD), __pyx_v_nnzD, ((int *)__pyx_v_csrRowPtrD), ((int *)__pyx_v_csrColIndD), ((csrgemm2Info_t)__pyx_v_info), (&__pyx_v_bufferSize));

  /* "cupy/cuda/cusparse.pyx":2034
 *         <MatDescr>descrD, nnzD, <int*>csrRowPtrD, <int*>csrColIndD,
 *         <csrgemm2Info_t>info, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2035
 *         <csrgemm2Info_t>info, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t zcsrgemm2_bufferSizeExt(
 */
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2017
 *     return bufferSize
 * 
 * cpdef size_t ccsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k,
 *         size_t alpha,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.ccsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_107ccsrgemm2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_106ccsrgemm2_bufferSizeExt[] = "ccsrgemm2_bufferSizeExt(size_t handle, int m, int n, int k, size_t alpha, size_t descrA, int nnzA, size_t csrRowPtrA, size_t csrColIndA, size_t descrB, int nnzB, size_t csrRowPtrB, size_t csrColIndB, size_t beta, size_t descrD, int nnzD, size_t csrRowPtrD, size_t csrColIndD, size_t info) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_107ccsrgemm2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrD;
  int __pyx_v_nnzD;
  size_t __pyx_v_csrRowPtrD;
  size_t __pyx_v_csrColIndD;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrgemm2_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_beta,&__pyx_n_s_descrD,&__pyx_n_s_nnzD,&__pyx_n_s_csrRowPtrD,&__pyx_n_s_csrColIndD,&__pyx_n_s_info,0};
    PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 1); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 2); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 3); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 4); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 5); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 6); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 7); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 8); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 9); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 10); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 11); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 12); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 13); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 14); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 15); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 16); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 17); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, 18); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsrgemm2_bufferSizeExt") < 0)) __PYX_ERR(0, 2017, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 19) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2018, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2018, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2018, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2018, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2019, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2020, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2020, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2020, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2020, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2021, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2021, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2021, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2021, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2022, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2023, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2023, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2023, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2023, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2024, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrgemm2_bufferSizeExt", 1, 19, 19, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2017, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_106ccsrgemm2_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_beta, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_106ccsrgemm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrgemm2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_ccsrgemm2_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_beta, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2037
 *     return bufferSize
 * 
 * cpdef size_t zcsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k,
 *         size_t alpha,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_109zcsrgemm2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_zcsrgemm2_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSize;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrgemm2_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":2046
 *         size_t info):
 *     cdef size_t bufferSize
 *     status = cusparseZcsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, k,
 *         <cuDoubleComplex*>alpha,
 */
  __pyx_v_status = cusparseZcsrgemm2_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_k, ((cuDoubleComplex *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), __pyx_v_nnzA, ((int *)__pyx_v_csrRowPtrA), ((int *)__pyx_v_csrColIndA), ((cusparseMatDescr_t)__pyx_v_descrB), __pyx_v_nnzB, ((int *)__pyx_v_csrRowPtrB), ((int *)__pyx_v_csrColIndB), ((cuDoubleComplex *)__pyx_v_beta), ((cusparseMatDescr_t)__pyx_v_descrD), __pyx_v_nnzD, ((int *)__pyx_v_csrRowPtrD), ((int *)__pyx_v_csrColIndD), ((csrgemm2Info_t)__pyx_v_info), (&__pyx_v_bufferSize));

  /* "cupy/cuda/cusparse.pyx":2054
 *         <MatDescr>descrD, nnzD, <int*>csrRowPtrD, <int*>csrColIndD,
 *         <csrgemm2Info_t>info, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2055
 *         <csrgemm2Info_t>info, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef xcsrgemm2Nnz(
 */
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2037
 *     return bufferSize
 * 
 * cpdef size_t zcsrgemm2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k,
 *         size_t alpha,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.zcsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_109zcsrgemm2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_108zcsrgemm2_bufferSizeExt[] = "zcsrgemm2_bufferSizeExt(size_t handle, int m, int n, int k, size_t alpha, size_t descrA, int nnzA, size_t csrRowPtrA, size_t csrColIndA, size_t descrB, int nnzB, size_t csrRowPtrB, size_t csrColIndB, size_t beta, size_t descrD, int nnzD, size_t csrRowPtrD, size_t csrColIndD, size_t info) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_109zcsrgemm2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrD;
  int __pyx_v_nnzD;
  size_t __pyx_v_csrRowPtrD;
  size_t __pyx_v_csrColIndD;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrgemm2_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_beta,&__pyx_n_s_descrD,&__pyx_n_s_nnzD,&__pyx_n_s_csrRowPtrD,&__pyx_n_s_csrColIndD,&__pyx_n_s_info,0};
    PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 1); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 2); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 3); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 4); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 5); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 6); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 7); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 8); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 9); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 10); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 11); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 12); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 13); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 14); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 15); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 16); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 17); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, 18); __PYX_ERR(0, 2037, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsrgemm2_bufferSizeExt") < 0)) __PYX_ERR(0, 2037, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 19) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2038, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2038, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2038, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2038, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2039, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2040, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2040, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2040, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2040, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2041, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2041, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2041, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2041, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2042, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2043, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2043, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2043, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2043, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2044, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrgemm2_bufferSizeExt", 1, 19, 19, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2037, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_108zcsrgemm2_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_beta, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_108zcsrgemm2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrgemm2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_zcsrgemm2_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_beta, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrgemm2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2057
 *     return bufferSize
 * 
 * cpdef xcsrgemm2Nnz(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k,
 *         size_t descrA, int nnzA, size_t csrRowPtrA, size_t csrColIndA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_111xcsrgemm2Nnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcsrgemm2Nnz(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_descrC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_nnzTotalDevHostPtr, size_t __pyx_v_info, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsrgemm2Nnz", 0);

  /* "cupy/cuda/cusparse.pyx":2064
 *         size_t descrC, size_t csrRowPtrC,
 *         size_t nnzTotalDevHostPtr, size_t info, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseXcsrgemm2Nnz(
 *         <Handle>handle, m, n, k,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2065
 *         size_t nnzTotalDevHostPtr, size_t info, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseXcsrgemm2Nnz(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, k,
 *         <MatDescr>descrA, nnzA, <int*>csrRowPtrA, <int*>csrColIndA,
 */
  __pyx_v_status = cusparseXcsrgemm2Nnz(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_k, ((cusparseMatDescr_t)__pyx_v_descrA), __pyx_v_nnzA, ((int *)__pyx_v_csrRowPtrA), ((int *)__pyx_v_csrColIndA), ((cusparseMatDescr_t)__pyx_v_descrB), __pyx_v_nnzB, ((int *)__pyx_v_csrRowPtrB), ((int *)__pyx_v_csrColIndB), ((cusparseMatDescr_t)__pyx_v_descrD), __pyx_v_nnzD, ((int *)__pyx_v_csrRowPtrD), ((int *)__pyx_v_csrColIndD), ((cusparseMatDescr_t)__pyx_v_descrC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_nnzTotalDevHostPtr), ((csrgemm2Info_t)__pyx_v_info), ((void *)__pyx_v_pBuffer));

  /* "cupy/cuda/cusparse.pyx":2072
 *         <MatDescr>descrC, <int*>csrRowPtrC,
 *         <int*>nnzTotalDevHostPtr, <csrgemm2Info_t>info, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef scsrgemm2(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2057
 *     return bufferSize
 * 
 * cpdef xcsrgemm2Nnz(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k,
 *         size_t descrA, int nnzA, size_t csrRowPtrA, size_t csrColIndA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrgemm2Nnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_111xcsrgemm2Nnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_110xcsrgemm2Nnz[] = "xcsrgemm2Nnz(size_t handle, int m, int n, int k, size_t descrA, int nnzA, size_t csrRowPtrA, size_t csrColIndA, size_t descrB, int nnzB, size_t csrRowPtrB, size_t csrColIndB, size_t descrD, int nnzD, size_t csrRowPtrD, size_t csrColIndD, size_t descrC, size_t csrRowPtrC, size_t nnzTotalDevHostPtr, size_t info, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_111xcsrgemm2Nnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_descrD;
  int __pyx_v_nnzD;
  size_t __pyx_v_csrRowPtrD;
  size_t __pyx_v_csrColIndD;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_nnzTotalDevHostPtr;
  size_t __pyx_v_info;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsrgemm2Nnz (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_descrD,&__pyx_n_s_nnzD,&__pyx_n_s_csrRowPtrD,&__pyx_n_s_csrColIndD,&__pyx_n_s_descrC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_nnzTotalDevHostPtr,&__pyx_n_s_info,&__pyx_n_s_pBuffer,0};
    PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
        CYTHON_FALLTHROUGH;
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        CYTHON_FALLTHROUGH;
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 1); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 2); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 3); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 4); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 5); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 6); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 7); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 8); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 9); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 10); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 11); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 12); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 13); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 14); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 15); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 16); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 17); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzTotalDevHostPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 18); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 19:
        if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 19); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 20:
        if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, 20); __PYX_ERR(0, 2057, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xcsrgemm2Nnz") < 0)) __PYX_ERR(0, 2057, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 21) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
      values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
      values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2058, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2058, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2058, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2058, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2059, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2059, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2059, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2059, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2060, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2060, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2060, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2060, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2061, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2061, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2061, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2061, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2062, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[17]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2062, __pyx_L3_error)
    __pyx_v_nnzTotalDevHostPtr = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_nnzTotalDevHostPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2063, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[19]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2063, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[20]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2063, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsrgemm2Nnz", 1, 21, 21, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2057, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrgemm2Nnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_110xcsrgemm2Nnz(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_descrC, __pyx_v_csrRowPtrC, __pyx_v_nnzTotalDevHostPtr, __pyx_v_info, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_110xcsrgemm2Nnz(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_descrC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_nnzTotalDevHostPtr, size_t __pyx_v_info, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsrgemm2Nnz", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_xcsrgemm2Nnz(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_descrC, __pyx_v_csrRowPtrC, __pyx_v_nnzTotalDevHostPtr, __pyx_v_info, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrgemm2Nnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2074
 *     check_status(status)
 * 
 * cpdef scsrgemm2(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_113scsrgemm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrgemm2(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrValD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_info, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrgemm2", 0);

  /* "cupy/cuda/cusparse.pyx":2082
 *         size_t csrValC, size_t csrRowPtrC, size_t csrColIndC, size_t info,
 *         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseScsrgemm2(
 *         <Handle>handle, m, n, k, <float*>alpha, <MatDescr>descrA, nnzA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2083
 *         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseScsrgemm2(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, k, <float*>alpha, <MatDescr>descrA, nnzA,
 *         <float*>csrValA, <int*>csrRowPtrA, <int*>csrColIndA, <MatDescr>descrB,
 */
  __pyx_v_status = cusparseScsrgemm2(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_k, ((float *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), __pyx_v_nnzA, ((float *)__pyx_v_csrValA), ((int *)__pyx_v_csrRowPtrA), ((int *)__pyx_v_csrColIndA), ((cusparseMatDescr_t)__pyx_v_descrB), __pyx_v_nnzB, ((float *)__pyx_v_csrValB), ((int *)__pyx_v_csrRowPtrB), ((int *)__pyx_v_csrColIndB), ((float *)__pyx_v_beta), ((cusparseMatDescr_t)__pyx_v_descrD), __pyx_v_nnzD, ((float *)__pyx_v_csrValD), ((int *)__pyx_v_csrRowPtrD), ((int *)__pyx_v_csrColIndD), ((cusparseMatDescr_t)__pyx_v_descrC), ((float *)__pyx_v_csrValC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC), ((csrgemm2Info_t)__pyx_v_info), ((void *)__pyx_v_pBuffer));

  /* "cupy/cuda/cusparse.pyx":2091
 *         <int*>csrRowPtrC, <int*>csrColIndC, <csrgemm2Info_t>info,
 *         <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dcsrgemm2(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2074
 *     check_status(status)
 * 
 * cpdef scsrgemm2(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_113scsrgemm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_112scsrgemm2[] = "scsrgemm2(size_t handle, int m, int n, int k, size_t alpha, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t beta, size_t descrD, int nnzD, size_t csrValD, size_t csrRowPtrD, size_t csrColIndD, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC, size_t info, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_113scsrgemm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrD;
  int __pyx_v_nnzD;
  size_t __pyx_v_csrValD;
  size_t __pyx_v_csrRowPtrD;
  size_t __pyx_v_csrColIndD;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  size_t __pyx_v_info;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrgemm2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_beta,&__pyx_n_s_descrD,&__pyx_n_s_nnzD,&__pyx_n_s_csrValD,&__pyx_n_s_csrRowPtrD,&__pyx_n_s_csrColIndD,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,&__pyx_n_s_info,&__pyx_n_s_pBuffer,0};
    PyObject* values[27] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
        CYTHON_FALLTHROUGH;
        case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
        CYTHON_FALLTHROUGH;
        case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
        CYTHON_FALLTHROUGH;
        case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
        CYTHON_FALLTHROUGH;
        case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
        CYTHON_FALLTHROUGH;
        case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
        CYTHON_FALLTHROUGH;
        case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
        CYTHON_FALLTHROUGH;
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        CYTHON_FALLTHROUGH;
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 1); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 2); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 3); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 4); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 5); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 6); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 7); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 8); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 9); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 10); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 11); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 12); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 13); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 14); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 15); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 16); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 17); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 18); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 19:
        if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 19); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 20:
        if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 20); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 21:
        if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 21); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 22:
        if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 22); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 23:
        if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 23); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 24:
        if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 24); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 25:
        if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 25); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 26:
        if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, 26); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsrgemm2") < 0)) __PYX_ERR(0, 2074, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 27) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
      values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
      values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
      values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
      values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
      values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
      values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
      values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
      values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2075, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2075, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2075, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2075, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2075, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2075, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2076, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2076, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2076, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2076, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2077, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2077, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2077, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2077, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2078, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2078, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2078, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyInt_As_int(values[17]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2078, __pyx_L3_error)
    __pyx_v_csrValD = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrValD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2079, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyInt_As_size_t(values[19]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2079, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyInt_As_size_t(values[20]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2079, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[21]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2079, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[22]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2080, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[23]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2080, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[24]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2080, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[25]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2080, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[26]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2081, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrgemm2", 1, 27, 27, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2074, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_112scsrgemm2(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_beta, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrValD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, __pyx_v_info, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_112scsrgemm2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrValD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_info, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrgemm2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_scsrgemm2(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_beta, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrValD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, __pyx_v_info, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2093
 *     check_status(status)
 * 
 * cpdef dcsrgemm2(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_115dcsrgemm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrgemm2(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrValD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_info, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrgemm2", 0);

  /* "cupy/cuda/cusparse.pyx":2101
 *         size_t csrValC, size_t csrRowPtrC, size_t csrColIndC, size_t info,
 *         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDcsrgemm2(
 *         <Handle>handle, m, n, k, <double*>alpha, <MatDescr>descrA, nnzA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2102
 *         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDcsrgemm2(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, k, <double*>alpha, <MatDescr>descrA, nnzA,
 *         <double*>csrValA, <int*>csrRowPtrA, <int*>csrColIndA, <MatDescr>descrB,
 */
  __pyx_v_status = cusparseDcsrgemm2(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_k, ((double *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), __pyx_v_nnzA, ((double *)__pyx_v_csrValA), ((int *)__pyx_v_csrRowPtrA), ((int *)__pyx_v_csrColIndA), ((cusparseMatDescr_t)__pyx_v_descrB), __pyx_v_nnzB, ((double *)__pyx_v_csrValB), ((int *)__pyx_v_csrRowPtrB), ((int *)__pyx_v_csrColIndB), ((double *)__pyx_v_beta), ((cusparseMatDescr_t)__pyx_v_descrD), __pyx_v_nnzD, ((double *)__pyx_v_csrValD), ((int *)__pyx_v_csrRowPtrD), ((int *)__pyx_v_csrColIndD), ((cusparseMatDescr_t)__pyx_v_descrC), ((double *)__pyx_v_csrValC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC), ((csrgemm2Info_t)__pyx_v_info), ((void *)__pyx_v_pBuffer));

  /* "cupy/cuda/cusparse.pyx":2110
 *         <int*>csrRowPtrC, <int*>csrColIndC, <csrgemm2Info_t>info,
 *         <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef ccsrgemm2(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2093
 *     check_status(status)
 * 
 * cpdef dcsrgemm2(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_115dcsrgemm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_114dcsrgemm2[] = "dcsrgemm2(size_t handle, int m, int n, int k, size_t alpha, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t beta, size_t descrD, int nnzD, size_t csrValD, size_t csrRowPtrD, size_t csrColIndD, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC, size_t info, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_115dcsrgemm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrD;
  int __pyx_v_nnzD;
  size_t __pyx_v_csrValD;
  size_t __pyx_v_csrRowPtrD;
  size_t __pyx_v_csrColIndD;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  size_t __pyx_v_info;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrgemm2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_beta,&__pyx_n_s_descrD,&__pyx_n_s_nnzD,&__pyx_n_s_csrValD,&__pyx_n_s_csrRowPtrD,&__pyx_n_s_csrColIndD,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,&__pyx_n_s_info,&__pyx_n_s_pBuffer,0};
    PyObject* values[27] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
        CYTHON_FALLTHROUGH;
        case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
        CYTHON_FALLTHROUGH;
        case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
        CYTHON_FALLTHROUGH;
        case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
        CYTHON_FALLTHROUGH;
        case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
        CYTHON_FALLTHROUGH;
        case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
        CYTHON_FALLTHROUGH;
        case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
        CYTHON_FALLTHROUGH;
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        CYTHON_FALLTHROUGH;
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 1); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 2); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 3); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 4); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 5); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 6); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 7); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 8); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 9); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 10); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 11); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 12); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 13); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 14); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 15); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 16); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 17); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 18); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 19:
        if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 19); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 20:
        if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 20); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 21:
        if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 21); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 22:
        if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 22); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 23:
        if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 23); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 24:
        if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 24); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 25:
        if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 25); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 26:
        if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, 26); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsrgemm2") < 0)) __PYX_ERR(0, 2093, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 27) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
      values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
      values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
      values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
      values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
      values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
      values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
      values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
      values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2094, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2094, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2094, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2094, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2094, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2094, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2095, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2095, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2095, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2095, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2096, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2096, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2096, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2096, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2097, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2097, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2097, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyInt_As_int(values[17]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2097, __pyx_L3_error)
    __pyx_v_csrValD = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrValD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2098, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyInt_As_size_t(values[19]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2098, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyInt_As_size_t(values[20]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2098, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[21]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2098, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[22]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2099, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[23]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2099, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[24]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2099, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[25]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2099, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[26]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2100, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrgemm2", 1, 27, 27, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2093, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_114dcsrgemm2(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_beta, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrValD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, __pyx_v_info, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_114dcsrgemm2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrValD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_info, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrgemm2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dcsrgemm2(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_beta, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrValD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, __pyx_v_info, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2112
 *     check_status(status)
 * 
 * cpdef ccsrgemm2(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_117ccsrgemm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrgemm2(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrValD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_info, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrgemm2", 0);

  /* "cupy/cuda/cusparse.pyx":2120
 *         size_t csrValC, size_t csrRowPtrC, size_t csrColIndC, size_t info,
 *         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCcsrgemm2(
 *         <Handle>handle, m, n, k, <cuComplex*>alpha, <MatDescr>descrA, nnzA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2121
 *         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCcsrgemm2(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, k, <cuComplex*>alpha, <MatDescr>descrA, nnzA,
 *         <cuComplex*>csrValA, <int*>csrRowPtrA, <int*>csrColIndA,
 */
  __pyx_v_status = cusparseCcsrgemm2(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_k, ((cuComplex *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), __pyx_v_nnzA, ((cuComplex *)__pyx_v_csrValA), ((int *)__pyx_v_csrRowPtrA), ((int *)__pyx_v_csrColIndA), ((cusparseMatDescr_t)__pyx_v_descrB), __pyx_v_nnzB, ((cuComplex *)__pyx_v_csrValB), ((int *)__pyx_v_csrRowPtrB), ((int *)__pyx_v_csrColIndB), ((cuComplex *)__pyx_v_beta), ((cusparseMatDescr_t)__pyx_v_descrD), __pyx_v_nnzD, ((cuComplex *)__pyx_v_csrValD), ((int *)__pyx_v_csrRowPtrD), ((int *)__pyx_v_csrColIndD), ((cusparseMatDescr_t)__pyx_v_descrC), ((cuComplex *)__pyx_v_csrValC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC), ((csrgemm2Info_t)__pyx_v_info), ((void *)__pyx_v_pBuffer));

  /* "cupy/cuda/cusparse.pyx":2129
 *         <MatDescr>descrC, <cuComplex*>csrValC, <int*>csrRowPtrC,
 *         <int*>csrColIndC, <csrgemm2Info_t>info, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zcsrgemm2(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2112
 *     check_status(status)
 * 
 * cpdef ccsrgemm2(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_117ccsrgemm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_116ccsrgemm2[] = "ccsrgemm2(size_t handle, int m, int n, int k, size_t alpha, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t beta, size_t descrD, int nnzD, size_t csrValD, size_t csrRowPtrD, size_t csrColIndD, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC, size_t info, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_117ccsrgemm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrD;
  int __pyx_v_nnzD;
  size_t __pyx_v_csrValD;
  size_t __pyx_v_csrRowPtrD;
  size_t __pyx_v_csrColIndD;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  size_t __pyx_v_info;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrgemm2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_beta,&__pyx_n_s_descrD,&__pyx_n_s_nnzD,&__pyx_n_s_csrValD,&__pyx_n_s_csrRowPtrD,&__pyx_n_s_csrColIndD,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,&__pyx_n_s_info,&__pyx_n_s_pBuffer,0};
    PyObject* values[27] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
        CYTHON_FALLTHROUGH;
        case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
        CYTHON_FALLTHROUGH;
        case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
        CYTHON_FALLTHROUGH;
        case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
        CYTHON_FALLTHROUGH;
        case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
        CYTHON_FALLTHROUGH;
        case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
        CYTHON_FALLTHROUGH;
        case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
        CYTHON_FALLTHROUGH;
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        CYTHON_FALLTHROUGH;
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 1); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 2); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 3); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 4); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 5); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 6); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 7); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 8); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 9); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 10); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 11); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 12); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 13); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 14); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 15); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 16); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 17); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 18); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 19:
        if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 19); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 20:
        if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 20); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 21:
        if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 21); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 22:
        if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 22); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 23:
        if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 23); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 24:
        if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 24); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 25:
        if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 25); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 26:
        if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, 26); __PYX_ERR(0, 2112, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsrgemm2") < 0)) __PYX_ERR(0, 2112, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 27) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
      values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
      values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
      values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
      values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
      values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
      values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
      values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
      values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2113, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2113, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2113, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2113, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2113, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2113, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2114, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2114, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2114, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2114, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2115, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2115, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2115, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2115, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2116, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2116, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2116, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyInt_As_int(values[17]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2116, __pyx_L3_error)
    __pyx_v_csrValD = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrValD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2117, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyInt_As_size_t(values[19]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2117, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyInt_As_size_t(values[20]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2117, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[21]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2117, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[22]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2118, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[23]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2118, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[24]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2118, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[25]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2118, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[26]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2119, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrgemm2", 1, 27, 27, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2112, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_116ccsrgemm2(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_beta, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrValD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, __pyx_v_info, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_116ccsrgemm2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrValD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_info, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrgemm2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ccsrgemm2(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_beta, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrValD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, __pyx_v_info, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2131
 *     check_status(status)
 * 
 * cpdef zcsrgemm2(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_119zcsrgemm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrgemm2(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrValD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_info, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrgemm2", 0);

  /* "cupy/cuda/cusparse.pyx":2139
 *         size_t csrValC, size_t csrRowPtrC, size_t csrColIndC, size_t info,
 *         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZcsrgemm2(
 *         <Handle>handle, m, n, k, <cuDoubleComplex*>alpha, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2140
 *         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZcsrgemm2(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, k, <cuDoubleComplex*>alpha, <MatDescr>descrA,
 *         nnzA, <cuDoubleComplex*>csrValA, <int*>csrRowPtrA, <int*>csrColIndA,
 */
  __pyx_v_status = cusparseZcsrgemm2(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_k, ((cuDoubleComplex *)__pyx_v_alpha), ((cusparseMatDescr_t)__pyx_v_descrA), __pyx_v_nnzA, ((cuDoubleComplex *)__pyx_v_csrValA), ((int *)__pyx_v_csrRowPtrA), ((int *)__pyx_v_csrColIndA), ((cusparseMatDescr_t)__pyx_v_descrB), __pyx_v_nnzB, ((cuDoubleComplex *)__pyx_v_csrValB), ((int *)__pyx_v_csrRowPtrB), ((int *)__pyx_v_csrColIndB), ((cuDoubleComplex *)__pyx_v_beta), ((cusparseMatDescr_t)__pyx_v_descrD), __pyx_v_nnzD, ((cuDoubleComplex *)__pyx_v_csrValD), ((int *)__pyx_v_csrRowPtrD), ((int *)__pyx_v_csrColIndD), ((cusparseMatDescr_t)__pyx_v_descrC), ((cuDoubleComplex *)__pyx_v_csrValC), ((int *)__pyx_v_csrRowPtrC), ((int *)__pyx_v_csrColIndC), ((csrgemm2Info_t)__pyx_v_info), ((void *)__pyx_v_pBuffer));

  /* "cupy/cuda/cusparse.pyx":2148
 *         <MatDescr>descrC, <cuDoubleComplex*>csrValC, <int*>csrRowPtrC,
 *         <int*>csrColIndC, <csrgemm2Info_t>info, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ########################################
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2131
 *     check_status(status)
 * 
 * cpdef zcsrgemm2(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int k, size_t alpha, size_t descrA,
 *         int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_119zcsrgemm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_118zcsrgemm2[] = "zcsrgemm2(size_t handle, int m, int n, int k, size_t alpha, size_t descrA, int nnzA, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA, size_t descrB, int nnzB, size_t csrValB, size_t csrRowPtrB, size_t csrColIndB, size_t beta, size_t descrD, int nnzD, size_t csrValD, size_t csrRowPtrD, size_t csrColIndD, size_t descrC, size_t csrValC, size_t csrRowPtrC, size_t csrColIndC, size_t info, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_119zcsrgemm2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_k;
  size_t __pyx_v_alpha;
  size_t __pyx_v_descrA;
  int __pyx_v_nnzA;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  size_t __pyx_v_descrB;
  int __pyx_v_nnzB;
  size_t __pyx_v_csrValB;
  size_t __pyx_v_csrRowPtrB;
  size_t __pyx_v_csrColIndB;
  size_t __pyx_v_beta;
  size_t __pyx_v_descrD;
  int __pyx_v_nnzD;
  size_t __pyx_v_csrValD;
  size_t __pyx_v_csrRowPtrD;
  size_t __pyx_v_csrColIndD;
  size_t __pyx_v_descrC;
  size_t __pyx_v_csrValC;
  size_t __pyx_v_csrRowPtrC;
  size_t __pyx_v_csrColIndC;
  size_t __pyx_v_info;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrgemm2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_k,&__pyx_n_s_alpha,&__pyx_n_s_descrA,&__pyx_n_s_nnzA,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,&__pyx_n_s_descrB,&__pyx_n_s_nnzB,&__pyx_n_s_csrValB,&__pyx_n_s_csrRowPtrB,&__pyx_n_s_csrColIndB,&__pyx_n_s_beta,&__pyx_n_s_descrD,&__pyx_n_s_nnzD,&__pyx_n_s_csrValD,&__pyx_n_s_csrRowPtrD,&__pyx_n_s_csrColIndD,&__pyx_n_s_descrC,&__pyx_n_s_csrValC,&__pyx_n_s_csrRowPtrC,&__pyx_n_s_csrColIndC,&__pyx_n_s_info,&__pyx_n_s_pBuffer,0};
    PyObject* values[27] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
        CYTHON_FALLTHROUGH;
        case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
        CYTHON_FALLTHROUGH;
        case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
        CYTHON_FALLTHROUGH;
        case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
        CYTHON_FALLTHROUGH;
        case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
        CYTHON_FALLTHROUGH;
        case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
        CYTHON_FALLTHROUGH;
        case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
        CYTHON_FALLTHROUGH;
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        CYTHON_FALLTHROUGH;
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        CYTHON_FALLTHROUGH;
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        CYTHON_FALLTHROUGH;
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 1); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 2); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 3); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 4); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 5); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 6); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 7); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 8); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 9); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 10); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 11); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 12); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 13); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 14); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 15); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 16); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 17:
        if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 17); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 18:
        if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 18); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 19:
        if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 19); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 20:
        if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndD)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 20); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 21:
        if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 21); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 22:
        if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 22); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 23:
        if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 23); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 24:
        if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 24); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 25:
        if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 25); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 26:
        if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, 26); __PYX_ERR(0, 2131, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsrgemm2") < 0)) __PYX_ERR(0, 2131, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 27) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
      values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
      values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
      values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
      values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
      values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
      values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
      values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
      values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
      values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
      values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
      values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
      values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2132, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2132, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2132, __pyx_L3_error)
    __pyx_v_k = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2132, __pyx_L3_error)
    __pyx_v_alpha = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_alpha == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2132, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2132, __pyx_L3_error)
    __pyx_v_nnzA = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_nnzA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2133, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2133, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2133, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2133, __pyx_L3_error)
    __pyx_v_descrB = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_descrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2134, __pyx_L3_error)
    __pyx_v_nnzB = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nnzB == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2134, __pyx_L3_error)
    __pyx_v_csrValB = __Pyx_PyInt_As_size_t(values[12]); if (unlikely((__pyx_v_csrValB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2134, __pyx_L3_error)
    __pyx_v_csrRowPtrB = __Pyx_PyInt_As_size_t(values[13]); if (unlikely((__pyx_v_csrRowPtrB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2134, __pyx_L3_error)
    __pyx_v_csrColIndB = __Pyx_PyInt_As_size_t(values[14]); if (unlikely((__pyx_v_csrColIndB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2135, __pyx_L3_error)
    __pyx_v_beta = __Pyx_PyInt_As_size_t(values[15]); if (unlikely((__pyx_v_beta == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2135, __pyx_L3_error)
    __pyx_v_descrD = __Pyx_PyInt_As_size_t(values[16]); if (unlikely((__pyx_v_descrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2135, __pyx_L3_error)
    __pyx_v_nnzD = __Pyx_PyInt_As_int(values[17]); if (unlikely((__pyx_v_nnzD == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2135, __pyx_L3_error)
    __pyx_v_csrValD = __Pyx_PyInt_As_size_t(values[18]); if (unlikely((__pyx_v_csrValD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2136, __pyx_L3_error)
    __pyx_v_csrRowPtrD = __Pyx_PyInt_As_size_t(values[19]); if (unlikely((__pyx_v_csrRowPtrD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2136, __pyx_L3_error)
    __pyx_v_csrColIndD = __Pyx_PyInt_As_size_t(values[20]); if (unlikely((__pyx_v_csrColIndD == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2136, __pyx_L3_error)
    __pyx_v_descrC = __Pyx_PyInt_As_size_t(values[21]); if (unlikely((__pyx_v_descrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2136, __pyx_L3_error)
    __pyx_v_csrValC = __Pyx_PyInt_As_size_t(values[22]); if (unlikely((__pyx_v_csrValC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2137, __pyx_L3_error)
    __pyx_v_csrRowPtrC = __Pyx_PyInt_As_size_t(values[23]); if (unlikely((__pyx_v_csrRowPtrC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2137, __pyx_L3_error)
    __pyx_v_csrColIndC = __Pyx_PyInt_As_size_t(values[24]); if (unlikely((__pyx_v_csrColIndC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2137, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[25]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2137, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[26]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2138, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrgemm2", 1, 27, 27, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2131, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_118zcsrgemm2(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_beta, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrValD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, __pyx_v_info, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_118zcsrgemm2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, size_t __pyx_v_alpha, size_t __pyx_v_descrA, int __pyx_v_nnzA, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, size_t __pyx_v_descrB, int __pyx_v_nnzB, size_t __pyx_v_csrValB, size_t __pyx_v_csrRowPtrB, size_t __pyx_v_csrColIndB, size_t __pyx_v_beta, size_t __pyx_v_descrD, int __pyx_v_nnzD, size_t __pyx_v_csrValD, size_t __pyx_v_csrRowPtrD, size_t __pyx_v_csrColIndD, size_t __pyx_v_descrC, size_t __pyx_v_csrValC, size_t __pyx_v_csrRowPtrC, size_t __pyx_v_csrColIndC, size_t __pyx_v_info, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrgemm2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zcsrgemm2(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_k, __pyx_v_alpha, __pyx_v_descrA, __pyx_v_nnzA, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, __pyx_v_descrB, __pyx_v_nnzB, __pyx_v_csrValB, __pyx_v_csrRowPtrB, __pyx_v_csrColIndB, __pyx_v_beta, __pyx_v_descrD, __pyx_v_nnzD, __pyx_v_csrValD, __pyx_v_csrRowPtrD, __pyx_v_csrColIndD, __pyx_v_descrC, __pyx_v_csrValC, __pyx_v_csrRowPtrC, __pyx_v_csrColIndC, __pyx_v_info, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrgemm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2153
 * # cuSPARSE Format Convrsion
 * 
 * cpdef xcoo2csr(             # <<<<<<<<<<<<<<
 *         size_t handle, size_t cooRowInd, int nnz, int m, size_t csrRowPtr,
 *         int idxBase):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_121xcoo2csr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcoo2csr(size_t __pyx_v_handle, size_t __pyx_v_cooRowInd, int __pyx_v_nnz, int __pyx_v_m, size_t __pyx_v_csrRowPtr, int __pyx_v_idxBase, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcoo2csr", 0);

  /* "cupy/cuda/cusparse.pyx":2156
 *         size_t handle, size_t cooRowInd, int nnz, int m, size_t csrRowPtr,
 *         int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseXcoo2csr(
 *         <Handle>handle, <const int *>cooRowInd, nnz, m, <int *>csrRowPtr,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2157
 *         int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseXcoo2csr(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <const int *>cooRowInd, nnz, m, <int *>csrRowPtr,
 *         <IndexBase>idxBase)
 */
  __pyx_v_status = cusparseXcoo2csr(((cusparseHandle_t)__pyx_v_handle), ((int const *)__pyx_v_cooRowInd), __pyx_v_nnz, __pyx_v_m, ((int *)__pyx_v_csrRowPtr), ((cusparseIndexBase_t)__pyx_v_idxBase));

  /* "cupy/cuda/cusparse.pyx":2160
 *         <Handle>handle, <const int *>cooRowInd, nnz, m, <int *>csrRowPtr,
 *         <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2153
 * # cuSPARSE Format Convrsion
 * 
 * cpdef xcoo2csr(             # <<<<<<<<<<<<<<
 *         size_t handle, size_t cooRowInd, int nnz, int m, size_t csrRowPtr,
 *         int idxBase):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcoo2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_121xcoo2csr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_120xcoo2csr[] = "xcoo2csr(size_t handle, size_t cooRowInd, int nnz, int m, size_t csrRowPtr, int idxBase)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_121xcoo2csr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  size_t __pyx_v_cooRowInd;
  int __pyx_v_nnz;
  int __pyx_v_m;
  size_t __pyx_v_csrRowPtr;
  int __pyx_v_idxBase;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcoo2csr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_cooRowInd,&__pyx_n_s_nnz,&__pyx_n_s_m,&__pyx_n_s_csrRowPtr,&__pyx_n_s_idxBase,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cooRowInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoo2csr", 1, 6, 6, 1); __PYX_ERR(0, 2153, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoo2csr", 1, 6, 6, 2); __PYX_ERR(0, 2153, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoo2csr", 1, 6, 6, 3); __PYX_ERR(0, 2153, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoo2csr", 1, 6, 6, 4); __PYX_ERR(0, 2153, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoo2csr", 1, 6, 6, 5); __PYX_ERR(0, 2153, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xcoo2csr") < 0)) __PYX_ERR(0, 2153, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2154, __pyx_L3_error)
    __pyx_v_cooRowInd = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_cooRowInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2154, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2154, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2154, __pyx_L3_error)
    __pyx_v_csrRowPtr = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2154, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2155, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcoo2csr", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2153, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcoo2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_120xcoo2csr(__pyx_self, __pyx_v_handle, __pyx_v_cooRowInd, __pyx_v_nnz, __pyx_v_m, __pyx_v_csrRowPtr, __pyx_v_idxBase);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_120xcoo2csr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_cooRowInd, int __pyx_v_nnz, int __pyx_v_m, size_t __pyx_v_csrRowPtr, int __pyx_v_idxBase) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcoo2csr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_xcoo2csr(__pyx_v_handle, __pyx_v_cooRowInd, __pyx_v_nnz, __pyx_v_m, __pyx_v_csrRowPtr, __pyx_v_idxBase, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcoo2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2163
 * 
 * 
 * cpdef scsc2dense(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_123scsc2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsc2dense(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_cscSortedValA, size_t __pyx_v_cscSortedRowIndA, size_t __pyx_v_cscSortedColPtrA, size_t __pyx_v_A, int __pyx_v_lda, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsc2dense", 0);

  /* "cupy/cuda/cusparse.pyx":2167
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
 *         size_t cscSortedColPtrA, size_t A, int lda):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseScsc2dense(
 *         <Handle>handle, m, n, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2168
 *         size_t cscSortedColPtrA, size_t A, int lda):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseScsc2dense(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <MatDescr>descrA,
 *         <const float *>cscSortedValA, <const int *>cscSortedRowIndA,
 */
  __pyx_v_status = cusparseScsc2dense(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t)__pyx_v_descrA), ((float const *)__pyx_v_cscSortedValA), ((int const *)__pyx_v_cscSortedRowIndA), ((int const *)__pyx_v_cscSortedColPtrA), ((float *)__pyx_v_A), __pyx_v_lda);

  /* "cupy/cuda/cusparse.pyx":2172
 *         <const float *>cscSortedValA, <const int *>cscSortedRowIndA,
 *         <const int *>cscSortedColPtrA, <float *>A, lda)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2163
 * 
 * 
 * cpdef scsc2dense(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_123scsc2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_122scsc2dense[] = "scsc2dense(size_t handle, int m, int n, size_t descrA, size_t cscSortedValA, size_t cscSortedRowIndA, size_t cscSortedColPtrA, size_t A, int lda)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_123scsc2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_cscSortedValA;
  size_t __pyx_v_cscSortedRowIndA;
  size_t __pyx_v_cscSortedColPtrA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsc2dense (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_cscSortedValA,&__pyx_n_s_cscSortedRowIndA,&__pyx_n_s_cscSortedColPtrA,&__pyx_n_s_A,&__pyx_n_s_lda,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsc2dense", 1, 9, 9, 1); __PYX_ERR(0, 2163, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsc2dense", 1, 9, 9, 2); __PYX_ERR(0, 2163, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsc2dense", 1, 9, 9, 3); __PYX_ERR(0, 2163, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsc2dense", 1, 9, 9, 4); __PYX_ERR(0, 2163, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscSortedRowIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsc2dense", 1, 9, 9, 5); __PYX_ERR(0, 2163, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscSortedColPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsc2dense", 1, 9, 9, 6); __PYX_ERR(0, 2163, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsc2dense", 1, 9, 9, 7); __PYX_ERR(0, 2163, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsc2dense", 1, 9, 9, 8); __PYX_ERR(0, 2163, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsc2dense") < 0)) __PYX_ERR(0, 2163, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2164, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2164, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2164, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2164, __pyx_L3_error)
    __pyx_v_cscSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_cscSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2165, __pyx_L3_error)
    __pyx_v_cscSortedRowIndA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_cscSortedRowIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2165, __pyx_L3_error)
    __pyx_v_cscSortedColPtrA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_cscSortedColPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2166, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2166, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2166, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsc2dense", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2163, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_122scsc2dense(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_cscSortedValA, __pyx_v_cscSortedRowIndA, __pyx_v_cscSortedColPtrA, __pyx_v_A, __pyx_v_lda);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_122scsc2dense(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_cscSortedValA, size_t __pyx_v_cscSortedRowIndA, size_t __pyx_v_cscSortedColPtrA, size_t __pyx_v_A, int __pyx_v_lda) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsc2dense", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_scsc2dense(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_cscSortedValA, __pyx_v_cscSortedRowIndA, __pyx_v_cscSortedColPtrA, __pyx_v_A, __pyx_v_lda, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2175
 * 
 * 
 * cpdef dcsc2dense(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_125dcsc2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsc2dense(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_cscSortedValA, size_t __pyx_v_cscSortedRowIndA, size_t __pyx_v_cscSortedColPtrA, size_t __pyx_v_A, int __pyx_v_lda, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsc2dense", 0);

  /* "cupy/cuda/cusparse.pyx":2179
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
 *         size_t cscSortedColPtrA, size_t A, int lda):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDcsc2dense(
 *         <Handle>handle, m, n, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2180
 *         size_t cscSortedColPtrA, size_t A, int lda):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDcsc2dense(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <MatDescr>descrA,
 *         <const double *>cscSortedValA, <const int *>cscSortedRowIndA,
 */
  __pyx_v_status = cusparseDcsc2dense(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t)__pyx_v_descrA), ((double const *)__pyx_v_cscSortedValA), ((int const *)__pyx_v_cscSortedRowIndA), ((int const *)__pyx_v_cscSortedColPtrA), ((double *)__pyx_v_A), __pyx_v_lda);

  /* "cupy/cuda/cusparse.pyx":2184
 *         <const double *>cscSortedValA, <const int *>cscSortedRowIndA,
 *         <const int *>cscSortedColPtrA, <double *>A, lda)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef ccsc2dense(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2175
 * 
 * 
 * cpdef dcsc2dense(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_125dcsc2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_124dcsc2dense[] = "dcsc2dense(size_t handle, int m, int n, size_t descrA, size_t cscSortedValA, size_t cscSortedRowIndA, size_t cscSortedColPtrA, size_t A, int lda)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_125dcsc2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_cscSortedValA;
  size_t __pyx_v_cscSortedRowIndA;
  size_t __pyx_v_cscSortedColPtrA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsc2dense (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_cscSortedValA,&__pyx_n_s_cscSortedRowIndA,&__pyx_n_s_cscSortedColPtrA,&__pyx_n_s_A,&__pyx_n_s_lda,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsc2dense", 1, 9, 9, 1); __PYX_ERR(0, 2175, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsc2dense", 1, 9, 9, 2); __PYX_ERR(0, 2175, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsc2dense", 1, 9, 9, 3); __PYX_ERR(0, 2175, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsc2dense", 1, 9, 9, 4); __PYX_ERR(0, 2175, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscSortedRowIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsc2dense", 1, 9, 9, 5); __PYX_ERR(0, 2175, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscSortedColPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsc2dense", 1, 9, 9, 6); __PYX_ERR(0, 2175, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsc2dense", 1, 9, 9, 7); __PYX_ERR(0, 2175, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsc2dense", 1, 9, 9, 8); __PYX_ERR(0, 2175, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsc2dense") < 0)) __PYX_ERR(0, 2175, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2176, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2176, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2176, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2176, __pyx_L3_error)
    __pyx_v_cscSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_cscSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2177, __pyx_L3_error)
    __pyx_v_cscSortedRowIndA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_cscSortedRowIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2177, __pyx_L3_error)
    __pyx_v_cscSortedColPtrA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_cscSortedColPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2178, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2178, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2178, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsc2dense", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2175, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_124dcsc2dense(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_cscSortedValA, __pyx_v_cscSortedRowIndA, __pyx_v_cscSortedColPtrA, __pyx_v_A, __pyx_v_lda);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_124dcsc2dense(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_cscSortedValA, size_t __pyx_v_cscSortedRowIndA, size_t __pyx_v_cscSortedColPtrA, size_t __pyx_v_A, int __pyx_v_lda) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsc2dense", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dcsc2dense(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_cscSortedValA, __pyx_v_cscSortedRowIndA, __pyx_v_cscSortedColPtrA, __pyx_v_A, __pyx_v_lda, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2186
 *     check_status(status)
 * 
 * cpdef ccsc2dense(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_127ccsc2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsc2dense(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_cscSortedValA, size_t __pyx_v_cscSortedRowIndA, size_t __pyx_v_cscSortedColPtrA, size_t __pyx_v_A, int __pyx_v_lda, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsc2dense", 0);

  /* "cupy/cuda/cusparse.pyx":2190
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
 *         size_t cscSortedColPtrA, size_t A, int lda):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCcsc2dense(
 *         <Handle>handle, m, n, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2191
 *         size_t cscSortedColPtrA, size_t A, int lda):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCcsc2dense(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <MatDescr>descrA,
 *         <const cuComplex *>cscSortedValA, <const int *>cscSortedRowIndA,
 */
  __pyx_v_status = cusparseCcsc2dense(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t)__pyx_v_descrA), ((cuComplex const *)__pyx_v_cscSortedValA), ((int const *)__pyx_v_cscSortedRowIndA), ((int const *)__pyx_v_cscSortedColPtrA), ((cuComplex *)__pyx_v_A), __pyx_v_lda);

  /* "cupy/cuda/cusparse.pyx":2195
 *         <const cuComplex *>cscSortedValA, <const int *>cscSortedRowIndA,
 *         <const int *>cscSortedColPtrA, <cuComplex *>A, lda)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zcsc2dense(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2186
 *     check_status(status)
 * 
 * cpdef ccsc2dense(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_127ccsc2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_126ccsc2dense[] = "ccsc2dense(size_t handle, int m, int n, size_t descrA, size_t cscSortedValA, size_t cscSortedRowIndA, size_t cscSortedColPtrA, size_t A, int lda)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_127ccsc2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_cscSortedValA;
  size_t __pyx_v_cscSortedRowIndA;
  size_t __pyx_v_cscSortedColPtrA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsc2dense (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_cscSortedValA,&__pyx_n_s_cscSortedRowIndA,&__pyx_n_s_cscSortedColPtrA,&__pyx_n_s_A,&__pyx_n_s_lda,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsc2dense", 1, 9, 9, 1); __PYX_ERR(0, 2186, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsc2dense", 1, 9, 9, 2); __PYX_ERR(0, 2186, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsc2dense", 1, 9, 9, 3); __PYX_ERR(0, 2186, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsc2dense", 1, 9, 9, 4); __PYX_ERR(0, 2186, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscSortedRowIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsc2dense", 1, 9, 9, 5); __PYX_ERR(0, 2186, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscSortedColPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsc2dense", 1, 9, 9, 6); __PYX_ERR(0, 2186, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsc2dense", 1, 9, 9, 7); __PYX_ERR(0, 2186, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsc2dense", 1, 9, 9, 8); __PYX_ERR(0, 2186, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsc2dense") < 0)) __PYX_ERR(0, 2186, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2187, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2187, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2187, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2187, __pyx_L3_error)
    __pyx_v_cscSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_cscSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2188, __pyx_L3_error)
    __pyx_v_cscSortedRowIndA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_cscSortedRowIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2188, __pyx_L3_error)
    __pyx_v_cscSortedColPtrA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_cscSortedColPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2189, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2189, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2189, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsc2dense", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2186, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_126ccsc2dense(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_cscSortedValA, __pyx_v_cscSortedRowIndA, __pyx_v_cscSortedColPtrA, __pyx_v_A, __pyx_v_lda);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_126ccsc2dense(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_cscSortedValA, size_t __pyx_v_cscSortedRowIndA, size_t __pyx_v_cscSortedColPtrA, size_t __pyx_v_A, int __pyx_v_lda) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsc2dense", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ccsc2dense(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_cscSortedValA, __pyx_v_cscSortedRowIndA, __pyx_v_cscSortedColPtrA, __pyx_v_A, __pyx_v_lda, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2197
 *     check_status(status)
 * 
 * cpdef zcsc2dense(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_129zcsc2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsc2dense(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_cscSortedValA, size_t __pyx_v_cscSortedRowIndA, size_t __pyx_v_cscSortedColPtrA, size_t __pyx_v_A, int __pyx_v_lda, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsc2dense", 0);

  /* "cupy/cuda/cusparse.pyx":2201
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
 *         size_t cscSortedColPtrA, size_t A, int lda):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZcsc2dense(
 *         <Handle>handle, m, n, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2202
 *         size_t cscSortedColPtrA, size_t A, int lda):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZcsc2dense(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <MatDescr>descrA,
 *         <const cuDoubleComplex *>cscSortedValA, <const int *>cscSortedRowIndA,
 */
  __pyx_v_status = cusparseZcsc2dense(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t)__pyx_v_descrA), ((cuDoubleComplex const *)__pyx_v_cscSortedValA), ((int const *)__pyx_v_cscSortedRowIndA), ((int const *)__pyx_v_cscSortedColPtrA), ((cuDoubleComplex *)__pyx_v_A), __pyx_v_lda);

  /* "cupy/cuda/cusparse.pyx":2206
 *         <const cuDoubleComplex *>cscSortedValA, <const int *>cscSortedRowIndA,
 *         <const int *>cscSortedColPtrA, <cuDoubleComplex *>A, lda)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef xcsr2coo(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2197
 *     check_status(status)
 * 
 * cpdef zcsc2dense(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t cscSortedValA, size_t cscSortedRowIndA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_129zcsc2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_128zcsc2dense[] = "zcsc2dense(size_t handle, int m, int n, size_t descrA, size_t cscSortedValA, size_t cscSortedRowIndA, size_t cscSortedColPtrA, size_t A, int lda)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_129zcsc2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_cscSortedValA;
  size_t __pyx_v_cscSortedRowIndA;
  size_t __pyx_v_cscSortedColPtrA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsc2dense (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_cscSortedValA,&__pyx_n_s_cscSortedRowIndA,&__pyx_n_s_cscSortedColPtrA,&__pyx_n_s_A,&__pyx_n_s_lda,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsc2dense", 1, 9, 9, 1); __PYX_ERR(0, 2197, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsc2dense", 1, 9, 9, 2); __PYX_ERR(0, 2197, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsc2dense", 1, 9, 9, 3); __PYX_ERR(0, 2197, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsc2dense", 1, 9, 9, 4); __PYX_ERR(0, 2197, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscSortedRowIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsc2dense", 1, 9, 9, 5); __PYX_ERR(0, 2197, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscSortedColPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsc2dense", 1, 9, 9, 6); __PYX_ERR(0, 2197, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsc2dense", 1, 9, 9, 7); __PYX_ERR(0, 2197, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsc2dense", 1, 9, 9, 8); __PYX_ERR(0, 2197, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsc2dense") < 0)) __PYX_ERR(0, 2197, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2198, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2198, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2198, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2198, __pyx_L3_error)
    __pyx_v_cscSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_cscSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2199, __pyx_L3_error)
    __pyx_v_cscSortedRowIndA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_cscSortedRowIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2199, __pyx_L3_error)
    __pyx_v_cscSortedColPtrA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_cscSortedColPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2200, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2200, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2200, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsc2dense", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2197, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_128zcsc2dense(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_cscSortedValA, __pyx_v_cscSortedRowIndA, __pyx_v_cscSortedColPtrA, __pyx_v_A, __pyx_v_lda);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_128zcsc2dense(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_cscSortedValA, size_t __pyx_v_cscSortedRowIndA, size_t __pyx_v_cscSortedColPtrA, size_t __pyx_v_A, int __pyx_v_lda) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsc2dense", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zcsc2dense(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_cscSortedValA, __pyx_v_cscSortedRowIndA, __pyx_v_cscSortedColPtrA, __pyx_v_A, __pyx_v_lda, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsc2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2208
 *     check_status(status)
 * 
 * cpdef xcsr2coo(             # <<<<<<<<<<<<<<
 *         size_t handle, size_t csrRowPtr, int nnz, int m, size_t cooRowInd,
 *         int idxBase):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_131xcsr2coo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcsr2coo(size_t __pyx_v_handle, size_t __pyx_v_csrRowPtr, int __pyx_v_nnz, int __pyx_v_m, size_t __pyx_v_cooRowInd, int __pyx_v_idxBase, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsr2coo", 0);

  /* "cupy/cuda/cusparse.pyx":2211
 *         size_t handle, size_t csrRowPtr, int nnz, int m, size_t cooRowInd,
 *         int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseXcsr2coo(
 *         <Handle>handle, <const int *>csrRowPtr, nnz, m, <int *>cooRowInd,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2212
 *         int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseXcsr2coo(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <const int *>csrRowPtr, nnz, m, <int *>cooRowInd,
 *         <IndexBase>idxBase)
 */
  __pyx_v_status = cusparseXcsr2coo(((cusparseHandle_t)__pyx_v_handle), ((int const *)__pyx_v_csrRowPtr), __pyx_v_nnz, __pyx_v_m, ((int *)__pyx_v_cooRowInd), ((cusparseIndexBase_t)__pyx_v_idxBase));

  /* "cupy/cuda/cusparse.pyx":2215
 *         <Handle>handle, <const int *>csrRowPtr, nnz, m, <int *>cooRowInd,
 *         <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2208
 *     check_status(status)
 * 
 * cpdef xcsr2coo(             # <<<<<<<<<<<<<<
 *         size_t handle, size_t csrRowPtr, int nnz, int m, size_t cooRowInd,
 *         int idxBase):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsr2coo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_131xcsr2coo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_130xcsr2coo[] = "xcsr2coo(size_t handle, size_t csrRowPtr, int nnz, int m, size_t cooRowInd, int idxBase)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_131xcsr2coo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  size_t __pyx_v_csrRowPtr;
  int __pyx_v_nnz;
  int __pyx_v_m;
  size_t __pyx_v_cooRowInd;
  int __pyx_v_idxBase;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsr2coo (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_csrRowPtr,&__pyx_n_s_nnz,&__pyx_n_s_m,&__pyx_n_s_cooRowInd,&__pyx_n_s_idxBase,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsr2coo", 1, 6, 6, 1); __PYX_ERR(0, 2208, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsr2coo", 1, 6, 6, 2); __PYX_ERR(0, 2208, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsr2coo", 1, 6, 6, 3); __PYX_ERR(0, 2208, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cooRowInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsr2coo", 1, 6, 6, 4); __PYX_ERR(0, 2208, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsr2coo", 1, 6, 6, 5); __PYX_ERR(0, 2208, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xcsr2coo") < 0)) __PYX_ERR(0, 2208, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2209, __pyx_L3_error)
    __pyx_v_csrRowPtr = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_csrRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2209, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2209, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2209, __pyx_L3_error)
    __pyx_v_cooRowInd = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_cooRowInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2209, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2210, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsr2coo", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2208, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsr2coo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_130xcsr2coo(__pyx_self, __pyx_v_handle, __pyx_v_csrRowPtr, __pyx_v_nnz, __pyx_v_m, __pyx_v_cooRowInd, __pyx_v_idxBase);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_130xcsr2coo(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_csrRowPtr, int __pyx_v_nnz, int __pyx_v_m, size_t __pyx_v_cooRowInd, int __pyx_v_idxBase) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsr2coo", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_xcsr2coo(__pyx_v_handle, __pyx_v_csrRowPtr, __pyx_v_nnz, __pyx_v_m, __pyx_v_cooRowInd, __pyx_v_idxBase, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsr2coo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2218
 * 
 * 
 * cpdef scsr2csc(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t csrVal,
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_133scsr2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsr2csc(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_csrVal, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd, size_t __pyx_v_cscVal, size_t __pyx_v_cscRowInd, size_t __pyx_v_cscColPtr, int __pyx_v_copyValues, int __pyx_v_idxBase, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsr2csc", 0);

  /* "cupy/cuda/cusparse.pyx":2222
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
 *         size_t cscRowInd, size_t cscColPtr, int copyValues, int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseScsr2csc(
 *         <Handle>handle, m, n, nnz, <const float *>csrVal,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2223
 *         size_t cscRowInd, size_t cscColPtr, int copyValues, int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseScsr2csc(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, nnz, <const float *>csrVal,
 *         <const int *>csrRowPtr, <const int *>csrColInd, <float *>cscVal,
 */
  __pyx_v_status = cusparseScsr2csc(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((float const *)__pyx_v_csrVal), ((int const *)__pyx_v_csrRowPtr), ((int const *)__pyx_v_csrColInd), ((float *)__pyx_v_cscVal), ((int *)__pyx_v_cscRowInd), ((int *)__pyx_v_cscColPtr), ((cusparseAction_t)__pyx_v_copyValues), ((cusparseIndexBase_t)__pyx_v_idxBase));

  /* "cupy/cuda/cusparse.pyx":2228
 *         <int *>cscRowInd, <int *>cscColPtr, <Action>copyValues,
 *         <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2218
 * 
 * 
 * cpdef scsr2csc(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t csrVal,
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_133scsr2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_132scsr2csc[] = "scsr2csc(size_t handle, int m, int n, int nnz, size_t csrVal, size_t csrRowPtr, size_t csrColInd, size_t cscVal, size_t cscRowInd, size_t cscColPtr, int copyValues, int idxBase)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_133scsr2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  size_t __pyx_v_csrVal;
  size_t __pyx_v_csrRowPtr;
  size_t __pyx_v_csrColInd;
  size_t __pyx_v_cscVal;
  size_t __pyx_v_cscRowInd;
  size_t __pyx_v_cscColPtr;
  int __pyx_v_copyValues;
  int __pyx_v_idxBase;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsr2csc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_csrVal,&__pyx_n_s_csrRowPtr,&__pyx_n_s_csrColInd,&__pyx_n_s_cscVal,&__pyx_n_s_cscRowInd,&__pyx_n_s_cscColPtr,&__pyx_n_s_copyValues,&__pyx_n_s_idxBase,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csc", 1, 12, 12, 1); __PYX_ERR(0, 2218, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csc", 1, 12, 12, 2); __PYX_ERR(0, 2218, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csc", 1, 12, 12, 3); __PYX_ERR(0, 2218, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csc", 1, 12, 12, 4); __PYX_ERR(0, 2218, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csc", 1, 12, 12, 5); __PYX_ERR(0, 2218, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csc", 1, 12, 12, 6); __PYX_ERR(0, 2218, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csc", 1, 12, 12, 7); __PYX_ERR(0, 2218, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscRowInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csc", 1, 12, 12, 8); __PYX_ERR(0, 2218, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscColPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csc", 1, 12, 12, 9); __PYX_ERR(0, 2218, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_copyValues)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csc", 1, 12, 12, 10); __PYX_ERR(0, 2218, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csc", 1, 12, 12, 11); __PYX_ERR(0, 2218, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsr2csc") < 0)) __PYX_ERR(0, 2218, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2219, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2219, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2219, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2219, __pyx_L3_error)
    __pyx_v_csrVal = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2219, __pyx_L3_error)
    __pyx_v_csrRowPtr = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2220, __pyx_L3_error)
    __pyx_v_csrColInd = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2220, __pyx_L3_error)
    __pyx_v_cscVal = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_cscVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2220, __pyx_L3_error)
    __pyx_v_cscRowInd = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_cscRowInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2221, __pyx_L3_error)
    __pyx_v_cscColPtr = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_cscColPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2221, __pyx_L3_error)
    __pyx_v_copyValues = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_copyValues == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2221, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2221, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsr2csc", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2218, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_132scsr2csc(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_csrVal, __pyx_v_csrRowPtr, __pyx_v_csrColInd, __pyx_v_cscVal, __pyx_v_cscRowInd, __pyx_v_cscColPtr, __pyx_v_copyValues, __pyx_v_idxBase);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_132scsr2csc(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_csrVal, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd, size_t __pyx_v_cscVal, size_t __pyx_v_cscRowInd, size_t __pyx_v_cscColPtr, int __pyx_v_copyValues, int __pyx_v_idxBase) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsr2csc", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_scsr2csc(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_csrVal, __pyx_v_csrRowPtr, __pyx_v_csrColInd, __pyx_v_cscVal, __pyx_v_cscRowInd, __pyx_v_cscColPtr, __pyx_v_copyValues, __pyx_v_idxBase, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2231
 * 
 * 
 * cpdef dcsr2csc(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t csrVal,
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_135dcsr2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsr2csc(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_csrVal, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd, size_t __pyx_v_cscVal, size_t __pyx_v_cscRowInd, size_t __pyx_v_cscColPtr, int __pyx_v_copyValues, int __pyx_v_idxBase, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsr2csc", 0);

  /* "cupy/cuda/cusparse.pyx":2235
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
 *         size_t cscRowInd, size_t cscColPtr, int copyValues, int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDcsr2csc(
 *         <Handle>handle, m, n, nnz, <const double *>csrVal,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2236
 *         size_t cscRowInd, size_t cscColPtr, int copyValues, int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDcsr2csc(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, nnz, <const double *>csrVal,
 *         <const int *>csrRowPtr, <const int *>csrColInd, <double *>cscVal,
 */
  __pyx_v_status = cusparseDcsr2csc(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((double const *)__pyx_v_csrVal), ((int const *)__pyx_v_csrRowPtr), ((int const *)__pyx_v_csrColInd), ((double *)__pyx_v_cscVal), ((int *)__pyx_v_cscRowInd), ((int *)__pyx_v_cscColPtr), ((cusparseAction_t)__pyx_v_copyValues), ((cusparseIndexBase_t)__pyx_v_idxBase));

  /* "cupy/cuda/cusparse.pyx":2241
 *         <int *>cscRowInd, <int *>cscColPtr, <Action>copyValues,
 *         <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef ccsr2csc(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2231
 * 
 * 
 * cpdef dcsr2csc(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t csrVal,
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_135dcsr2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_134dcsr2csc[] = "dcsr2csc(size_t handle, int m, int n, int nnz, size_t csrVal, size_t csrRowPtr, size_t csrColInd, size_t cscVal, size_t cscRowInd, size_t cscColPtr, int copyValues, int idxBase)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_135dcsr2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  size_t __pyx_v_csrVal;
  size_t __pyx_v_csrRowPtr;
  size_t __pyx_v_csrColInd;
  size_t __pyx_v_cscVal;
  size_t __pyx_v_cscRowInd;
  size_t __pyx_v_cscColPtr;
  int __pyx_v_copyValues;
  int __pyx_v_idxBase;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsr2csc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_csrVal,&__pyx_n_s_csrRowPtr,&__pyx_n_s_csrColInd,&__pyx_n_s_cscVal,&__pyx_n_s_cscRowInd,&__pyx_n_s_cscColPtr,&__pyx_n_s_copyValues,&__pyx_n_s_idxBase,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csc", 1, 12, 12, 1); __PYX_ERR(0, 2231, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csc", 1, 12, 12, 2); __PYX_ERR(0, 2231, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csc", 1, 12, 12, 3); __PYX_ERR(0, 2231, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csc", 1, 12, 12, 4); __PYX_ERR(0, 2231, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csc", 1, 12, 12, 5); __PYX_ERR(0, 2231, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csc", 1, 12, 12, 6); __PYX_ERR(0, 2231, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csc", 1, 12, 12, 7); __PYX_ERR(0, 2231, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscRowInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csc", 1, 12, 12, 8); __PYX_ERR(0, 2231, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscColPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csc", 1, 12, 12, 9); __PYX_ERR(0, 2231, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_copyValues)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csc", 1, 12, 12, 10); __PYX_ERR(0, 2231, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csc", 1, 12, 12, 11); __PYX_ERR(0, 2231, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsr2csc") < 0)) __PYX_ERR(0, 2231, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2232, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2232, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2232, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2232, __pyx_L3_error)
    __pyx_v_csrVal = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2232, __pyx_L3_error)
    __pyx_v_csrRowPtr = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2233, __pyx_L3_error)
    __pyx_v_csrColInd = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2233, __pyx_L3_error)
    __pyx_v_cscVal = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_cscVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2233, __pyx_L3_error)
    __pyx_v_cscRowInd = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_cscRowInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2234, __pyx_L3_error)
    __pyx_v_cscColPtr = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_cscColPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2234, __pyx_L3_error)
    __pyx_v_copyValues = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_copyValues == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2234, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2234, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsr2csc", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2231, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_134dcsr2csc(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_csrVal, __pyx_v_csrRowPtr, __pyx_v_csrColInd, __pyx_v_cscVal, __pyx_v_cscRowInd, __pyx_v_cscColPtr, __pyx_v_copyValues, __pyx_v_idxBase);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_134dcsr2csc(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_csrVal, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd, size_t __pyx_v_cscVal, size_t __pyx_v_cscRowInd, size_t __pyx_v_cscColPtr, int __pyx_v_copyValues, int __pyx_v_idxBase) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsr2csc", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dcsr2csc(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_csrVal, __pyx_v_csrRowPtr, __pyx_v_csrColInd, __pyx_v_cscVal, __pyx_v_cscRowInd, __pyx_v_cscColPtr, __pyx_v_copyValues, __pyx_v_idxBase, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2243
 *     check_status(status)
 * 
 * cpdef ccsr2csc(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t csrVal,
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_137ccsr2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsr2csc(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_csrVal, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd, size_t __pyx_v_cscVal, size_t __pyx_v_cscRowInd, size_t __pyx_v_cscColPtr, int __pyx_v_copyValues, int __pyx_v_idxBase, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsr2csc", 0);

  /* "cupy/cuda/cusparse.pyx":2247
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
 *         size_t cscRowInd, size_t cscColPtr, int copyValues, int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCcsr2csc(
 *         <Handle>handle, m, n, nnz, <const cuComplex *>csrVal,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2248
 *         size_t cscRowInd, size_t cscColPtr, int copyValues, int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCcsr2csc(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, nnz, <const cuComplex *>csrVal,
 *         <const int *>csrRowPtr, <const int *>csrColInd, <cuComplex *>cscVal,
 */
  __pyx_v_status = cusparseCcsr2csc(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((cuComplex const *)__pyx_v_csrVal), ((int const *)__pyx_v_csrRowPtr), ((int const *)__pyx_v_csrColInd), ((cuComplex *)__pyx_v_cscVal), ((int *)__pyx_v_cscRowInd), ((int *)__pyx_v_cscColPtr), ((cusparseAction_t)__pyx_v_copyValues), ((cusparseIndexBase_t)__pyx_v_idxBase));

  /* "cupy/cuda/cusparse.pyx":2253
 *         <int *>cscRowInd, <int *>cscColPtr, <Action>copyValues,
 *         <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zcsr2csc(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2243
 *     check_status(status)
 * 
 * cpdef ccsr2csc(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t csrVal,
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_137ccsr2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_136ccsr2csc[] = "ccsr2csc(size_t handle, int m, int n, int nnz, size_t csrVal, size_t csrRowPtr, size_t csrColInd, size_t cscVal, size_t cscRowInd, size_t cscColPtr, int copyValues, int idxBase)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_137ccsr2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  size_t __pyx_v_csrVal;
  size_t __pyx_v_csrRowPtr;
  size_t __pyx_v_csrColInd;
  size_t __pyx_v_cscVal;
  size_t __pyx_v_cscRowInd;
  size_t __pyx_v_cscColPtr;
  int __pyx_v_copyValues;
  int __pyx_v_idxBase;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsr2csc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_csrVal,&__pyx_n_s_csrRowPtr,&__pyx_n_s_csrColInd,&__pyx_n_s_cscVal,&__pyx_n_s_cscRowInd,&__pyx_n_s_cscColPtr,&__pyx_n_s_copyValues,&__pyx_n_s_idxBase,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csc", 1, 12, 12, 1); __PYX_ERR(0, 2243, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csc", 1, 12, 12, 2); __PYX_ERR(0, 2243, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csc", 1, 12, 12, 3); __PYX_ERR(0, 2243, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csc", 1, 12, 12, 4); __PYX_ERR(0, 2243, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csc", 1, 12, 12, 5); __PYX_ERR(0, 2243, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csc", 1, 12, 12, 6); __PYX_ERR(0, 2243, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csc", 1, 12, 12, 7); __PYX_ERR(0, 2243, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscRowInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csc", 1, 12, 12, 8); __PYX_ERR(0, 2243, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscColPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csc", 1, 12, 12, 9); __PYX_ERR(0, 2243, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_copyValues)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csc", 1, 12, 12, 10); __PYX_ERR(0, 2243, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csc", 1, 12, 12, 11); __PYX_ERR(0, 2243, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsr2csc") < 0)) __PYX_ERR(0, 2243, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2244, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2244, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2244, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2244, __pyx_L3_error)
    __pyx_v_csrVal = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2244, __pyx_L3_error)
    __pyx_v_csrRowPtr = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2245, __pyx_L3_error)
    __pyx_v_csrColInd = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2245, __pyx_L3_error)
    __pyx_v_cscVal = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_cscVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2245, __pyx_L3_error)
    __pyx_v_cscRowInd = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_cscRowInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2246, __pyx_L3_error)
    __pyx_v_cscColPtr = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_cscColPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2246, __pyx_L3_error)
    __pyx_v_copyValues = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_copyValues == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2246, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2246, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsr2csc", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2243, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_136ccsr2csc(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_csrVal, __pyx_v_csrRowPtr, __pyx_v_csrColInd, __pyx_v_cscVal, __pyx_v_cscRowInd, __pyx_v_cscColPtr, __pyx_v_copyValues, __pyx_v_idxBase);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_136ccsr2csc(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_csrVal, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd, size_t __pyx_v_cscVal, size_t __pyx_v_cscRowInd, size_t __pyx_v_cscColPtr, int __pyx_v_copyValues, int __pyx_v_idxBase) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsr2csc", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ccsr2csc(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_csrVal, __pyx_v_csrRowPtr, __pyx_v_csrColInd, __pyx_v_cscVal, __pyx_v_cscRowInd, __pyx_v_cscColPtr, __pyx_v_copyValues, __pyx_v_idxBase, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2255
 *     check_status(status)
 * 
 * cpdef zcsr2csc(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t csrVal,
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_139zcsr2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsr2csc(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_csrVal, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd, size_t __pyx_v_cscVal, size_t __pyx_v_cscRowInd, size_t __pyx_v_cscColPtr, int __pyx_v_copyValues, int __pyx_v_idxBase, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsr2csc", 0);

  /* "cupy/cuda/cusparse.pyx":2259
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
 *         size_t cscRowInd, size_t cscColPtr, int copyValues, int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZcsr2csc(
 *         <Handle>handle, m, n, nnz, <const cuDoubleComplex *>csrVal,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2260
 *         size_t cscRowInd, size_t cscColPtr, int copyValues, int idxBase):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZcsr2csc(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, nnz, <const cuDoubleComplex *>csrVal,
 *         <const int *>csrRowPtr, <const int *>csrColInd,
 */
  __pyx_v_status = cusparseZcsr2csc(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((cuDoubleComplex const *)__pyx_v_csrVal), ((int const *)__pyx_v_csrRowPtr), ((int const *)__pyx_v_csrColInd), ((cuDoubleComplex *)__pyx_v_cscVal), ((int *)__pyx_v_cscRowInd), ((int *)__pyx_v_cscColPtr), ((cusparseAction_t)__pyx_v_copyValues), ((cusparseIndexBase_t)__pyx_v_idxBase));

  /* "cupy/cuda/cusparse.pyx":2266
 *         <int *>cscRowInd, <int *>cscColPtr, <Action>copyValues,
 *         <IndexBase>idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef scsr2dense(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2255
 *     check_status(status)
 * 
 * cpdef zcsr2csc(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t csrVal,
 *         size_t csrRowPtr, size_t csrColInd, size_t cscVal,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_139zcsr2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_138zcsr2csc[] = "zcsr2csc(size_t handle, int m, int n, int nnz, size_t csrVal, size_t csrRowPtr, size_t csrColInd, size_t cscVal, size_t cscRowInd, size_t cscColPtr, int copyValues, int idxBase)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_139zcsr2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  size_t __pyx_v_csrVal;
  size_t __pyx_v_csrRowPtr;
  size_t __pyx_v_csrColInd;
  size_t __pyx_v_cscVal;
  size_t __pyx_v_cscRowInd;
  size_t __pyx_v_cscColPtr;
  int __pyx_v_copyValues;
  int __pyx_v_idxBase;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsr2csc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_csrVal,&__pyx_n_s_csrRowPtr,&__pyx_n_s_csrColInd,&__pyx_n_s_cscVal,&__pyx_n_s_cscRowInd,&__pyx_n_s_cscColPtr,&__pyx_n_s_copyValues,&__pyx_n_s_idxBase,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csc", 1, 12, 12, 1); __PYX_ERR(0, 2255, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csc", 1, 12, 12, 2); __PYX_ERR(0, 2255, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csc", 1, 12, 12, 3); __PYX_ERR(0, 2255, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csc", 1, 12, 12, 4); __PYX_ERR(0, 2255, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csc", 1, 12, 12, 5); __PYX_ERR(0, 2255, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csc", 1, 12, 12, 6); __PYX_ERR(0, 2255, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csc", 1, 12, 12, 7); __PYX_ERR(0, 2255, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscRowInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csc", 1, 12, 12, 8); __PYX_ERR(0, 2255, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscColPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csc", 1, 12, 12, 9); __PYX_ERR(0, 2255, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_copyValues)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csc", 1, 12, 12, 10); __PYX_ERR(0, 2255, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csc", 1, 12, 12, 11); __PYX_ERR(0, 2255, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsr2csc") < 0)) __PYX_ERR(0, 2255, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2256, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2256, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2256, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2256, __pyx_L3_error)
    __pyx_v_csrVal = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2256, __pyx_L3_error)
    __pyx_v_csrRowPtr = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2257, __pyx_L3_error)
    __pyx_v_csrColInd = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2257, __pyx_L3_error)
    __pyx_v_cscVal = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_cscVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2257, __pyx_L3_error)
    __pyx_v_cscRowInd = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_cscRowInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2258, __pyx_L3_error)
    __pyx_v_cscColPtr = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_cscColPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2258, __pyx_L3_error)
    __pyx_v_copyValues = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_copyValues == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2258, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_idxBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2258, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsr2csc", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2255, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_138zcsr2csc(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_csrVal, __pyx_v_csrRowPtr, __pyx_v_csrColInd, __pyx_v_cscVal, __pyx_v_cscRowInd, __pyx_v_cscColPtr, __pyx_v_copyValues, __pyx_v_idxBase);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_138zcsr2csc(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_csrVal, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd, size_t __pyx_v_cscVal, size_t __pyx_v_cscRowInd, size_t __pyx_v_cscColPtr, int __pyx_v_copyValues, int __pyx_v_idxBase) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsr2csc", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zcsr2csc(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_csrVal, __pyx_v_csrRowPtr, __pyx_v_csrColInd, __pyx_v_cscVal, __pyx_v_cscRowInd, __pyx_v_cscColPtr, __pyx_v_copyValues, __pyx_v_idxBase, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsr2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2268
 *     check_status(status)
 * 
 * cpdef scsr2dense(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_141scsr2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsr2dense(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_A, int __pyx_v_lda, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsr2dense", 0);

  /* "cupy/cuda/cusparse.pyx":2272
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
 *         size_t csrSortedColIndA, size_t A, int lda):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseScsr2dense(
 *         <Handle>handle, m, n, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2273
 *         size_t csrSortedColIndA, size_t A, int lda):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseScsr2dense(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <MatDescr>descrA,
 *         <const float *>csrSortedValA, <const int *>csrSortedRowPtrA,
 */
  __pyx_v_status = cusparseScsr2dense(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t)__pyx_v_descrA), ((float const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((float *)__pyx_v_A), __pyx_v_lda);

  /* "cupy/cuda/cusparse.pyx":2277
 *         <const float *>csrSortedValA, <const int *>csrSortedRowPtrA,
 *         <const int *>csrSortedColIndA, <float *>A, lda)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dcsr2dense(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2268
 *     check_status(status)
 * 
 * cpdef scsr2dense(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_141scsr2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_140scsr2dense[] = "scsr2dense(size_t handle, int m, int n, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t A, int lda)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_141scsr2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsr2dense (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_A,&__pyx_n_s_lda,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2dense", 1, 9, 9, 1); __PYX_ERR(0, 2268, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2dense", 1, 9, 9, 2); __PYX_ERR(0, 2268, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2dense", 1, 9, 9, 3); __PYX_ERR(0, 2268, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2dense", 1, 9, 9, 4); __PYX_ERR(0, 2268, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2dense", 1, 9, 9, 5); __PYX_ERR(0, 2268, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2dense", 1, 9, 9, 6); __PYX_ERR(0, 2268, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2dense", 1, 9, 9, 7); __PYX_ERR(0, 2268, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2dense", 1, 9, 9, 8); __PYX_ERR(0, 2268, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsr2dense") < 0)) __PYX_ERR(0, 2268, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2269, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2269, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2269, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2269, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2270, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2270, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2271, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2271, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2271, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsr2dense", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2268, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_140scsr2dense(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_A, __pyx_v_lda);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_140scsr2dense(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_A, int __pyx_v_lda) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsr2dense", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_scsr2dense(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_A, __pyx_v_lda, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2279
 *     check_status(status)
 * 
 * cpdef dcsr2dense(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_143dcsr2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsr2dense(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_A, int __pyx_v_lda, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsr2dense", 0);

  /* "cupy/cuda/cusparse.pyx":2283
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
 *         size_t csrSortedColIndA, size_t A, int lda):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDcsr2dense(
 *         <Handle>handle, m, n, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2284
 *         size_t csrSortedColIndA, size_t A, int lda):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDcsr2dense(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <MatDescr>descrA,
 *         <const double *>csrSortedValA, <const int *>csrSortedRowPtrA,
 */
  __pyx_v_status = cusparseDcsr2dense(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t)__pyx_v_descrA), ((double const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((double *)__pyx_v_A), __pyx_v_lda);

  /* "cupy/cuda/cusparse.pyx":2288
 *         <const double *>csrSortedValA, <const int *>csrSortedRowPtrA,
 *         <const int *>csrSortedColIndA, <double *>A, lda)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef ccsr2dense(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2279
 *     check_status(status)
 * 
 * cpdef dcsr2dense(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_143dcsr2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_142dcsr2dense[] = "dcsr2dense(size_t handle, int m, int n, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t A, int lda)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_143dcsr2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsr2dense (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_A,&__pyx_n_s_lda,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2dense", 1, 9, 9, 1); __PYX_ERR(0, 2279, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2dense", 1, 9, 9, 2); __PYX_ERR(0, 2279, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2dense", 1, 9, 9, 3); __PYX_ERR(0, 2279, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2dense", 1, 9, 9, 4); __PYX_ERR(0, 2279, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2dense", 1, 9, 9, 5); __PYX_ERR(0, 2279, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2dense", 1, 9, 9, 6); __PYX_ERR(0, 2279, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2dense", 1, 9, 9, 7); __PYX_ERR(0, 2279, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2dense", 1, 9, 9, 8); __PYX_ERR(0, 2279, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsr2dense") < 0)) __PYX_ERR(0, 2279, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2280, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2280, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2280, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2280, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2281, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2281, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2282, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2282, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2282, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsr2dense", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2279, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_142dcsr2dense(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_A, __pyx_v_lda);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_142dcsr2dense(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_A, int __pyx_v_lda) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsr2dense", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dcsr2dense(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_A, __pyx_v_lda, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2290
 *     check_status(status)
 * 
 * cpdef ccsr2dense(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_145ccsr2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsr2dense(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_A, int __pyx_v_lda, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsr2dense", 0);

  /* "cupy/cuda/cusparse.pyx":2294
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
 *         size_t csrSortedColIndA, size_t A, int lda):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCcsr2dense(
 *         <Handle>handle, m, n, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2295
 *         size_t csrSortedColIndA, size_t A, int lda):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCcsr2dense(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <MatDescr>descrA,
 *         <const cuComplex *>csrSortedValA, <const int *>csrSortedRowPtrA,
 */
  __pyx_v_status = cusparseCcsr2dense(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t)__pyx_v_descrA), ((cuComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((cuComplex *)__pyx_v_A), __pyx_v_lda);

  /* "cupy/cuda/cusparse.pyx":2299
 *         <const cuComplex *>csrSortedValA, <const int *>csrSortedRowPtrA,
 *         <const int *>csrSortedColIndA, <cuComplex *>A, lda)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zcsr2dense(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2290
 *     check_status(status)
 * 
 * cpdef ccsr2dense(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_145ccsr2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_144ccsr2dense[] = "ccsr2dense(size_t handle, int m, int n, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t A, int lda)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_145ccsr2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsr2dense (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_A,&__pyx_n_s_lda,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2dense", 1, 9, 9, 1); __PYX_ERR(0, 2290, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2dense", 1, 9, 9, 2); __PYX_ERR(0, 2290, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2dense", 1, 9, 9, 3); __PYX_ERR(0, 2290, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2dense", 1, 9, 9, 4); __PYX_ERR(0, 2290, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2dense", 1, 9, 9, 5); __PYX_ERR(0, 2290, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2dense", 1, 9, 9, 6); __PYX_ERR(0, 2290, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2dense", 1, 9, 9, 7); __PYX_ERR(0, 2290, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2dense", 1, 9, 9, 8); __PYX_ERR(0, 2290, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsr2dense") < 0)) __PYX_ERR(0, 2290, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2291, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2291, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2291, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2291, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2292, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2292, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2293, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2293, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2293, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsr2dense", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2290, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_144ccsr2dense(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_A, __pyx_v_lda);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_144ccsr2dense(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_A, int __pyx_v_lda) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsr2dense", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ccsr2dense(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_A, __pyx_v_lda, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2301
 *     check_status(status)
 * 
 * cpdef zcsr2dense(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_147zcsr2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsr2dense(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_A, int __pyx_v_lda, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsr2dense", 0);

  /* "cupy/cuda/cusparse.pyx":2305
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
 *         size_t csrSortedColIndA, size_t A, int lda):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZcsr2dense(
 *         <Handle>handle, m, n, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2306
 *         size_t csrSortedColIndA, size_t A, int lda):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZcsr2dense(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <MatDescr>descrA,
 *         <const cuDoubleComplex *>csrSortedValA, <const int *>csrSortedRowPtrA,
 */
  __pyx_v_status = cusparseZcsr2dense(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t)__pyx_v_descrA), ((cuDoubleComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((cuDoubleComplex *)__pyx_v_A), __pyx_v_lda);

  /* "cupy/cuda/cusparse.pyx":2310
 *         <const cuDoubleComplex *>csrSortedValA, <const int *>csrSortedRowPtrA,
 *         <const int *>csrSortedColIndA, <cuDoubleComplex *>A, lda)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef snnz_compress(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2301
 *     check_status(status)
 * 
 * cpdef zcsr2dense(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t csrSortedValA, size_t csrSortedRowPtrA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_147zcsr2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_146zcsr2dense[] = "zcsr2dense(size_t handle, int m, int n, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t A, int lda)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_147zcsr2dense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsr2dense (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_A,&__pyx_n_s_lda,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2dense", 1, 9, 9, 1); __PYX_ERR(0, 2301, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2dense", 1, 9, 9, 2); __PYX_ERR(0, 2301, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2dense", 1, 9, 9, 3); __PYX_ERR(0, 2301, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2dense", 1, 9, 9, 4); __PYX_ERR(0, 2301, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2dense", 1, 9, 9, 5); __PYX_ERR(0, 2301, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2dense", 1, 9, 9, 6); __PYX_ERR(0, 2301, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2dense", 1, 9, 9, 7); __PYX_ERR(0, 2301, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2dense", 1, 9, 9, 8); __PYX_ERR(0, 2301, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsr2dense") < 0)) __PYX_ERR(0, 2301, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2302, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2302, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2302, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2302, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2303, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2303, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2304, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2304, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2304, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsr2dense", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2301, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_146zcsr2dense(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_A, __pyx_v_lda);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_146zcsr2dense(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_A, int __pyx_v_lda) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsr2dense", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zcsr2dense(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_A, __pyx_v_lda, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsr2dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2312
 *     check_status(status)
 * 
 * cpdef snnz_compress(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, size_t descr,
 *         size_t values, size_t rowPtr, size_t nnzPerRow,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_149snnz_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_snnz_compress(size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_descr, size_t __pyx_v_values, size_t __pyx_v_rowPtr, size_t __pyx_v_nnzPerRow, float __pyx_v_tol, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_nnz_total;
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("snnz_compress", 0);

  /* "cupy/cuda/cusparse.pyx":2317
 *         float tol):
 *     cdef int nnz_total
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseSnnz_compress(
 *         <Handle>handle, m, <const MatDescr>descr,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2318
 *     cdef int nnz_total
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseSnnz_compress(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, <const MatDescr>descr,
 *         <const float *>values, <const int *>rowPtr, <int *>nnzPerRow,
 */
  __pyx_v_status = cusparseSnnz_compress(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, ((cusparseMatDescr_t const )__pyx_v_descr), ((float const *)__pyx_v_values), ((int const *)__pyx_v_rowPtr), ((int *)__pyx_v_nnzPerRow), (&__pyx_v_nnz_total), __pyx_v_tol);

  /* "cupy/cuda/cusparse.pyx":2322
 *         <const float *>values, <const int *>rowPtr, <int *>nnzPerRow,
 *         &nnz_total, tol)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return nnz_total
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2323
 *         &nnz_total, tol)
 *     check_status(status)
 *     return nnz_total             # <<<<<<<<<<<<<<
 * 
 * cpdef dnnz_compress(
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nnz_total); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2312
 *     check_status(status)
 * 
 * cpdef snnz_compress(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, size_t descr,
 *         size_t values, size_t rowPtr, size_t nnzPerRow,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.snnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_149snnz_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_148snnz_compress[] = "snnz_compress(size_t handle, int m, size_t descr, size_t values, size_t rowPtr, size_t nnzPerRow, float tol)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_149snnz_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  size_t __pyx_v_descr;
  size_t __pyx_v_values;
  size_t __pyx_v_rowPtr;
  size_t __pyx_v_nnzPerRow;
  float __pyx_v_tol;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("snnz_compress (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_descr,&__pyx_n_s_values,&__pyx_n_s_rowPtr,&__pyx_n_s_nnzPerRow,&__pyx_n_s_tol,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("snnz_compress", 1, 7, 7, 1); __PYX_ERR(0, 2312, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("snnz_compress", 1, 7, 7, 2); __PYX_ERR(0, 2312, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("snnz_compress", 1, 7, 7, 3); __PYX_ERR(0, 2312, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("snnz_compress", 1, 7, 7, 4); __PYX_ERR(0, 2312, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerRow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("snnz_compress", 1, 7, 7, 5); __PYX_ERR(0, 2312, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("snnz_compress", 1, 7, 7, 6); __PYX_ERR(0, 2312, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "snnz_compress") < 0)) __PYX_ERR(0, 2312, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2313, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2313, __pyx_L3_error)
    __pyx_v_descr = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2313, __pyx_L3_error)
    __pyx_v_values = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_values == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2314, __pyx_L3_error)
    __pyx_v_rowPtr = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_rowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2314, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2314, __pyx_L3_error)
    __pyx_v_tol = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_tol == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2315, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("snnz_compress", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2312, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.snnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_148snnz_compress(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_descr, __pyx_v_values, __pyx_v_rowPtr, __pyx_v_nnzPerRow, __pyx_v_tol);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_148snnz_compress(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_descr, size_t __pyx_v_values, size_t __pyx_v_rowPtr, size_t __pyx_v_nnzPerRow, float __pyx_v_tol) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("snnz_compress", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_snnz_compress(__pyx_v_handle, __pyx_v_m, __pyx_v_descr, __pyx_v_values, __pyx_v_rowPtr, __pyx_v_nnzPerRow, __pyx_v_tol, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.snnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2325
 *     return nnz_total
 * 
 * cpdef dnnz_compress(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, size_t descr,
 *         size_t values, size_t rowPtr, size_t nnzPerRow,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_151dnnz_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dnnz_compress(size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_descr, size_t __pyx_v_values, size_t __pyx_v_rowPtr, size_t __pyx_v_nnzPerRow, double __pyx_v_tol, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_nnz_total;
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnnz_compress", 0);

  /* "cupy/cuda/cusparse.pyx":2330
 *         double tol):
 *     cdef int nnz_total
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDnnz_compress(
 *         <Handle>handle, m, <const MatDescr>descr,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2331
 *     cdef int nnz_total
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDnnz_compress(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, <const MatDescr>descr,
 *         <const double *>values, <const int *>rowPtr, <int *>nnzPerRow,
 */
  __pyx_v_status = cusparseDnnz_compress(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, ((cusparseMatDescr_t const )__pyx_v_descr), ((double const *)__pyx_v_values), ((int const *)__pyx_v_rowPtr), ((int *)__pyx_v_nnzPerRow), (&__pyx_v_nnz_total), __pyx_v_tol);

  /* "cupy/cuda/cusparse.pyx":2335
 *         <const double *>values, <const int *>rowPtr, <int *>nnzPerRow,
 *         &nnz_total, tol)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return nnz_total
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2336
 *         &nnz_total, tol)
 *     check_status(status)
 *     return nnz_total             # <<<<<<<<<<<<<<
 * 
 * cpdef cnnz_compress(
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nnz_total); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2325
 *     return nnz_total
 * 
 * cpdef dnnz_compress(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, size_t descr,
 *         size_t values, size_t rowPtr, size_t nnzPerRow,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_151dnnz_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_150dnnz_compress[] = "dnnz_compress(size_t handle, int m, size_t descr, size_t values, size_t rowPtr, size_t nnzPerRow, double tol)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_151dnnz_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  size_t __pyx_v_descr;
  size_t __pyx_v_values;
  size_t __pyx_v_rowPtr;
  size_t __pyx_v_nnzPerRow;
  double __pyx_v_tol;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnnz_compress (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_descr,&__pyx_n_s_values,&__pyx_n_s_rowPtr,&__pyx_n_s_nnzPerRow,&__pyx_n_s_tol,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnnz_compress", 1, 7, 7, 1); __PYX_ERR(0, 2325, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnnz_compress", 1, 7, 7, 2); __PYX_ERR(0, 2325, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnnz_compress", 1, 7, 7, 3); __PYX_ERR(0, 2325, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnnz_compress", 1, 7, 7, 4); __PYX_ERR(0, 2325, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerRow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnnz_compress", 1, 7, 7, 5); __PYX_ERR(0, 2325, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnnz_compress", 1, 7, 7, 6); __PYX_ERR(0, 2325, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dnnz_compress") < 0)) __PYX_ERR(0, 2325, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2326, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2326, __pyx_L3_error)
    __pyx_v_descr = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2326, __pyx_L3_error)
    __pyx_v_values = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_values == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2327, __pyx_L3_error)
    __pyx_v_rowPtr = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_rowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2327, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2327, __pyx_L3_error)
    __pyx_v_tol = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_tol == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2328, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dnnz_compress", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2325, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_150dnnz_compress(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_descr, __pyx_v_values, __pyx_v_rowPtr, __pyx_v_nnzPerRow, __pyx_v_tol);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_150dnnz_compress(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_descr, size_t __pyx_v_values, size_t __pyx_v_rowPtr, size_t __pyx_v_nnzPerRow, double __pyx_v_tol) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnnz_compress", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dnnz_compress(__pyx_v_handle, __pyx_v_m, __pyx_v_descr, __pyx_v_values, __pyx_v_rowPtr, __pyx_v_nnzPerRow, __pyx_v_tol, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2338
 *     return nnz_total
 * 
 * cpdef cnnz_compress(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, size_t descr,
 *         size_t values, size_t rowPtr, size_t nnzPerRow,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_153cnnz_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cnnz_compress(size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_descr, size_t __pyx_v_values, size_t __pyx_v_rowPtr, size_t __pyx_v_nnzPerRow, __pyx_t_double_complex __pyx_v_tol, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_nnz_total;
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cnnz_compress", 0);

  /* "cupy/cuda/cusparse.pyx":2343
 *         complex tol):
 *     cdef int nnz_total
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCnnz_compress(
 *         <Handle>handle, m, <const MatDescr>descr,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2344
 *     cdef int nnz_total
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCnnz_compress(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, <const MatDescr>descr,
 *         <const cuComplex *>values, <const int *>rowPtr, <int *>nnzPerRow,
 */
  __pyx_v_status = cusparseCnnz_compress(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, ((cusparseMatDescr_t const )__pyx_v_descr), ((cuComplex const *)__pyx_v_values), ((int const *)__pyx_v_rowPtr), ((int *)__pyx_v_nnzPerRow), (&__pyx_v_nnz_total), __pyx_f_4cupy_4cuda_8cusparse_complex_to_cuda(__pyx_v_tol));

  /* "cupy/cuda/cusparse.pyx":2348
 *         <const cuComplex *>values, <const int *>rowPtr, <int *>nnzPerRow,
 *         &nnz_total, complex_to_cuda(tol))
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return nnz_total
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2349
 *         &nnz_total, complex_to_cuda(tol))
 *     check_status(status)
 *     return nnz_total             # <<<<<<<<<<<<<<
 * 
 * cpdef znnz_compress(
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nnz_total); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2338
 *     return nnz_total
 * 
 * cpdef cnnz_compress(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, size_t descr,
 *         size_t values, size_t rowPtr, size_t nnzPerRow,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cnnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_153cnnz_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_152cnnz_compress[] = "cnnz_compress(size_t handle, int m, size_t descr, size_t values, size_t rowPtr, size_t nnzPerRow, double complex tol)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_153cnnz_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  size_t __pyx_v_descr;
  size_t __pyx_v_values;
  size_t __pyx_v_rowPtr;
  size_t __pyx_v_nnzPerRow;
  __pyx_t_double_complex __pyx_v_tol;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cnnz_compress (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_descr,&__pyx_n_s_values,&__pyx_n_s_rowPtr,&__pyx_n_s_nnzPerRow,&__pyx_n_s_tol,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cnnz_compress", 1, 7, 7, 1); __PYX_ERR(0, 2338, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cnnz_compress", 1, 7, 7, 2); __PYX_ERR(0, 2338, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cnnz_compress", 1, 7, 7, 3); __PYX_ERR(0, 2338, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cnnz_compress", 1, 7, 7, 4); __PYX_ERR(0, 2338, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerRow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cnnz_compress", 1, 7, 7, 5); __PYX_ERR(0, 2338, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cnnz_compress", 1, 7, 7, 6); __PYX_ERR(0, 2338, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cnnz_compress") < 0)) __PYX_ERR(0, 2338, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2339, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2339, __pyx_L3_error)
    __pyx_v_descr = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2339, __pyx_L3_error)
    __pyx_v_values = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_values == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2340, __pyx_L3_error)
    __pyx_v_rowPtr = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_rowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2340, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2340, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyComplex_As___pyx_t_double_complex(values[6]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2341, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cnnz_compress", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2338, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cnnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_152cnnz_compress(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_descr, __pyx_v_values, __pyx_v_rowPtr, __pyx_v_nnzPerRow, __pyx_v_tol);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_152cnnz_compress(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_descr, size_t __pyx_v_values, size_t __pyx_v_rowPtr, size_t __pyx_v_nnzPerRow, __pyx_t_double_complex __pyx_v_tol) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cnnz_compress", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cnnz_compress(__pyx_v_handle, __pyx_v_m, __pyx_v_descr, __pyx_v_values, __pyx_v_rowPtr, __pyx_v_nnzPerRow, __pyx_v_tol, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cnnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2351
 *     return nnz_total
 * 
 * cpdef znnz_compress(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, size_t descr,
 *         size_t values, size_t rowPtr, size_t nnzPerRow,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_155znnz_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_znnz_compress(size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_descr, size_t __pyx_v_values, size_t __pyx_v_rowPtr, size_t __pyx_v_nnzPerRow, __pyx_t_double_complex __pyx_v_tol, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_nnz_total;
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("znnz_compress", 0);

  /* "cupy/cuda/cusparse.pyx":2356
 *         double complex tol):
 *     cdef int nnz_total
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZnnz_compress(
 *         <Handle>handle, m, <const MatDescr>descr,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2357
 *     cdef int nnz_total
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZnnz_compress(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, <const MatDescr>descr,
 *         <const cuDoubleComplex *>values, <const int *>rowPtr, <int *>nnzPerRow,
 */
  __pyx_v_status = cusparseZnnz_compress(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, ((cusparseMatDescr_t const )__pyx_v_descr), ((cuDoubleComplex const *)__pyx_v_values), ((int const *)__pyx_v_rowPtr), ((int *)__pyx_v_nnzPerRow), (&__pyx_v_nnz_total), __pyx_f_4cupy_4cuda_8cusparse_double_complex_to_cuda(__pyx_v_tol));

  /* "cupy/cuda/cusparse.pyx":2361
 *         <const cuDoubleComplex *>values, <const int *>rowPtr, <int *>nnzPerRow,
 *         &nnz_total, double_complex_to_cuda(tol))
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return nnz_total
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2362
 *         &nnz_total, double_complex_to_cuda(tol))
 *     check_status(status)
 *     return nnz_total             # <<<<<<<<<<<<<<
 * 
 * cpdef scsr2csr_compress(
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nnz_total); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2351
 *     return nnz_total
 * 
 * cpdef znnz_compress(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, size_t descr,
 *         size_t values, size_t rowPtr, size_t nnzPerRow,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.znnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_155znnz_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_154znnz_compress[] = "znnz_compress(size_t handle, int m, size_t descr, size_t values, size_t rowPtr, size_t nnzPerRow, double complex tol)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_155znnz_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  size_t __pyx_v_descr;
  size_t __pyx_v_values;
  size_t __pyx_v_rowPtr;
  size_t __pyx_v_nnzPerRow;
  __pyx_t_double_complex __pyx_v_tol;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("znnz_compress (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_descr,&__pyx_n_s_values,&__pyx_n_s_rowPtr,&__pyx_n_s_nnzPerRow,&__pyx_n_s_tol,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("znnz_compress", 1, 7, 7, 1); __PYX_ERR(0, 2351, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("znnz_compress", 1, 7, 7, 2); __PYX_ERR(0, 2351, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("znnz_compress", 1, 7, 7, 3); __PYX_ERR(0, 2351, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("znnz_compress", 1, 7, 7, 4); __PYX_ERR(0, 2351, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerRow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("znnz_compress", 1, 7, 7, 5); __PYX_ERR(0, 2351, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("znnz_compress", 1, 7, 7, 6); __PYX_ERR(0, 2351, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "znnz_compress") < 0)) __PYX_ERR(0, 2351, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2352, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2352, __pyx_L3_error)
    __pyx_v_descr = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_descr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2352, __pyx_L3_error)
    __pyx_v_values = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_values == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2353, __pyx_L3_error)
    __pyx_v_rowPtr = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_rowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2353, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2353, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyComplex_As___pyx_t_double_complex(values[6]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2354, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("znnz_compress", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2351, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.znnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_154znnz_compress(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_descr, __pyx_v_values, __pyx_v_rowPtr, __pyx_v_nnzPerRow, __pyx_v_tol);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_154znnz_compress(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_descr, size_t __pyx_v_values, size_t __pyx_v_rowPtr, size_t __pyx_v_nnzPerRow, __pyx_t_double_complex __pyx_v_tol) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("znnz_compress", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_znnz_compress(__pyx_v_handle, __pyx_v_m, __pyx_v_descr, __pyx_v_values, __pyx_v_rowPtr, __pyx_v_nnzPerRow, __pyx_v_tol, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.znnz_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2364
 *     return nnz_total
 * 
 * cpdef scsr2csr_compress(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t inVal, size_t inColInd, size_t inRowPtr,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_157scsr2csr_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsr2csr_compress(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_inVal, size_t __pyx_v_inColInd, size_t __pyx_v_inRowPtr, int __pyx_v_inNnz, size_t __pyx_v_nnzPerRow, size_t __pyx_v_outVal, size_t __pyx_v_outColInd, size_t __pyx_v_outRowPtr, float __pyx_v_tol, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsr2csr_compress", 0);

  /* "cupy/cuda/cusparse.pyx":2369
 *         int inNnz, size_t nnzPerRow, size_t outVal, size_t outColInd,
 *         size_t outRowPtr, float tol):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseScsr2csr_compress(
 *         <Handle>handle, m, n, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2370
 *         size_t outRowPtr, float tol):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseScsr2csr_compress(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <MatDescr>descrA,
 *         <const float *>inVal, <const int *>inColInd, <const int *>inRowPtr,
 */
  __pyx_v_status = cusparseScsr2csr_compress(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t)__pyx_v_descrA), ((float const *)__pyx_v_inVal), ((int const *)__pyx_v_inColInd), ((int const *)__pyx_v_inRowPtr), __pyx_v_inNnz, ((int *)__pyx_v_nnzPerRow), ((float *)__pyx_v_outVal), ((int *)__pyx_v_outColInd), ((int *)__pyx_v_outRowPtr), __pyx_v_tol);

  /* "cupy/cuda/cusparse.pyx":2375
 *         inNnz, <int *>nnzPerRow, <float *>outVal, <int *>outColInd,
 *         <int *>outRowPtr, tol)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2364
 *     return nnz_total
 * 
 * cpdef scsr2csr_compress(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t inVal, size_t inColInd, size_t inRowPtr,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_157scsr2csr_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_156scsr2csr_compress[] = "scsr2csr_compress(size_t handle, int m, int n, size_t descrA, size_t inVal, size_t inColInd, size_t inRowPtr, int inNnz, size_t nnzPerRow, size_t outVal, size_t outColInd, size_t outRowPtr, float tol)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_157scsr2csr_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_inVal;
  size_t __pyx_v_inColInd;
  size_t __pyx_v_inRowPtr;
  int __pyx_v_inNnz;
  size_t __pyx_v_nnzPerRow;
  size_t __pyx_v_outVal;
  size_t __pyx_v_outColInd;
  size_t __pyx_v_outRowPtr;
  float __pyx_v_tol;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsr2csr_compress (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_inVal,&__pyx_n_s_inColInd,&__pyx_n_s_inRowPtr,&__pyx_n_s_inNnz,&__pyx_n_s_nnzPerRow,&__pyx_n_s_outVal,&__pyx_n_s_outColInd,&__pyx_n_s_outRowPtr,&__pyx_n_s_tol,0};
    PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csr_compress", 1, 13, 13, 1); __PYX_ERR(0, 2364, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csr_compress", 1, 13, 13, 2); __PYX_ERR(0, 2364, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csr_compress", 1, 13, 13, 3); __PYX_ERR(0, 2364, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csr_compress", 1, 13, 13, 4); __PYX_ERR(0, 2364, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csr_compress", 1, 13, 13, 5); __PYX_ERR(0, 2364, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csr_compress", 1, 13, 13, 6); __PYX_ERR(0, 2364, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inNnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csr_compress", 1, 13, 13, 7); __PYX_ERR(0, 2364, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerRow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csr_compress", 1, 13, 13, 8); __PYX_ERR(0, 2364, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csr_compress", 1, 13, 13, 9); __PYX_ERR(0, 2364, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csr_compress", 1, 13, 13, 10); __PYX_ERR(0, 2364, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csr_compress", 1, 13, 13, 11); __PYX_ERR(0, 2364, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsr2csr_compress", 1, 13, 13, 12); __PYX_ERR(0, 2364, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsr2csr_compress") < 0)) __PYX_ERR(0, 2364, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 13) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2365, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2365, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2365, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2365, __pyx_L3_error)
    __pyx_v_inVal = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_inVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2366, __pyx_L3_error)
    __pyx_v_inColInd = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_inColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2366, __pyx_L3_error)
    __pyx_v_inRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_inRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2366, __pyx_L3_error)
    __pyx_v_inNnz = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_inNnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2367, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2367, __pyx_L3_error)
    __pyx_v_outVal = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_outVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2367, __pyx_L3_error)
    __pyx_v_outColInd = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_outColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2367, __pyx_L3_error)
    __pyx_v_outRowPtr = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_outRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2368, __pyx_L3_error)
    __pyx_v_tol = __pyx_PyFloat_AsFloat(values[12]); if (unlikely((__pyx_v_tol == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2368, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsr2csr_compress", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2364, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_156scsr2csr_compress(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_inVal, __pyx_v_inColInd, __pyx_v_inRowPtr, __pyx_v_inNnz, __pyx_v_nnzPerRow, __pyx_v_outVal, __pyx_v_outColInd, __pyx_v_outRowPtr, __pyx_v_tol);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_156scsr2csr_compress(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_inVal, size_t __pyx_v_inColInd, size_t __pyx_v_inRowPtr, int __pyx_v_inNnz, size_t __pyx_v_nnzPerRow, size_t __pyx_v_outVal, size_t __pyx_v_outColInd, size_t __pyx_v_outRowPtr, float __pyx_v_tol) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsr2csr_compress", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_scsr2csr_compress(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_inVal, __pyx_v_inColInd, __pyx_v_inRowPtr, __pyx_v_inNnz, __pyx_v_nnzPerRow, __pyx_v_outVal, __pyx_v_outColInd, __pyx_v_outRowPtr, __pyx_v_tol, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2378
 * 
 * 
 * cpdef dcsr2csr_compress(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t inVal, size_t inColInd, size_t inRowPtr,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_159dcsr2csr_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsr2csr_compress(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_inVal, size_t __pyx_v_inColInd, size_t __pyx_v_inRowPtr, int __pyx_v_inNnz, size_t __pyx_v_nnzPerRow, size_t __pyx_v_outVal, size_t __pyx_v_outColInd, size_t __pyx_v_outRowPtr, float __pyx_v_tol, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsr2csr_compress", 0);

  /* "cupy/cuda/cusparse.pyx":2383
 *         int inNnz, size_t nnzPerRow, size_t outVal, size_t outColInd,
 *         size_t outRowPtr, float tol):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDcsr2csr_compress(
 *         <Handle>handle, m, n, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2384
 *         size_t outRowPtr, float tol):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDcsr2csr_compress(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <MatDescr>descrA,
 *         <const double *>inVal, <const int *>inColInd, <const int *>inRowPtr,
 */
  __pyx_v_status = cusparseDcsr2csr_compress(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t)__pyx_v_descrA), ((double const *)__pyx_v_inVal), ((int const *)__pyx_v_inColInd), ((int const *)__pyx_v_inRowPtr), __pyx_v_inNnz, ((int *)__pyx_v_nnzPerRow), ((double *)__pyx_v_outVal), ((int *)__pyx_v_outColInd), ((int *)__pyx_v_outRowPtr), __pyx_v_tol);

  /* "cupy/cuda/cusparse.pyx":2389
 *         inNnz, <int *>nnzPerRow, <double *>outVal, <int *>outColInd,
 *         <int *>outRowPtr, tol)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef ccsr2csr_compress(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2378
 * 
 * 
 * cpdef dcsr2csr_compress(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t inVal, size_t inColInd, size_t inRowPtr,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_159dcsr2csr_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_158dcsr2csr_compress[] = "dcsr2csr_compress(size_t handle, int m, int n, size_t descrA, size_t inVal, size_t inColInd, size_t inRowPtr, int inNnz, size_t nnzPerRow, size_t outVal, size_t outColInd, size_t outRowPtr, float tol)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_159dcsr2csr_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_inVal;
  size_t __pyx_v_inColInd;
  size_t __pyx_v_inRowPtr;
  int __pyx_v_inNnz;
  size_t __pyx_v_nnzPerRow;
  size_t __pyx_v_outVal;
  size_t __pyx_v_outColInd;
  size_t __pyx_v_outRowPtr;
  float __pyx_v_tol;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsr2csr_compress (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_inVal,&__pyx_n_s_inColInd,&__pyx_n_s_inRowPtr,&__pyx_n_s_inNnz,&__pyx_n_s_nnzPerRow,&__pyx_n_s_outVal,&__pyx_n_s_outColInd,&__pyx_n_s_outRowPtr,&__pyx_n_s_tol,0};
    PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csr_compress", 1, 13, 13, 1); __PYX_ERR(0, 2378, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csr_compress", 1, 13, 13, 2); __PYX_ERR(0, 2378, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csr_compress", 1, 13, 13, 3); __PYX_ERR(0, 2378, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csr_compress", 1, 13, 13, 4); __PYX_ERR(0, 2378, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csr_compress", 1, 13, 13, 5); __PYX_ERR(0, 2378, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csr_compress", 1, 13, 13, 6); __PYX_ERR(0, 2378, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inNnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csr_compress", 1, 13, 13, 7); __PYX_ERR(0, 2378, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerRow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csr_compress", 1, 13, 13, 8); __PYX_ERR(0, 2378, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csr_compress", 1, 13, 13, 9); __PYX_ERR(0, 2378, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csr_compress", 1, 13, 13, 10); __PYX_ERR(0, 2378, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csr_compress", 1, 13, 13, 11); __PYX_ERR(0, 2378, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsr2csr_compress", 1, 13, 13, 12); __PYX_ERR(0, 2378, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsr2csr_compress") < 0)) __PYX_ERR(0, 2378, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 13) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2379, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2379, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2379, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2379, __pyx_L3_error)
    __pyx_v_inVal = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_inVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2380, __pyx_L3_error)
    __pyx_v_inColInd = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_inColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2380, __pyx_L3_error)
    __pyx_v_inRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_inRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2380, __pyx_L3_error)
    __pyx_v_inNnz = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_inNnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2381, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2381, __pyx_L3_error)
    __pyx_v_outVal = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_outVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2381, __pyx_L3_error)
    __pyx_v_outColInd = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_outColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2381, __pyx_L3_error)
    __pyx_v_outRowPtr = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_outRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2382, __pyx_L3_error)
    __pyx_v_tol = __pyx_PyFloat_AsFloat(values[12]); if (unlikely((__pyx_v_tol == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2382, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsr2csr_compress", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2378, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_158dcsr2csr_compress(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_inVal, __pyx_v_inColInd, __pyx_v_inRowPtr, __pyx_v_inNnz, __pyx_v_nnzPerRow, __pyx_v_outVal, __pyx_v_outColInd, __pyx_v_outRowPtr, __pyx_v_tol);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_158dcsr2csr_compress(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_inVal, size_t __pyx_v_inColInd, size_t __pyx_v_inRowPtr, int __pyx_v_inNnz, size_t __pyx_v_nnzPerRow, size_t __pyx_v_outVal, size_t __pyx_v_outColInd, size_t __pyx_v_outRowPtr, float __pyx_v_tol) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsr2csr_compress", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dcsr2csr_compress(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_inVal, __pyx_v_inColInd, __pyx_v_inRowPtr, __pyx_v_inNnz, __pyx_v_nnzPerRow, __pyx_v_outVal, __pyx_v_outColInd, __pyx_v_outRowPtr, __pyx_v_tol, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2391
 *     check_status(status)
 * 
 * cpdef ccsr2csr_compress(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t inVal, size_t inColInd, size_t inRowPtr,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_161ccsr2csr_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsr2csr_compress(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_inVal, size_t __pyx_v_inColInd, size_t __pyx_v_inRowPtr, int __pyx_v_inNnz, size_t __pyx_v_nnzPerRow, size_t __pyx_v_outVal, size_t __pyx_v_outColInd, size_t __pyx_v_outRowPtr, __pyx_t_double_complex __pyx_v_tol, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsr2csr_compress", 0);

  /* "cupy/cuda/cusparse.pyx":2396
 *         int inNnz, size_t nnzPerRow, size_t outVal, size_t outColInd,
 *         size_t outRowPtr, complex tol):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCcsr2csr_compress(
 *         <Handle>handle, m, n, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2397
 *         size_t outRowPtr, complex tol):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCcsr2csr_compress(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <MatDescr>descrA,
 *         <const cuComplex *>inVal, <const int *>inColInd, <const int *>inRowPtr,
 */
  __pyx_v_status = cusparseCcsr2csr_compress(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t)__pyx_v_descrA), ((cuComplex const *)__pyx_v_inVal), ((int const *)__pyx_v_inColInd), ((int const *)__pyx_v_inRowPtr), __pyx_v_inNnz, ((int *)__pyx_v_nnzPerRow), ((cuComplex *)__pyx_v_outVal), ((int *)__pyx_v_outColInd), ((int *)__pyx_v_outRowPtr), __pyx_f_4cupy_4cuda_8cusparse_complex_to_cuda(__pyx_v_tol));

  /* "cupy/cuda/cusparse.pyx":2402
 *         inNnz, <int *>nnzPerRow, <cuComplex *>outVal, <int *>outColInd,
 *         <int *>outRowPtr, complex_to_cuda(tol))
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zcsr2csr_compress(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2391
 *     check_status(status)
 * 
 * cpdef ccsr2csr_compress(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t inVal, size_t inColInd, size_t inRowPtr,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_161ccsr2csr_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_160ccsr2csr_compress[] = "ccsr2csr_compress(size_t handle, int m, int n, size_t descrA, size_t inVal, size_t inColInd, size_t inRowPtr, int inNnz, size_t nnzPerRow, size_t outVal, size_t outColInd, size_t outRowPtr, double complex tol)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_161ccsr2csr_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_inVal;
  size_t __pyx_v_inColInd;
  size_t __pyx_v_inRowPtr;
  int __pyx_v_inNnz;
  size_t __pyx_v_nnzPerRow;
  size_t __pyx_v_outVal;
  size_t __pyx_v_outColInd;
  size_t __pyx_v_outRowPtr;
  __pyx_t_double_complex __pyx_v_tol;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsr2csr_compress (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_inVal,&__pyx_n_s_inColInd,&__pyx_n_s_inRowPtr,&__pyx_n_s_inNnz,&__pyx_n_s_nnzPerRow,&__pyx_n_s_outVal,&__pyx_n_s_outColInd,&__pyx_n_s_outRowPtr,&__pyx_n_s_tol,0};
    PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csr_compress", 1, 13, 13, 1); __PYX_ERR(0, 2391, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csr_compress", 1, 13, 13, 2); __PYX_ERR(0, 2391, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csr_compress", 1, 13, 13, 3); __PYX_ERR(0, 2391, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csr_compress", 1, 13, 13, 4); __PYX_ERR(0, 2391, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csr_compress", 1, 13, 13, 5); __PYX_ERR(0, 2391, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csr_compress", 1, 13, 13, 6); __PYX_ERR(0, 2391, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inNnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csr_compress", 1, 13, 13, 7); __PYX_ERR(0, 2391, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerRow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csr_compress", 1, 13, 13, 8); __PYX_ERR(0, 2391, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csr_compress", 1, 13, 13, 9); __PYX_ERR(0, 2391, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csr_compress", 1, 13, 13, 10); __PYX_ERR(0, 2391, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csr_compress", 1, 13, 13, 11); __PYX_ERR(0, 2391, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsr2csr_compress", 1, 13, 13, 12); __PYX_ERR(0, 2391, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsr2csr_compress") < 0)) __PYX_ERR(0, 2391, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 13) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2392, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2392, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2392, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2392, __pyx_L3_error)
    __pyx_v_inVal = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_inVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2393, __pyx_L3_error)
    __pyx_v_inColInd = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_inColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2393, __pyx_L3_error)
    __pyx_v_inRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_inRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2393, __pyx_L3_error)
    __pyx_v_inNnz = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_inNnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2394, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2394, __pyx_L3_error)
    __pyx_v_outVal = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_outVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2394, __pyx_L3_error)
    __pyx_v_outColInd = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_outColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2394, __pyx_L3_error)
    __pyx_v_outRowPtr = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_outRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2395, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyComplex_As___pyx_t_double_complex(values[12]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2395, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsr2csr_compress", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2391, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_160ccsr2csr_compress(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_inVal, __pyx_v_inColInd, __pyx_v_inRowPtr, __pyx_v_inNnz, __pyx_v_nnzPerRow, __pyx_v_outVal, __pyx_v_outColInd, __pyx_v_outRowPtr, __pyx_v_tol);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_160ccsr2csr_compress(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_inVal, size_t __pyx_v_inColInd, size_t __pyx_v_inRowPtr, int __pyx_v_inNnz, size_t __pyx_v_nnzPerRow, size_t __pyx_v_outVal, size_t __pyx_v_outColInd, size_t __pyx_v_outRowPtr, __pyx_t_double_complex __pyx_v_tol) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsr2csr_compress", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ccsr2csr_compress(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_inVal, __pyx_v_inColInd, __pyx_v_inRowPtr, __pyx_v_inNnz, __pyx_v_nnzPerRow, __pyx_v_outVal, __pyx_v_outColInd, __pyx_v_outRowPtr, __pyx_v_tol, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2404
 *     check_status(status)
 * 
 * cpdef zcsr2csr_compress(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t inVal, size_t inColInd, size_t inRowPtr,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_163zcsr2csr_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsr2csr_compress(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_inVal, size_t __pyx_v_inColInd, size_t __pyx_v_inRowPtr, int __pyx_v_inNnz, size_t __pyx_v_nnzPerRow, size_t __pyx_v_outVal, size_t __pyx_v_outColInd, size_t __pyx_v_outRowPtr, __pyx_t_double_complex __pyx_v_tol, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsr2csr_compress", 0);

  /* "cupy/cuda/cusparse.pyx":2409
 *         int inNnz, size_t nnzPerRow, size_t outVal, size_t outColInd,
 *         size_t outRowPtr, double complex tol):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZcsr2csr_compress(
 *         <Handle>handle, m, n, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2410
 *         size_t outRowPtr, double complex tol):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZcsr2csr_compress(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <MatDescr>descrA,
 *         <const cuDoubleComplex *>inVal, <const int *>inColInd,
 */
  __pyx_v_status = cusparseZcsr2csr_compress(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t)__pyx_v_descrA), ((cuDoubleComplex const *)__pyx_v_inVal), ((int const *)__pyx_v_inColInd), ((int const *)__pyx_v_inRowPtr), __pyx_v_inNnz, ((int *)__pyx_v_nnzPerRow), ((cuDoubleComplex *)__pyx_v_outVal), ((int *)__pyx_v_outColInd), ((int *)__pyx_v_outRowPtr), __pyx_f_4cupy_4cuda_8cusparse_double_complex_to_cuda(__pyx_v_tol));

  /* "cupy/cuda/cusparse.pyx":2416
 *         inNnz, <int *>nnzPerRow, <cuDoubleComplex *>outVal, <int *>outColInd,
 *         <int *>outRowPtr, double_complex_to_cuda(tol))
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef sdense2csc(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2404
 *     check_status(status)
 * 
 * cpdef zcsr2csr_compress(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t inVal, size_t inColInd, size_t inRowPtr,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_163zcsr2csr_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_162zcsr2csr_compress[] = "zcsr2csr_compress(size_t handle, int m, int n, size_t descrA, size_t inVal, size_t inColInd, size_t inRowPtr, int inNnz, size_t nnzPerRow, size_t outVal, size_t outColInd, size_t outRowPtr, double complex tol)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_163zcsr2csr_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_inVal;
  size_t __pyx_v_inColInd;
  size_t __pyx_v_inRowPtr;
  int __pyx_v_inNnz;
  size_t __pyx_v_nnzPerRow;
  size_t __pyx_v_outVal;
  size_t __pyx_v_outColInd;
  size_t __pyx_v_outRowPtr;
  __pyx_t_double_complex __pyx_v_tol;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsr2csr_compress (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_inVal,&__pyx_n_s_inColInd,&__pyx_n_s_inRowPtr,&__pyx_n_s_inNnz,&__pyx_n_s_nnzPerRow,&__pyx_n_s_outVal,&__pyx_n_s_outColInd,&__pyx_n_s_outRowPtr,&__pyx_n_s_tol,0};
    PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csr_compress", 1, 13, 13, 1); __PYX_ERR(0, 2404, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csr_compress", 1, 13, 13, 2); __PYX_ERR(0, 2404, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csr_compress", 1, 13, 13, 3); __PYX_ERR(0, 2404, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csr_compress", 1, 13, 13, 4); __PYX_ERR(0, 2404, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csr_compress", 1, 13, 13, 5); __PYX_ERR(0, 2404, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csr_compress", 1, 13, 13, 6); __PYX_ERR(0, 2404, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inNnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csr_compress", 1, 13, 13, 7); __PYX_ERR(0, 2404, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerRow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csr_compress", 1, 13, 13, 8); __PYX_ERR(0, 2404, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csr_compress", 1, 13, 13, 9); __PYX_ERR(0, 2404, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csr_compress", 1, 13, 13, 10); __PYX_ERR(0, 2404, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csr_compress", 1, 13, 13, 11); __PYX_ERR(0, 2404, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsr2csr_compress", 1, 13, 13, 12); __PYX_ERR(0, 2404, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsr2csr_compress") < 0)) __PYX_ERR(0, 2404, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 13) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2405, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2405, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2405, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2405, __pyx_L3_error)
    __pyx_v_inVal = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_inVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2406, __pyx_L3_error)
    __pyx_v_inColInd = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_inColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2406, __pyx_L3_error)
    __pyx_v_inRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_inRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2406, __pyx_L3_error)
    __pyx_v_inNnz = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_inNnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2407, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2407, __pyx_L3_error)
    __pyx_v_outVal = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_outVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2407, __pyx_L3_error)
    __pyx_v_outColInd = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_outColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2407, __pyx_L3_error)
    __pyx_v_outRowPtr = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_outRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2408, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyComplex_As___pyx_t_double_complex(values[12]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2408, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsr2csr_compress", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2404, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_162zcsr2csr_compress(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_inVal, __pyx_v_inColInd, __pyx_v_inRowPtr, __pyx_v_inNnz, __pyx_v_nnzPerRow, __pyx_v_outVal, __pyx_v_outColInd, __pyx_v_outRowPtr, __pyx_v_tol);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_162zcsr2csr_compress(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_inVal, size_t __pyx_v_inColInd, size_t __pyx_v_inRowPtr, int __pyx_v_inNnz, size_t __pyx_v_nnzPerRow, size_t __pyx_v_outVal, size_t __pyx_v_outColInd, size_t __pyx_v_outRowPtr, __pyx_t_double_complex __pyx_v_tol) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsr2csr_compress", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zcsr2csr_compress(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_inVal, __pyx_v_inColInd, __pyx_v_inRowPtr, __pyx_v_inNnz, __pyx_v_nnzPerRow, __pyx_v_outVal, __pyx_v_outColInd, __pyx_v_outRowPtr, __pyx_v_tol, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsr2csr_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2418
 *     check_status(status)
 * 
 * cpdef sdense2csc(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA, size_t A,
 *         int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_165sdense2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sdense2csc(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerCol, size_t __pyx_v_cscValA, size_t __pyx_v_cscRowIndA, size_t __pyx_v_cscColPtrA, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sdense2csc", 0);

  /* "cupy/cuda/cusparse.pyx":2422
 *         int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA,
 *         size_t cscColPtrA):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseSdense2csc(
 *         <Handle>handle, m, n, <const MatDescr>descrA, <const float *>A,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2423
 *         size_t cscColPtrA):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseSdense2csc(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const MatDescr>descrA, <const float *>A,
 *         lda, <const int *>nnzPerCol, <float *>cscValA, <int *>cscRowIndA,
 */
  __pyx_v_status = cusparseSdense2csc(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t const )__pyx_v_descrA), ((float const *)__pyx_v_A), __pyx_v_lda, ((int const *)__pyx_v_nnzPerCol), ((float *)__pyx_v_cscValA), ((int *)__pyx_v_cscRowIndA), ((int *)__pyx_v_cscColPtrA));

  /* "cupy/cuda/cusparse.pyx":2427
 *         lda, <const int *>nnzPerCol, <float *>cscValA, <int *>cscRowIndA,
 *         <int *>cscColPtrA)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2418
 *     check_status(status)
 * 
 * cpdef sdense2csc(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA, size_t A,
 *         int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sdense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_165sdense2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_164sdense2csc[] = "sdense2csc(size_t handle, int m, int n, size_t descrA, size_t A, int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA, size_t cscColPtrA)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_165sdense2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  size_t __pyx_v_nnzPerCol;
  size_t __pyx_v_cscValA;
  size_t __pyx_v_cscRowIndA;
  size_t __pyx_v_cscColPtrA;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sdense2csc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_A,&__pyx_n_s_lda,&__pyx_n_s_nnzPerCol,&__pyx_n_s_cscValA,&__pyx_n_s_cscRowIndA,&__pyx_n_s_cscColPtrA,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csc", 1, 10, 10, 1); __PYX_ERR(0, 2418, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csc", 1, 10, 10, 2); __PYX_ERR(0, 2418, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csc", 1, 10, 10, 3); __PYX_ERR(0, 2418, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csc", 1, 10, 10, 4); __PYX_ERR(0, 2418, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csc", 1, 10, 10, 5); __PYX_ERR(0, 2418, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerCol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csc", 1, 10, 10, 6); __PYX_ERR(0, 2418, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csc", 1, 10, 10, 7); __PYX_ERR(0, 2418, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscRowIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csc", 1, 10, 10, 8); __PYX_ERR(0, 2418, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscColPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csc", 1, 10, 10, 9); __PYX_ERR(0, 2418, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sdense2csc") < 0)) __PYX_ERR(0, 2418, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2419, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2419, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2419, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2419, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2419, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2420, __pyx_L3_error)
    __pyx_v_nnzPerCol = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_nnzPerCol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2420, __pyx_L3_error)
    __pyx_v_cscValA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_cscValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2420, __pyx_L3_error)
    __pyx_v_cscRowIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_cscRowIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2420, __pyx_L3_error)
    __pyx_v_cscColPtrA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_cscColPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2421, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sdense2csc", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2418, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sdense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_164sdense2csc(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerCol, __pyx_v_cscValA, __pyx_v_cscRowIndA, __pyx_v_cscColPtrA);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_164sdense2csc(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerCol, size_t __pyx_v_cscValA, size_t __pyx_v_cscRowIndA, size_t __pyx_v_cscColPtrA) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sdense2csc", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_sdense2csc(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerCol, __pyx_v_cscValA, __pyx_v_cscRowIndA, __pyx_v_cscColPtrA, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sdense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2430
 * 
 * 
 * cpdef ddense2csc(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA, size_t A,
 *         int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_167ddense2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ddense2csc(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerCol, size_t __pyx_v_cscValA, size_t __pyx_v_cscRowIndA, size_t __pyx_v_cscColPtrA, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ddense2csc", 0);

  /* "cupy/cuda/cusparse.pyx":2434
 *         int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA,
 *         size_t cscColPtrA):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDdense2csc(
 *         <Handle>handle, m, n, <const MatDescr>descrA, <const double *>A,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2435
 *         size_t cscColPtrA):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDdense2csc(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const MatDescr>descrA, <const double *>A,
 *         lda, <const int *>nnzPerCol, <double *>cscValA, <int *>cscRowIndA,
 */
  __pyx_v_status = cusparseDdense2csc(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t const )__pyx_v_descrA), ((double const *)__pyx_v_A), __pyx_v_lda, ((int const *)__pyx_v_nnzPerCol), ((double *)__pyx_v_cscValA), ((int *)__pyx_v_cscRowIndA), ((int *)__pyx_v_cscColPtrA));

  /* "cupy/cuda/cusparse.pyx":2439
 *         lda, <const int *>nnzPerCol, <double *>cscValA, <int *>cscRowIndA,
 *         <int *>cscColPtrA)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cdense2csc(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2430
 * 
 * 
 * cpdef ddense2csc(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA, size_t A,
 *         int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ddense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_167ddense2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_166ddense2csc[] = "ddense2csc(size_t handle, int m, int n, size_t descrA, size_t A, int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA, size_t cscColPtrA)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_167ddense2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  size_t __pyx_v_nnzPerCol;
  size_t __pyx_v_cscValA;
  size_t __pyx_v_cscRowIndA;
  size_t __pyx_v_cscColPtrA;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ddense2csc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_A,&__pyx_n_s_lda,&__pyx_n_s_nnzPerCol,&__pyx_n_s_cscValA,&__pyx_n_s_cscRowIndA,&__pyx_n_s_cscColPtrA,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csc", 1, 10, 10, 1); __PYX_ERR(0, 2430, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csc", 1, 10, 10, 2); __PYX_ERR(0, 2430, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csc", 1, 10, 10, 3); __PYX_ERR(0, 2430, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csc", 1, 10, 10, 4); __PYX_ERR(0, 2430, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csc", 1, 10, 10, 5); __PYX_ERR(0, 2430, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerCol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csc", 1, 10, 10, 6); __PYX_ERR(0, 2430, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csc", 1, 10, 10, 7); __PYX_ERR(0, 2430, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscRowIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csc", 1, 10, 10, 8); __PYX_ERR(0, 2430, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscColPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csc", 1, 10, 10, 9); __PYX_ERR(0, 2430, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ddense2csc") < 0)) __PYX_ERR(0, 2430, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2431, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2431, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2431, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2431, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2431, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2432, __pyx_L3_error)
    __pyx_v_nnzPerCol = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_nnzPerCol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2432, __pyx_L3_error)
    __pyx_v_cscValA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_cscValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2432, __pyx_L3_error)
    __pyx_v_cscRowIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_cscRowIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2432, __pyx_L3_error)
    __pyx_v_cscColPtrA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_cscColPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2433, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ddense2csc", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2430, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ddense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_166ddense2csc(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerCol, __pyx_v_cscValA, __pyx_v_cscRowIndA, __pyx_v_cscColPtrA);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_166ddense2csc(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerCol, size_t __pyx_v_cscValA, size_t __pyx_v_cscRowIndA, size_t __pyx_v_cscColPtrA) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ddense2csc", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ddense2csc(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerCol, __pyx_v_cscValA, __pyx_v_cscRowIndA, __pyx_v_cscColPtrA, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ddense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2441
 *     check_status(status)
 * 
 * cpdef cdense2csc(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA, size_t A,
 *         int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_169cdense2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cdense2csc(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerCol, size_t __pyx_v_cscValA, size_t __pyx_v_cscRowIndA, size_t __pyx_v_cscColPtrA, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cdense2csc", 0);

  /* "cupy/cuda/cusparse.pyx":2445
 *         int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA,
 *         size_t cscColPtrA):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCdense2csc(
 *         <Handle>handle, m, n, <const MatDescr>descrA, <const cuComplex *>A,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2446
 *         size_t cscColPtrA):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCdense2csc(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <const MatDescr>descrA, <const cuComplex *>A,
 *         lda, <const int *>nnzPerCol, <cuComplex *>cscValA, <int *>cscRowIndA,
 */
  __pyx_v_status = cusparseCdense2csc(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex const *)__pyx_v_A), __pyx_v_lda, ((int const *)__pyx_v_nnzPerCol), ((cuComplex *)__pyx_v_cscValA), ((int *)__pyx_v_cscRowIndA), ((int *)__pyx_v_cscColPtrA));

  /* "cupy/cuda/cusparse.pyx":2450
 *         lda, <const int *>nnzPerCol, <cuComplex *>cscValA, <int *>cscRowIndA,
 *         <int *>cscColPtrA)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zdense2csc(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2441
 *     check_status(status)
 * 
 * cpdef cdense2csc(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA, size_t A,
 *         int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cdense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_169cdense2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_168cdense2csc[] = "cdense2csc(size_t handle, int m, int n, size_t descrA, size_t A, int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA, size_t cscColPtrA)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_169cdense2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  size_t __pyx_v_nnzPerCol;
  size_t __pyx_v_cscValA;
  size_t __pyx_v_cscRowIndA;
  size_t __pyx_v_cscColPtrA;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cdense2csc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_A,&__pyx_n_s_lda,&__pyx_n_s_nnzPerCol,&__pyx_n_s_cscValA,&__pyx_n_s_cscRowIndA,&__pyx_n_s_cscColPtrA,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csc", 1, 10, 10, 1); __PYX_ERR(0, 2441, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csc", 1, 10, 10, 2); __PYX_ERR(0, 2441, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csc", 1, 10, 10, 3); __PYX_ERR(0, 2441, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csc", 1, 10, 10, 4); __PYX_ERR(0, 2441, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csc", 1, 10, 10, 5); __PYX_ERR(0, 2441, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerCol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csc", 1, 10, 10, 6); __PYX_ERR(0, 2441, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csc", 1, 10, 10, 7); __PYX_ERR(0, 2441, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscRowIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csc", 1, 10, 10, 8); __PYX_ERR(0, 2441, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscColPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csc", 1, 10, 10, 9); __PYX_ERR(0, 2441, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cdense2csc") < 0)) __PYX_ERR(0, 2441, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2443, __pyx_L3_error)
    __pyx_v_nnzPerCol = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_nnzPerCol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2443, __pyx_L3_error)
    __pyx_v_cscValA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_cscValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2443, __pyx_L3_error)
    __pyx_v_cscRowIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_cscRowIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2443, __pyx_L3_error)
    __pyx_v_cscColPtrA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_cscColPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2444, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cdense2csc", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2441, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cdense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_168cdense2csc(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerCol, __pyx_v_cscValA, __pyx_v_cscRowIndA, __pyx_v_cscColPtrA);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_168cdense2csc(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerCol, size_t __pyx_v_cscValA, size_t __pyx_v_cscRowIndA, size_t __pyx_v_cscColPtrA) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cdense2csc", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cdense2csc(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerCol, __pyx_v_cscValA, __pyx_v_cscRowIndA, __pyx_v_cscColPtrA, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cdense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2452
 *     check_status(status)
 * 
 * cpdef zdense2csc(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA, size_t A,
 *         int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_171zdense2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zdense2csc(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerCol, size_t __pyx_v_cscValA, size_t __pyx_v_cscRowIndA, size_t __pyx_v_cscColPtrA, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zdense2csc", 0);

  /* "cupy/cuda/cusparse.pyx":2456
 *         int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA,
 *         size_t cscColPtrA):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZdense2csc(
 *         <Handle>handle, m, n,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2457
 *         size_t cscColPtrA):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZdense2csc(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n,
 *         <const MatDescr>descrA, <const cuDoubleComplex *>A,
 */
  __pyx_v_status = cusparseZdense2csc(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex const *)__pyx_v_A), __pyx_v_lda, ((int const *)__pyx_v_nnzPerCol), ((cuDoubleComplex *)__pyx_v_cscValA), ((int *)__pyx_v_cscRowIndA), ((int *)__pyx_v_cscColPtrA));

  /* "cupy/cuda/cusparse.pyx":2463
 *         <cuDoubleComplex *>cscValA, <int *>cscRowIndA,
 *         <int *>cscColPtrA)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef sdense2csr(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2452
 *     check_status(status)
 * 
 * cpdef zdense2csc(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA, size_t A,
 *         int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zdense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_171zdense2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_170zdense2csc[] = "zdense2csc(size_t handle, int m, int n, size_t descrA, size_t A, int lda, size_t nnzPerCol, size_t cscValA, size_t cscRowIndA, size_t cscColPtrA)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_171zdense2csc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  size_t __pyx_v_nnzPerCol;
  size_t __pyx_v_cscValA;
  size_t __pyx_v_cscRowIndA;
  size_t __pyx_v_cscColPtrA;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zdense2csc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_A,&__pyx_n_s_lda,&__pyx_n_s_nnzPerCol,&__pyx_n_s_cscValA,&__pyx_n_s_cscRowIndA,&__pyx_n_s_cscColPtrA,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csc", 1, 10, 10, 1); __PYX_ERR(0, 2452, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csc", 1, 10, 10, 2); __PYX_ERR(0, 2452, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csc", 1, 10, 10, 3); __PYX_ERR(0, 2452, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csc", 1, 10, 10, 4); __PYX_ERR(0, 2452, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csc", 1, 10, 10, 5); __PYX_ERR(0, 2452, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerCol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csc", 1, 10, 10, 6); __PYX_ERR(0, 2452, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csc", 1, 10, 10, 7); __PYX_ERR(0, 2452, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscRowIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csc", 1, 10, 10, 8); __PYX_ERR(0, 2452, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscColPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csc", 1, 10, 10, 9); __PYX_ERR(0, 2452, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zdense2csc") < 0)) __PYX_ERR(0, 2452, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2453, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2453, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2453, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2453, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2453, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2454, __pyx_L3_error)
    __pyx_v_nnzPerCol = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_nnzPerCol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2454, __pyx_L3_error)
    __pyx_v_cscValA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_cscValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2454, __pyx_L3_error)
    __pyx_v_cscRowIndA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_cscRowIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2454, __pyx_L3_error)
    __pyx_v_cscColPtrA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_cscColPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2455, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zdense2csc", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2452, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zdense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_170zdense2csc(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerCol, __pyx_v_cscValA, __pyx_v_cscRowIndA, __pyx_v_cscColPtrA);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_170zdense2csc(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerCol, size_t __pyx_v_cscValA, size_t __pyx_v_cscRowIndA, size_t __pyx_v_cscColPtrA) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zdense2csc", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zdense2csc(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerCol, __pyx_v_cscValA, __pyx_v_cscRowIndA, __pyx_v_cscColPtrA, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zdense2csc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2465
 *     check_status(status)
 * 
 * cpdef sdense2csr(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_173sdense2csr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sdense2csr(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRow, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sdense2csr", 0);

  /* "cupy/cuda/cusparse.pyx":2469
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
 *         size_t csrRowPtrA, size_t csrColIndA):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseSdense2csr(
 *         <Handle>handle, m, n, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2470
 *         size_t csrRowPtrA, size_t csrColIndA):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseSdense2csr(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <MatDescr>descrA,
 *         <const float *>A, lda, <const int *>nnzPerRow, <float *>csrValA,
 */
  __pyx_v_status = cusparseSdense2csr(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t)__pyx_v_descrA), ((float const *)__pyx_v_A), __pyx_v_lda, ((int const *)__pyx_v_nnzPerRow), ((float *)__pyx_v_csrValA), ((int *)__pyx_v_csrRowPtrA), ((int *)__pyx_v_csrColIndA));

  /* "cupy/cuda/cusparse.pyx":2474
 *         <const float *>A, lda, <const int *>nnzPerRow, <float *>csrValA,
 *         <int *>csrRowPtrA, <int *>csrColIndA)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2465
 *     check_status(status)
 * 
 * cpdef sdense2csr(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sdense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_173sdense2csr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_172sdense2csr[] = "sdense2csr(size_t handle, int m, int n, size_t descrA, size_t A, int lda, size_t nnzPerRow, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_173sdense2csr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  size_t __pyx_v_nnzPerRow;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sdense2csr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_A,&__pyx_n_s_lda,&__pyx_n_s_nnzPerRow,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csr", 1, 10, 10, 1); __PYX_ERR(0, 2465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csr", 1, 10, 10, 2); __PYX_ERR(0, 2465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csr", 1, 10, 10, 3); __PYX_ERR(0, 2465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csr", 1, 10, 10, 4); __PYX_ERR(0, 2465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csr", 1, 10, 10, 5); __PYX_ERR(0, 2465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerRow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csr", 1, 10, 10, 6); __PYX_ERR(0, 2465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csr", 1, 10, 10, 7); __PYX_ERR(0, 2465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csr", 1, 10, 10, 8); __PYX_ERR(0, 2465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sdense2csr", 1, 10, 10, 9); __PYX_ERR(0, 2465, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sdense2csr") < 0)) __PYX_ERR(0, 2465, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2466, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2466, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2466, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2466, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2467, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2467, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2467, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2467, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2468, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2468, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sdense2csr", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2465, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sdense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_172sdense2csr(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerRow, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_172sdense2csr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRow, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sdense2csr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_sdense2csr(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerRow, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sdense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2477
 * 
 * 
 * cpdef ddense2csr(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_175ddense2csr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ddense2csr(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRow, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ddense2csr", 0);

  /* "cupy/cuda/cusparse.pyx":2481
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
 *         size_t csrRowPtrA, size_t csrColIndA):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDdense2csr(
 *         <Handle>handle, m, n, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2482
 *         size_t csrRowPtrA, size_t csrColIndA):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDdense2csr(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <MatDescr>descrA,
 *         <const double *>A, lda, <const int *>nnzPerRow, <double *>csrValA,
 */
  __pyx_v_status = cusparseDdense2csr(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t)__pyx_v_descrA), ((double const *)__pyx_v_A), __pyx_v_lda, ((int const *)__pyx_v_nnzPerRow), ((double *)__pyx_v_csrValA), ((int *)__pyx_v_csrRowPtrA), ((int *)__pyx_v_csrColIndA));

  /* "cupy/cuda/cusparse.pyx":2486
 *         <const double *>A, lda, <const int *>nnzPerRow, <double *>csrValA,
 *         <int *>csrRowPtrA, <int *>csrColIndA)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cdense2csr(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2477
 * 
 * 
 * cpdef ddense2csr(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ddense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_175ddense2csr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_174ddense2csr[] = "ddense2csr(size_t handle, int m, int n, size_t descrA, size_t A, int lda, size_t nnzPerRow, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_175ddense2csr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  size_t __pyx_v_nnzPerRow;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ddense2csr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_A,&__pyx_n_s_lda,&__pyx_n_s_nnzPerRow,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csr", 1, 10, 10, 1); __PYX_ERR(0, 2477, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csr", 1, 10, 10, 2); __PYX_ERR(0, 2477, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csr", 1, 10, 10, 3); __PYX_ERR(0, 2477, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csr", 1, 10, 10, 4); __PYX_ERR(0, 2477, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csr", 1, 10, 10, 5); __PYX_ERR(0, 2477, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerRow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csr", 1, 10, 10, 6); __PYX_ERR(0, 2477, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csr", 1, 10, 10, 7); __PYX_ERR(0, 2477, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csr", 1, 10, 10, 8); __PYX_ERR(0, 2477, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ddense2csr", 1, 10, 10, 9); __PYX_ERR(0, 2477, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ddense2csr") < 0)) __PYX_ERR(0, 2477, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2478, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2478, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2478, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2478, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2479, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2479, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2479, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2479, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2480, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2480, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ddense2csr", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2477, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ddense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_174ddense2csr(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerRow, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_174ddense2csr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRow, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ddense2csr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ddense2csr(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerRow, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ddense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2488
 *     check_status(status)
 * 
 * cpdef cdense2csr(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_177cdense2csr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cdense2csr(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRow, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cdense2csr", 0);

  /* "cupy/cuda/cusparse.pyx":2492
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
 *         size_t csrRowPtrA, size_t csrColIndA):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCdense2csr(
 *         <Handle>handle, m, n, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2493
 *         size_t csrRowPtrA, size_t csrColIndA):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCdense2csr(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <MatDescr>descrA,
 *         <const cuComplex *>A, lda, <const int *>nnzPerRow,
 */
  __pyx_v_status = cusparseCdense2csr(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t)__pyx_v_descrA), ((cuComplex const *)__pyx_v_A), __pyx_v_lda, ((int const *)__pyx_v_nnzPerRow), ((cuComplex *)__pyx_v_csrValA), ((int *)__pyx_v_csrRowPtrA), ((int *)__pyx_v_csrColIndA));

  /* "cupy/cuda/cusparse.pyx":2497
 *         <const cuComplex *>A, lda, <const int *>nnzPerRow,
 *         <cuComplex *>csrValA, <int *>csrRowPtrA, <int *>csrColIndA)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zdense2csr(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2488
 *     check_status(status)
 * 
 * cpdef cdense2csr(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cdense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_177cdense2csr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_176cdense2csr[] = "cdense2csr(size_t handle, int m, int n, size_t descrA, size_t A, int lda, size_t nnzPerRow, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_177cdense2csr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  size_t __pyx_v_nnzPerRow;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cdense2csr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_A,&__pyx_n_s_lda,&__pyx_n_s_nnzPerRow,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csr", 1, 10, 10, 1); __PYX_ERR(0, 2488, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csr", 1, 10, 10, 2); __PYX_ERR(0, 2488, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csr", 1, 10, 10, 3); __PYX_ERR(0, 2488, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csr", 1, 10, 10, 4); __PYX_ERR(0, 2488, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csr", 1, 10, 10, 5); __PYX_ERR(0, 2488, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerRow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csr", 1, 10, 10, 6); __PYX_ERR(0, 2488, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csr", 1, 10, 10, 7); __PYX_ERR(0, 2488, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csr", 1, 10, 10, 8); __PYX_ERR(0, 2488, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cdense2csr", 1, 10, 10, 9); __PYX_ERR(0, 2488, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cdense2csr") < 0)) __PYX_ERR(0, 2488, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2489, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2489, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2489, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2489, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2490, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2490, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2490, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2490, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2491, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2491, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cdense2csr", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2488, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cdense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_176cdense2csr(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerRow, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_176cdense2csr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRow, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cdense2csr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cdense2csr(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerRow, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cdense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2499
 *     check_status(status)
 * 
 * cpdef zdense2csr(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_179zdense2csr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zdense2csr(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRow, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zdense2csr", 0);

  /* "cupy/cuda/cusparse.pyx":2503
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
 *         size_t csrRowPtrA, size_t csrColIndA):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZdense2csr(
 *         <Handle>handle, m, n, <MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2504
 *         size_t csrRowPtrA, size_t csrColIndA):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZdense2csr(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, <MatDescr>descrA,
 *         <const cuDoubleComplex *>A, lda, <const int *>nnzPerRow,
 */
  __pyx_v_status = cusparseZdense2csr(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t)__pyx_v_descrA), ((cuDoubleComplex const *)__pyx_v_A), __pyx_v_lda, ((int const *)__pyx_v_nnzPerRow), ((cuDoubleComplex *)__pyx_v_csrValA), ((int *)__pyx_v_csrRowPtrA), ((int *)__pyx_v_csrColIndA));

  /* "cupy/cuda/cusparse.pyx":2508
 *         <const cuDoubleComplex *>A, lda, <const int *>nnzPerRow,
 *         <cuDoubleComplex *>csrValA, <int *>csrRowPtrA, <int *>csrColIndA)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef snnz(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2499
 *     check_status(status)
 * 
 * cpdef zdense2csr(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRow, size_t csrValA,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zdense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_179zdense2csr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_178zdense2csr[] = "zdense2csr(size_t handle, int m, int n, size_t descrA, size_t A, int lda, size_t nnzPerRow, size_t csrValA, size_t csrRowPtrA, size_t csrColIndA)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_179zdense2csr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  size_t __pyx_v_nnzPerRow;
  size_t __pyx_v_csrValA;
  size_t __pyx_v_csrRowPtrA;
  size_t __pyx_v_csrColIndA;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zdense2csr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_A,&__pyx_n_s_lda,&__pyx_n_s_nnzPerRow,&__pyx_n_s_csrValA,&__pyx_n_s_csrRowPtrA,&__pyx_n_s_csrColIndA,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csr", 1, 10, 10, 1); __PYX_ERR(0, 2499, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csr", 1, 10, 10, 2); __PYX_ERR(0, 2499, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csr", 1, 10, 10, 3); __PYX_ERR(0, 2499, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csr", 1, 10, 10, 4); __PYX_ERR(0, 2499, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csr", 1, 10, 10, 5); __PYX_ERR(0, 2499, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerRow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csr", 1, 10, 10, 6); __PYX_ERR(0, 2499, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csr", 1, 10, 10, 7); __PYX_ERR(0, 2499, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csr", 1, 10, 10, 8); __PYX_ERR(0, 2499, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zdense2csr", 1, 10, 10, 9); __PYX_ERR(0, 2499, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zdense2csr") < 0)) __PYX_ERR(0, 2499, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2500, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2500, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2500, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2500, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2501, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2501, __pyx_L3_error)
    __pyx_v_nnzPerRow = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_nnzPerRow == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2501, __pyx_L3_error)
    __pyx_v_csrValA = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_csrValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2501, __pyx_L3_error)
    __pyx_v_csrRowPtrA = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_csrRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2502, __pyx_L3_error)
    __pyx_v_csrColIndA = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_csrColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2502, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zdense2csr", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2499, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zdense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_178zdense2csr(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerRow, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_178zdense2csr(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRow, size_t __pyx_v_csrValA, size_t __pyx_v_csrRowPtrA, size_t __pyx_v_csrColIndA) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zdense2csr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zdense2csr(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerRow, __pyx_v_csrValA, __pyx_v_csrRowPtrA, __pyx_v_csrColIndA, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zdense2csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2510
 *     check_status(status)
 * 
 * cpdef snnz(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_181snnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_snnz(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRowColumn, size_t __pyx_v_nnzTotalDevHostPtr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("snnz", 0);

  /* "cupy/cuda/cusparse.pyx":2513
 *         size_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseSnnz(
 *         <Handle>handle, <Direction>dirA, m, n, <const MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2514
 *         size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseSnnz(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Direction>dirA, m, n, <const MatDescr>descrA,
 *         <const float *>A, lda, <int *>nnzPerRowColumn,
 */
  __pyx_v_status = cusparseSnnz(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t const )__pyx_v_descrA), ((float const *)__pyx_v_A), __pyx_v_lda, ((int *)__pyx_v_nnzPerRowColumn), ((int *)__pyx_v_nnzTotalDevHostPtr));

  /* "cupy/cuda/cusparse.pyx":2518
 *         <const float *>A, lda, <int *>nnzPerRowColumn,
 *         <int *>nnzTotalDevHostPtr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2510
 *     check_status(status)
 * 
 * cpdef snnz(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.snnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_181snnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_180snnz[] = "snnz(size_t handle, int dirA, int m, int n, size_t descrA, size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_181snnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  size_t __pyx_v_nnzPerRowColumn;
  size_t __pyx_v_nnzTotalDevHostPtr;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("snnz (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_A,&__pyx_n_s_lda,&__pyx_n_s_nnzPerRowColumn,&__pyx_n_s_nnzTotalDevHostPtr,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("snnz", 1, 9, 9, 1); __PYX_ERR(0, 2510, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("snnz", 1, 9, 9, 2); __PYX_ERR(0, 2510, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("snnz", 1, 9, 9, 3); __PYX_ERR(0, 2510, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("snnz", 1, 9, 9, 4); __PYX_ERR(0, 2510, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("snnz", 1, 9, 9, 5); __PYX_ERR(0, 2510, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("snnz", 1, 9, 9, 6); __PYX_ERR(0, 2510, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerRowColumn)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("snnz", 1, 9, 9, 7); __PYX_ERR(0, 2510, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzTotalDevHostPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("snnz", 1, 9, 9, 8); __PYX_ERR(0, 2510, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "snnz") < 0)) __PYX_ERR(0, 2510, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2511, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2511, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2511, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2511, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2511, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2512, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2512, __pyx_L3_error)
    __pyx_v_nnzPerRowColumn = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_nnzPerRowColumn == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2512, __pyx_L3_error)
    __pyx_v_nnzTotalDevHostPtr = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_nnzTotalDevHostPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2512, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("snnz", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2510, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.snnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_180snnz(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerRowColumn, __pyx_v_nnzTotalDevHostPtr);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_180snnz(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRowColumn, size_t __pyx_v_nnzTotalDevHostPtr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("snnz", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_snnz(__pyx_v_handle, __pyx_v_dirA, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerRowColumn, __pyx_v_nnzTotalDevHostPtr, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.snnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2521
 * 
 * 
 * cpdef dnnz(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_183dnnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dnnz(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRowColumn, size_t __pyx_v_nnzTotalDevHostPtr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnnz", 0);

  /* "cupy/cuda/cusparse.pyx":2524
 *         size_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseDnnz(
 *         <Handle>handle, <Direction>dirA, m, n, <const MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2525
 *         size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseDnnz(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Direction>dirA, m, n, <const MatDescr>descrA,
 *         <const double *>A, lda, <int *>nnzPerRowColumn,
 */
  __pyx_v_status = cusparseDnnz(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t const )__pyx_v_descrA), ((double const *)__pyx_v_A), __pyx_v_lda, ((int *)__pyx_v_nnzPerRowColumn), ((int *)__pyx_v_nnzTotalDevHostPtr));

  /* "cupy/cuda/cusparse.pyx":2529
 *         <const double *>A, lda, <int *>nnzPerRowColumn,
 *         <int *>nnzTotalDevHostPtr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cnnz(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2521
 * 
 * 
 * cpdef dnnz(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_183dnnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_182dnnz[] = "dnnz(size_t handle, int dirA, int m, int n, size_t descrA, size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_183dnnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  size_t __pyx_v_nnzPerRowColumn;
  size_t __pyx_v_nnzTotalDevHostPtr;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnnz (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_A,&__pyx_n_s_lda,&__pyx_n_s_nnzPerRowColumn,&__pyx_n_s_nnzTotalDevHostPtr,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnnz", 1, 9, 9, 1); __PYX_ERR(0, 2521, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnnz", 1, 9, 9, 2); __PYX_ERR(0, 2521, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnnz", 1, 9, 9, 3); __PYX_ERR(0, 2521, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnnz", 1, 9, 9, 4); __PYX_ERR(0, 2521, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnnz", 1, 9, 9, 5); __PYX_ERR(0, 2521, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnnz", 1, 9, 9, 6); __PYX_ERR(0, 2521, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerRowColumn)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnnz", 1, 9, 9, 7); __PYX_ERR(0, 2521, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzTotalDevHostPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnnz", 1, 9, 9, 8); __PYX_ERR(0, 2521, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dnnz") < 0)) __PYX_ERR(0, 2521, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2522, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2522, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2522, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2522, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2522, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2523, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2523, __pyx_L3_error)
    __pyx_v_nnzPerRowColumn = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_nnzPerRowColumn == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2523, __pyx_L3_error)
    __pyx_v_nnzTotalDevHostPtr = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_nnzTotalDevHostPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2523, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dnnz", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2521, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_182dnnz(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerRowColumn, __pyx_v_nnzTotalDevHostPtr);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_182dnnz(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRowColumn, size_t __pyx_v_nnzTotalDevHostPtr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnnz", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dnnz(__pyx_v_handle, __pyx_v_dirA, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerRowColumn, __pyx_v_nnzTotalDevHostPtr, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2531
 *     check_status(status)
 * 
 * cpdef cnnz(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_185cnnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cnnz(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRowColumn, size_t __pyx_v_nnzTotalDevHostPtr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cnnz", 0);

  /* "cupy/cuda/cusparse.pyx":2534
 *         size_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCnnz(
 *         <Handle>handle, <Direction>dirA, m, n, <const MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2535
 *         size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCnnz(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Direction>dirA, m, n, <const MatDescr>descrA,
 *         <const cuComplex *>A, lda, <int *>nnzPerRowColumn,
 */
  __pyx_v_status = cusparseCnnz(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex const *)__pyx_v_A), __pyx_v_lda, ((int *)__pyx_v_nnzPerRowColumn), ((int *)__pyx_v_nnzTotalDevHostPtr));

  /* "cupy/cuda/cusparse.pyx":2539
 *         <const cuComplex *>A, lda, <int *>nnzPerRowColumn,
 *         <int *>nnzTotalDevHostPtr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef znnz(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2531
 *     check_status(status)
 * 
 * cpdef cnnz(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cnnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_185cnnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_184cnnz[] = "cnnz(size_t handle, int dirA, int m, int n, size_t descrA, size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_185cnnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  size_t __pyx_v_nnzPerRowColumn;
  size_t __pyx_v_nnzTotalDevHostPtr;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cnnz (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_A,&__pyx_n_s_lda,&__pyx_n_s_nnzPerRowColumn,&__pyx_n_s_nnzTotalDevHostPtr,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cnnz", 1, 9, 9, 1); __PYX_ERR(0, 2531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cnnz", 1, 9, 9, 2); __PYX_ERR(0, 2531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cnnz", 1, 9, 9, 3); __PYX_ERR(0, 2531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cnnz", 1, 9, 9, 4); __PYX_ERR(0, 2531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cnnz", 1, 9, 9, 5); __PYX_ERR(0, 2531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cnnz", 1, 9, 9, 6); __PYX_ERR(0, 2531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerRowColumn)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cnnz", 1, 9, 9, 7); __PYX_ERR(0, 2531, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzTotalDevHostPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cnnz", 1, 9, 9, 8); __PYX_ERR(0, 2531, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cnnz") < 0)) __PYX_ERR(0, 2531, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2532, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2532, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2532, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2532, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2532, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2533, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2533, __pyx_L3_error)
    __pyx_v_nnzPerRowColumn = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_nnzPerRowColumn == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2533, __pyx_L3_error)
    __pyx_v_nnzTotalDevHostPtr = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_nnzTotalDevHostPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2533, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cnnz", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2531, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cnnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_184cnnz(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerRowColumn, __pyx_v_nnzTotalDevHostPtr);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_184cnnz(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRowColumn, size_t __pyx_v_nnzTotalDevHostPtr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cnnz", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cnnz(__pyx_v_handle, __pyx_v_dirA, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerRowColumn, __pyx_v_nnzTotalDevHostPtr, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cnnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2541
 *     check_status(status)
 * 
 * cpdef znnz(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_187znnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_znnz(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRowColumn, size_t __pyx_v_nnzTotalDevHostPtr, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("znnz", 0);

  /* "cupy/cuda/cusparse.pyx":2544
 *         size_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseZnnz(
 *         <Handle>handle, <Direction>dirA, m, n, <const MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2545
 *         size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseZnnz(             # <<<<<<<<<<<<<<
 *         <Handle>handle, <Direction>dirA, m, n, <const MatDescr>descrA,
 *         <const cuDoubleComplex *>A, lda, <int *>nnzPerRowColumn,
 */
  __pyx_v_status = cusparseZnnz(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_m, __pyx_v_n, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex const *)__pyx_v_A), __pyx_v_lda, ((int *)__pyx_v_nnzPerRowColumn), ((int *)__pyx_v_nnzTotalDevHostPtr));

  /* "cupy/cuda/cusparse.pyx":2549
 *         <const cuDoubleComplex *>A, lda, <int *>nnzPerRowColumn,
 *         <int *>nnzTotalDevHostPtr)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef createIdentityPermutation(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2541
 *     check_status(status)
 * 
 * cpdef znnz(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int m, int n, size_t descrA,
 *         size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.znnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_187znnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_186znnz[] = "znnz(size_t handle, int dirA, int m, int n, size_t descrA, size_t A, int lda, size_t nnzPerRowColumn, size_t nnzTotalDevHostPtr)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_187znnz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_descrA;
  size_t __pyx_v_A;
  int __pyx_v_lda;
  size_t __pyx_v_nnzPerRowColumn;
  size_t __pyx_v_nnzTotalDevHostPtr;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("znnz (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_descrA,&__pyx_n_s_A,&__pyx_n_s_lda,&__pyx_n_s_nnzPerRowColumn,&__pyx_n_s_nnzTotalDevHostPtr,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("znnz", 1, 9, 9, 1); __PYX_ERR(0, 2541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("znnz", 1, 9, 9, 2); __PYX_ERR(0, 2541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("znnz", 1, 9, 9, 3); __PYX_ERR(0, 2541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("znnz", 1, 9, 9, 4); __PYX_ERR(0, 2541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("znnz", 1, 9, 9, 5); __PYX_ERR(0, 2541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("znnz", 1, 9, 9, 6); __PYX_ERR(0, 2541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzPerRowColumn)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("znnz", 1, 9, 9, 7); __PYX_ERR(0, 2541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzTotalDevHostPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("znnz", 1, 9, 9, 8); __PYX_ERR(0, 2541, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "znnz") < 0)) __PYX_ERR(0, 2541, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2542, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2542, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2542, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2542, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2542, __pyx_L3_error)
    __pyx_v_A = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_A == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2543, __pyx_L3_error)
    __pyx_v_lda = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_lda == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2543, __pyx_L3_error)
    __pyx_v_nnzPerRowColumn = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_nnzPerRowColumn == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2543, __pyx_L3_error)
    __pyx_v_nnzTotalDevHostPtr = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_nnzTotalDevHostPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2543, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("znnz", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2541, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.znnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_186znnz(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerRowColumn, __pyx_v_nnzTotalDevHostPtr);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_186znnz(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_descrA, size_t __pyx_v_A, int __pyx_v_lda, size_t __pyx_v_nnzPerRowColumn, size_t __pyx_v_nnzTotalDevHostPtr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("znnz", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_znnz(__pyx_v_handle, __pyx_v_dirA, __pyx_v_m, __pyx_v_n, __pyx_v_descrA, __pyx_v_A, __pyx_v_lda, __pyx_v_nnzPerRowColumn, __pyx_v_nnzTotalDevHostPtr, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.znnz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2551
 *     check_status(status)
 * 
 * cpdef createIdentityPermutation(             # <<<<<<<<<<<<<<
 *         size_t handle, int n, size_t p):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_189createIdentityPermutation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_createIdentityPermutation(size_t __pyx_v_handle, int __pyx_v_n, size_t __pyx_v_p, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createIdentityPermutation", 0);

  /* "cupy/cuda/cusparse.pyx":2553
 * cpdef createIdentityPermutation(
 *         size_t handle, int n, size_t p):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCreateIdentityPermutation(
 *         <Handle>handle, n, <int *>p)
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2554
 *         size_t handle, int n, size_t p):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCreateIdentityPermutation(             # <<<<<<<<<<<<<<
 *         <Handle>handle, n, <int *>p)
 *     check_status(status)
 */
  __pyx_v_status = cusparseCreateIdentityPermutation(((cusparseHandle_t)__pyx_v_handle), __pyx_v_n, ((int *)__pyx_v_p));

  /* "cupy/cuda/cusparse.pyx":2556
 *     status = cusparseCreateIdentityPermutation(
 *         <Handle>handle, n, <int *>p)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2551
 *     check_status(status)
 * 
 * cpdef createIdentityPermutation(             # <<<<<<<<<<<<<<
 *         size_t handle, int n, size_t p):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.createIdentityPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_189createIdentityPermutation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_188createIdentityPermutation[] = "createIdentityPermutation(size_t handle, int n, size_t p)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_189createIdentityPermutation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_n;
  size_t __pyx_v_p;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createIdentityPermutation (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_n,&__pyx_n_s_p,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createIdentityPermutation", 1, 3, 3, 1); __PYX_ERR(0, 2551, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createIdentityPermutation", 1, 3, 3, 2); __PYX_ERR(0, 2551, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createIdentityPermutation") < 0)) __PYX_ERR(0, 2551, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2552, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2552, __pyx_L3_error)
    __pyx_v_p = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_p == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2552, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createIdentityPermutation", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2551, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.createIdentityPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_188createIdentityPermutation(__pyx_self, __pyx_v_handle, __pyx_v_n, __pyx_v_p);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_188createIdentityPermutation(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_n, size_t __pyx_v_p) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createIdentityPermutation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_createIdentityPermutation(__pyx_v_handle, __pyx_v_n, __pyx_v_p, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.createIdentityPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2559
 * 
 * 
 * cpdef size_t xcoosort_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t cooRows,
 *         size_t cooCols):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_191xcoosort_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_xcoosort_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_cooRows, size_t __pyx_v_cooCols, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcoosort_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":2563
 *         size_t cooCols):
 *     cdef size_t bufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseXcoosort_bufferSizeExt(
 *         <Handle>handle, m, n, nnz, <const int *>cooRows,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2564
 *     cdef size_t bufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseXcoosort_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, nnz, <const int *>cooRows,
 *         <const int *>cooCols, &bufferSizeInBytes)
 */
  __pyx_v_status = cusparseXcoosort_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((int const *)__pyx_v_cooRows), ((int const *)__pyx_v_cooCols), (&__pyx_v_bufferSizeInBytes));

  /* "cupy/cuda/cusparse.pyx":2567
 *         <Handle>handle, m, n, nnz, <const int *>cooRows,
 *         <const int *>cooCols, &bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2568
 *         <const int *>cooCols, &bufferSizeInBytes)
 *     check_status(status)
 *     return bufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_bufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2559
 * 
 * 
 * cpdef size_t xcoosort_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t cooRows,
 *         size_t cooCols):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.xcoosort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_191xcoosort_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_190xcoosort_bufferSizeExt[] = "xcoosort_bufferSizeExt(size_t handle, int m, int n, int nnz, size_t cooRows, size_t cooCols) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_191xcoosort_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  size_t __pyx_v_cooRows;
  size_t __pyx_v_cooCols;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcoosort_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_cooRows,&__pyx_n_s_cooCols,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoosort_bufferSizeExt", 1, 6, 6, 1); __PYX_ERR(0, 2559, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoosort_bufferSizeExt", 1, 6, 6, 2); __PYX_ERR(0, 2559, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoosort_bufferSizeExt", 1, 6, 6, 3); __PYX_ERR(0, 2559, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cooRows)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoosort_bufferSizeExt", 1, 6, 6, 4); __PYX_ERR(0, 2559, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cooCols)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoosort_bufferSizeExt", 1, 6, 6, 5); __PYX_ERR(0, 2559, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xcoosort_bufferSizeExt") < 0)) __PYX_ERR(0, 2559, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2560, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2560, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2560, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2560, __pyx_L3_error)
    __pyx_v_cooRows = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_cooRows == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2560, __pyx_L3_error)
    __pyx_v_cooCols = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_cooCols == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2561, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcoosort_bufferSizeExt", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2559, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcoosort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_190xcoosort_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_cooRows, __pyx_v_cooCols);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_190xcoosort_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_cooRows, size_t __pyx_v_cooCols) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcoosort_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_xcoosort_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_cooRows, __pyx_v_cooCols, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcoosort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2571
 * 
 * 
 * cpdef xcoosortByRow(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t cooRows, size_t cooCols,
 *         size_t P, size_t pBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_193xcoosortByRow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcoosortByRow(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_cooRows, size_t __pyx_v_cooCols, size_t __pyx_v_P, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcoosortByRow", 0);

  /* "cupy/cuda/cusparse.pyx":2574
 *         size_t handle, int m, int n, int nnz, size_t cooRows, size_t cooCols,
 *         size_t P, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseXcoosortByRow(
 *         <Handle>handle, m, n, nnz, <int *>cooRows, <int *>cooCols,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2575
 *         size_t P, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseXcoosortByRow(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, nnz, <int *>cooRows, <int *>cooCols,
 *         <int *>P, <void *>pBuffer)
 */
  __pyx_v_status = cusparseXcoosortByRow(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((int *)__pyx_v_cooRows), ((int *)__pyx_v_cooCols), ((int *)__pyx_v_P), ((void *)__pyx_v_pBuffer));

  /* "cupy/cuda/cusparse.pyx":2578
 *         <Handle>handle, m, n, nnz, <int *>cooRows, <int *>cooCols,
 *         <int *>P, <void *>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2571
 * 
 * 
 * cpdef xcoosortByRow(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t cooRows, size_t cooCols,
 *         size_t P, size_t pBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcoosortByRow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_193xcoosortByRow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_192xcoosortByRow[] = "xcoosortByRow(size_t handle, int m, int n, int nnz, size_t cooRows, size_t cooCols, size_t P, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_193xcoosortByRow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  size_t __pyx_v_cooRows;
  size_t __pyx_v_cooCols;
  size_t __pyx_v_P;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcoosortByRow (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_cooRows,&__pyx_n_s_cooCols,&__pyx_n_s_P,&__pyx_n_s_pBuffer,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoosortByRow", 1, 8, 8, 1); __PYX_ERR(0, 2571, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoosortByRow", 1, 8, 8, 2); __PYX_ERR(0, 2571, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoosortByRow", 1, 8, 8, 3); __PYX_ERR(0, 2571, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cooRows)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoosortByRow", 1, 8, 8, 4); __PYX_ERR(0, 2571, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cooCols)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoosortByRow", 1, 8, 8, 5); __PYX_ERR(0, 2571, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoosortByRow", 1, 8, 8, 6); __PYX_ERR(0, 2571, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcoosortByRow", 1, 8, 8, 7); __PYX_ERR(0, 2571, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xcoosortByRow") < 0)) __PYX_ERR(0, 2571, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2572, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2572, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2572, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2572, __pyx_L3_error)
    __pyx_v_cooRows = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_cooRows == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2572, __pyx_L3_error)
    __pyx_v_cooCols = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_cooCols == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2572, __pyx_L3_error)
    __pyx_v_P = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_P == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2573, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2573, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcoosortByRow", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2571, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcoosortByRow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_192xcoosortByRow(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_cooRows, __pyx_v_cooCols, __pyx_v_P, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_192xcoosortByRow(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_cooRows, size_t __pyx_v_cooCols, size_t __pyx_v_P, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcoosortByRow", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_xcoosortByRow(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_cooRows, __pyx_v_cooCols, __pyx_v_P, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcoosortByRow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2581
 * 
 * 
 * cpdef size_t xcsrsort_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t csrRowPtr,
 *         size_t csrColInd):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_195xcsrsort_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_xcsrsort_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsrsort_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":2585
 *         size_t csrColInd):
 *     cdef size_t bufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseXcsrsort_bufferSizeExt(
 *         <Handle>handle, m, n, nnz, <const int *>csrRowPtr,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2586
 *     cdef size_t bufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseXcsrsort_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, nnz, <const int *>csrRowPtr,
 *         <const int *>csrColInd, &bufferSizeInBytes)
 */
  __pyx_v_status = cusparseXcsrsort_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((int const *)__pyx_v_csrRowPtr), ((int const *)__pyx_v_csrColInd), (&__pyx_v_bufferSizeInBytes));

  /* "cupy/cuda/cusparse.pyx":2589
 *         <Handle>handle, m, n, nnz, <const int *>csrRowPtr,
 *         <const int *>csrColInd, &bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2590
 *         <const int *>csrColInd, &bufferSizeInBytes)
 *     check_status(status)
 *     return bufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_bufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2581
 * 
 * 
 * cpdef size_t xcsrsort_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t csrRowPtr,
 *         size_t csrColInd):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.xcsrsort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_195xcsrsort_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_194xcsrsort_bufferSizeExt[] = "xcsrsort_bufferSizeExt(size_t handle, int m, int n, int nnz, size_t csrRowPtr, size_t csrColInd) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_195xcsrsort_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  size_t __pyx_v_csrRowPtr;
  size_t __pyx_v_csrColInd;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsrsort_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_csrRowPtr,&__pyx_n_s_csrColInd,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrsort_bufferSizeExt", 1, 6, 6, 1); __PYX_ERR(0, 2581, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrsort_bufferSizeExt", 1, 6, 6, 2); __PYX_ERR(0, 2581, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrsort_bufferSizeExt", 1, 6, 6, 3); __PYX_ERR(0, 2581, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrsort_bufferSizeExt", 1, 6, 6, 4); __PYX_ERR(0, 2581, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrsort_bufferSizeExt", 1, 6, 6, 5); __PYX_ERR(0, 2581, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xcsrsort_bufferSizeExt") < 0)) __PYX_ERR(0, 2581, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2582, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2582, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2582, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2582, __pyx_L3_error)
    __pyx_v_csrRowPtr = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2582, __pyx_L3_error)
    __pyx_v_csrColInd = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2583, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsrsort_bufferSizeExt", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2581, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrsort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_194xcsrsort_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_csrRowPtr, __pyx_v_csrColInd);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_194xcsrsort_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsrsort_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_xcsrsort_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_csrRowPtr, __pyx_v_csrColInd, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrsort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2593
 * 
 * 
 * cpdef xcsrsort(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t descrA,
 *         size_t csrRowPtr, size_t csrColInd, size_t P, size_t pBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_197xcsrsort(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcsrsort(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd, size_t __pyx_v_P, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsrsort", 0);

  /* "cupy/cuda/cusparse.pyx":2596
 *         size_t handle, int m, int n, int nnz, size_t descrA,
 *         size_t csrRowPtr, size_t csrColInd, size_t P, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseXcsrsort(
 *         <Handle>handle, m, n, nnz, <const MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2597
 *         size_t csrRowPtr, size_t csrColInd, size_t P, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseXcsrsort(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, nnz, <const MatDescr>descrA,
 *         <const int *>csrRowPtr, <int *>csrColInd, <int *>P, <void *>pBuffer)
 */
  __pyx_v_status = cusparseXcsrsort(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((int const *)__pyx_v_csrRowPtr), ((int *)__pyx_v_csrColInd), ((int *)__pyx_v_P), ((void *)__pyx_v_pBuffer));

  /* "cupy/cuda/cusparse.pyx":2600
 *         <Handle>handle, m, n, nnz, <const MatDescr>descrA,
 *         <const int *>csrRowPtr, <int *>csrColInd, <int *>P, <void *>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2593
 * 
 * 
 * cpdef xcsrsort(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t descrA,
 *         size_t csrRowPtr, size_t csrColInd, size_t P, size_t pBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_197xcsrsort(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_196xcsrsort[] = "xcsrsort(size_t handle, int m, int n, int nnz, size_t descrA, size_t csrRowPtr, size_t csrColInd, size_t P, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_197xcsrsort(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrRowPtr;
  size_t __pyx_v_csrColInd;
  size_t __pyx_v_P;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsrsort (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrRowPtr,&__pyx_n_s_csrColInd,&__pyx_n_s_P,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrsort", 1, 9, 9, 1); __PYX_ERR(0, 2593, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrsort", 1, 9, 9, 2); __PYX_ERR(0, 2593, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrsort", 1, 9, 9, 3); __PYX_ERR(0, 2593, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrsort", 1, 9, 9, 4); __PYX_ERR(0, 2593, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrsort", 1, 9, 9, 5); __PYX_ERR(0, 2593, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrsort", 1, 9, 9, 6); __PYX_ERR(0, 2593, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrsort", 1, 9, 9, 7); __PYX_ERR(0, 2593, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrsort", 1, 9, 9, 8); __PYX_ERR(0, 2593, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xcsrsort") < 0)) __PYX_ERR(0, 2593, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2594, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2594, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2594, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2594, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2594, __pyx_L3_error)
    __pyx_v_csrRowPtr = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2595, __pyx_L3_error)
    __pyx_v_csrColInd = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2595, __pyx_L3_error)
    __pyx_v_P = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_P == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2595, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2595, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsrsort", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2593, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_196xcsrsort(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrRowPtr, __pyx_v_csrColInd, __pyx_v_P, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_196xcsrsort(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrRowPtr, size_t __pyx_v_csrColInd, size_t __pyx_v_P, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsrsort", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_xcsrsort(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrRowPtr, __pyx_v_csrColInd, __pyx_v_P, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2603
 * 
 * 
 * cpdef size_t xcscsort_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t cscColPtr,
 *         size_t cscRowInd):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_199xcscsort_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_xcscsort_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_cscColPtr, size_t __pyx_v_cscRowInd, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcscsort_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":2607
 *         size_t cscRowInd):
 *     cdef size_t bufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseXcscsort_bufferSizeExt(
 *         <Handle>handle, m, n, nnz, <const int *>cscColPtr,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2608
 *     cdef size_t bufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseXcscsort_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, nnz, <const int *>cscColPtr,
 *         <const int *>cscRowInd, &bufferSizeInBytes)
 */
  __pyx_v_status = cusparseXcscsort_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((int const *)__pyx_v_cscColPtr), ((int const *)__pyx_v_cscRowInd), (&__pyx_v_bufferSizeInBytes));

  /* "cupy/cuda/cusparse.pyx":2611
 *         <Handle>handle, m, n, nnz, <const int *>cscColPtr,
 *         <const int *>cscRowInd, &bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2612
 *         <const int *>cscRowInd, &bufferSizeInBytes)
 *     check_status(status)
 *     return bufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_bufferSizeInBytes;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2603
 * 
 * 
 * cpdef size_t xcscsort_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t cscColPtr,
 *         size_t cscRowInd):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.xcscsort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_199xcscsort_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_198xcscsort_bufferSizeExt[] = "xcscsort_bufferSizeExt(size_t handle, int m, int n, int nnz, size_t cscColPtr, size_t cscRowInd) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_199xcscsort_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  size_t __pyx_v_cscColPtr;
  size_t __pyx_v_cscRowInd;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcscsort_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_cscColPtr,&__pyx_n_s_cscRowInd,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcscsort_bufferSizeExt", 1, 6, 6, 1); __PYX_ERR(0, 2603, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcscsort_bufferSizeExt", 1, 6, 6, 2); __PYX_ERR(0, 2603, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcscsort_bufferSizeExt", 1, 6, 6, 3); __PYX_ERR(0, 2603, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscColPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcscsort_bufferSizeExt", 1, 6, 6, 4); __PYX_ERR(0, 2603, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscRowInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcscsort_bufferSizeExt", 1, 6, 6, 5); __PYX_ERR(0, 2603, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xcscsort_bufferSizeExt") < 0)) __PYX_ERR(0, 2603, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2604, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2604, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2604, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2604, __pyx_L3_error)
    __pyx_v_cscColPtr = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_cscColPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2604, __pyx_L3_error)
    __pyx_v_cscRowInd = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_cscRowInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2605, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcscsort_bufferSizeExt", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2603, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcscsort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_198xcscsort_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_cscColPtr, __pyx_v_cscRowInd);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_198xcscsort_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_cscColPtr, size_t __pyx_v_cscRowInd) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcscsort_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_xcscsort_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_cscColPtr, __pyx_v_cscRowInd, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcscsort_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2615
 * 
 * 
 * cpdef xcscsort(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t descrA,
 *         size_t cscColPtr, size_t cscRowInd, size_t P, size_t pBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_201xcscsort(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcscsort(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_cscColPtr, size_t __pyx_v_cscRowInd, size_t __pyx_v_P, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcscsort", 0);

  /* "cupy/cuda/cusparse.pyx":2618
 *         size_t handle, int m, int n, int nnz, size_t descrA,
 *         size_t cscColPtr, size_t cscRowInd, size_t P, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseXcscsort(
 *         <Handle>handle, m, n, nnz, <const MatDescr>descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2619
 *         size_t cscColPtr, size_t cscRowInd, size_t P, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseXcscsort(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, nnz, <const MatDescr>descrA,
 *         <const int *>cscColPtr, <int *>cscRowInd, <int *>P, <void *>pBuffer)
 */
  __pyx_v_status = cusparseXcscsort(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((int const *)__pyx_v_cscColPtr), ((int *)__pyx_v_cscRowInd), ((int *)__pyx_v_P), ((void *)__pyx_v_pBuffer));

  /* "cupy/cuda/cusparse.pyx":2622
 *         <Handle>handle, m, n, nnz, <const MatDescr>descrA,
 *         <const int *>cscColPtr, <int *>cscRowInd, <int *>P, <void *>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ########################################
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2615
 * 
 * 
 * cpdef xcscsort(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, int n, int nnz, size_t descrA,
 *         size_t cscColPtr, size_t cscRowInd, size_t P, size_t pBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcscsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_201xcscsort(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_200xcscsort[] = "xcscsort(size_t handle, int m, int n, int nnz, size_t descrA, size_t cscColPtr, size_t cscRowInd, size_t P, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_201xcscsort(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_cscColPtr;
  size_t __pyx_v_cscRowInd;
  size_t __pyx_v_P;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcscsort (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_cscColPtr,&__pyx_n_s_cscRowInd,&__pyx_n_s_P,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcscsort", 1, 9, 9, 1); __PYX_ERR(0, 2615, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcscsort", 1, 9, 9, 2); __PYX_ERR(0, 2615, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcscsort", 1, 9, 9, 3); __PYX_ERR(0, 2615, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcscsort", 1, 9, 9, 4); __PYX_ERR(0, 2615, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscColPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcscsort", 1, 9, 9, 5); __PYX_ERR(0, 2615, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscRowInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcscsort", 1, 9, 9, 6); __PYX_ERR(0, 2615, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcscsort", 1, 9, 9, 7); __PYX_ERR(0, 2615, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcscsort", 1, 9, 9, 8); __PYX_ERR(0, 2615, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xcscsort") < 0)) __PYX_ERR(0, 2615, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2616, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2616, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2616, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2616, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2616, __pyx_L3_error)
    __pyx_v_cscColPtr = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_cscColPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2617, __pyx_L3_error)
    __pyx_v_cscRowInd = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_cscRowInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2617, __pyx_L3_error)
    __pyx_v_P = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_P == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2617, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2617, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcscsort", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2615, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcscsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_200xcscsort(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_cscColPtr, __pyx_v_cscRowInd, __pyx_v_P, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_200xcscsort(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_cscColPtr, size_t __pyx_v_cscRowInd, size_t __pyx_v_P, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcscsort", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_xcscsort(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_cscColPtr, __pyx_v_cscRowInd, __pyx_v_P, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcscsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2627
 * # cuSPARSE PRECONDITIONERS
 * 
 * cpdef size_t createCsrilu02Info():             # <<<<<<<<<<<<<<
 *     cdef csrilu02Info_t info
 *     with nogil:
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_203createCsrilu02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createCsrilu02Info(CYTHON_UNUSED int __pyx_skip_dispatch) {
  csrilu02Info_t __pyx_v_info;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createCsrilu02Info", 0);

  /* "cupy/cuda/cusparse.pyx":2629
 * cpdef size_t createCsrilu02Info():
 *     cdef csrilu02Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateCsrilu02Info(&info)
 *     check_status(status)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2630
 *     cdef csrilu02Info_t info
 *     with nogil:
 *         status = cusparseCreateCsrilu02Info(&info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>info
 */
        __pyx_v_status = cusparseCreateCsrilu02Info((&__pyx_v_info));
      }

      /* "cupy/cuda/cusparse.pyx":2629
 * cpdef size_t createCsrilu02Info():
 *     cdef csrilu02Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateCsrilu02Info(&info)
 *     check_status(status)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2631
 *     with nogil:
 *         status = cusparseCreateCsrilu02Info(&info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>info
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2632
 *         status = cusparseCreateCsrilu02Info(&info)
 *     check_status(status)
 *     return <size_t>info             # <<<<<<<<<<<<<<
 * 
 * cpdef destroyCsrilu02Info(size_t info):
 */
  __pyx_r = ((size_t)__pyx_v_info);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2627
 * # cuSPARSE PRECONDITIONERS
 * 
 * cpdef size_t createCsrilu02Info():             # <<<<<<<<<<<<<<
 *     cdef csrilu02Info_t info
 *     with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.createCsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_203createCsrilu02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_202createCsrilu02Info[] = "createCsrilu02Info() -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_203createCsrilu02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createCsrilu02Info (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_202createCsrilu02Info(__pyx_self);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_202createCsrilu02Info(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createCsrilu02Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_createCsrilu02Info(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.createCsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2634
 *     return <size_t>info
 * 
 * cpdef destroyCsrilu02Info(size_t info):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyCsrilu02Info(<csrilu02Info_t>info)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_205destroyCsrilu02Info(PyObject *__pyx_self, PyObject *__pyx_arg_info); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroyCsrilu02Info(size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyCsrilu02Info", 0);

  /* "cupy/cuda/cusparse.pyx":2635
 * 
 * cpdef destroyCsrilu02Info(size_t info):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyCsrilu02Info(<csrilu02Info_t>info)
 *     check_status(status)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2636
 * cpdef destroyCsrilu02Info(size_t info):
 *     with nogil:
 *         status = cusparseDestroyCsrilu02Info(<csrilu02Info_t>info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
        __pyx_v_status = cusparseDestroyCsrilu02Info(((csrilu02Info_t)__pyx_v_info));
      }

      /* "cupy/cuda/cusparse.pyx":2635
 * 
 * cpdef destroyCsrilu02Info(size_t info):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyCsrilu02Info(<csrilu02Info_t>info)
 *     check_status(status)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2637
 *     with nogil:
 *         status = cusparseDestroyCsrilu02Info(<csrilu02Info_t>info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t createBsrilu02Info():
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2634
 *     return <size_t>info
 * 
 * cpdef destroyCsrilu02Info(size_t info):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyCsrilu02Info(<csrilu02Info_t>info)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyCsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_205destroyCsrilu02Info(PyObject *__pyx_self, PyObject *__pyx_arg_info); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_204destroyCsrilu02Info[] = "destroyCsrilu02Info(size_t info)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_205destroyCsrilu02Info(PyObject *__pyx_self, PyObject *__pyx_arg_info) {
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyCsrilu02Info (wrapper)", 0);
  assert(__pyx_arg_info); {
    __pyx_v_info = __Pyx_PyInt_As_size_t(__pyx_arg_info); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2634, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyCsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_204destroyCsrilu02Info(__pyx_self, ((size_t)__pyx_v_info));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_204destroyCsrilu02Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyCsrilu02Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_destroyCsrilu02Info(__pyx_v_info, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyCsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2639
 *     check_status(status)
 * 
 * cpdef size_t createBsrilu02Info():             # <<<<<<<<<<<<<<
 *     cdef bsrilu02Info_t info
 *     with nogil:
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_207createBsrilu02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createBsrilu02Info(CYTHON_UNUSED int __pyx_skip_dispatch) {
  bsrilu02Info_t __pyx_v_info;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createBsrilu02Info", 0);

  /* "cupy/cuda/cusparse.pyx":2641
 * cpdef size_t createBsrilu02Info():
 *     cdef bsrilu02Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateBsrilu02Info(&info)
 *     check_status(status)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2642
 *     cdef bsrilu02Info_t info
 *     with nogil:
 *         status = cusparseCreateBsrilu02Info(&info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>info
 */
        __pyx_v_status = cusparseCreateBsrilu02Info((&__pyx_v_info));
      }

      /* "cupy/cuda/cusparse.pyx":2641
 * cpdef size_t createBsrilu02Info():
 *     cdef bsrilu02Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateBsrilu02Info(&info)
 *     check_status(status)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2643
 *     with nogil:
 *         status = cusparseCreateBsrilu02Info(&info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>info
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2644
 *         status = cusparseCreateBsrilu02Info(&info)
 *     check_status(status)
 *     return <size_t>info             # <<<<<<<<<<<<<<
 * 
 * cpdef destroyBsrilu02Info(size_t info):
 */
  __pyx_r = ((size_t)__pyx_v_info);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2639
 *     check_status(status)
 * 
 * cpdef size_t createBsrilu02Info():             # <<<<<<<<<<<<<<
 *     cdef bsrilu02Info_t info
 *     with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.createBsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_207createBsrilu02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_206createBsrilu02Info[] = "createBsrilu02Info() -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_207createBsrilu02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createBsrilu02Info (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_206createBsrilu02Info(__pyx_self);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_206createBsrilu02Info(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createBsrilu02Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_createBsrilu02Info(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.createBsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2646
 *     return <size_t>info
 * 
 * cpdef destroyBsrilu02Info(size_t info):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyBsrilu02Info(<bsrilu02Info_t>info)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_209destroyBsrilu02Info(PyObject *__pyx_self, PyObject *__pyx_arg_info); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroyBsrilu02Info(size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyBsrilu02Info", 0);

  /* "cupy/cuda/cusparse.pyx":2647
 * 
 * cpdef destroyBsrilu02Info(size_t info):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyBsrilu02Info(<bsrilu02Info_t>info)
 *     check_status(status)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2648
 * cpdef destroyBsrilu02Info(size_t info):
 *     with nogil:
 *         status = cusparseDestroyBsrilu02Info(<bsrilu02Info_t>info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
        __pyx_v_status = cusparseDestroyBsrilu02Info(((bsrilu02Info_t)__pyx_v_info));
      }

      /* "cupy/cuda/cusparse.pyx":2647
 * 
 * cpdef destroyBsrilu02Info(size_t info):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyBsrilu02Info(<bsrilu02Info_t>info)
 *     check_status(status)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2649
 *     with nogil:
 *         status = cusparseDestroyBsrilu02Info(<bsrilu02Info_t>info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t createCsric02Info():
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2646
 *     return <size_t>info
 * 
 * cpdef destroyBsrilu02Info(size_t info):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyBsrilu02Info(<bsrilu02Info_t>info)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyBsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_209destroyBsrilu02Info(PyObject *__pyx_self, PyObject *__pyx_arg_info); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_208destroyBsrilu02Info[] = "destroyBsrilu02Info(size_t info)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_209destroyBsrilu02Info(PyObject *__pyx_self, PyObject *__pyx_arg_info) {
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyBsrilu02Info (wrapper)", 0);
  assert(__pyx_arg_info); {
    __pyx_v_info = __Pyx_PyInt_As_size_t(__pyx_arg_info); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2646, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyBsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_208destroyBsrilu02Info(__pyx_self, ((size_t)__pyx_v_info));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_208destroyBsrilu02Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyBsrilu02Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_destroyBsrilu02Info(__pyx_v_info, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyBsrilu02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2651
 *     check_status(status)
 * 
 * cpdef size_t createCsric02Info():             # <<<<<<<<<<<<<<
 *     cdef csric02Info_t info
 *     with nogil:
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_211createCsric02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createCsric02Info(CYTHON_UNUSED int __pyx_skip_dispatch) {
  csric02Info_t __pyx_v_info;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createCsric02Info", 0);

  /* "cupy/cuda/cusparse.pyx":2653
 * cpdef size_t createCsric02Info():
 *     cdef csric02Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateCsric02Info(&info)
 *     check_status(status)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2654
 *     cdef csric02Info_t info
 *     with nogil:
 *         status = cusparseCreateCsric02Info(&info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>info
 */
        __pyx_v_status = cusparseCreateCsric02Info((&__pyx_v_info));
      }

      /* "cupy/cuda/cusparse.pyx":2653
 * cpdef size_t createCsric02Info():
 *     cdef csric02Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateCsric02Info(&info)
 *     check_status(status)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2655
 *     with nogil:
 *         status = cusparseCreateCsric02Info(&info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>info
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2656
 *         status = cusparseCreateCsric02Info(&info)
 *     check_status(status)
 *     return <size_t>info             # <<<<<<<<<<<<<<
 * 
 * cpdef destroyCsric02Info(size_t info):
 */
  __pyx_r = ((size_t)__pyx_v_info);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2651
 *     check_status(status)
 * 
 * cpdef size_t createCsric02Info():             # <<<<<<<<<<<<<<
 *     cdef csric02Info_t info
 *     with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.createCsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_211createCsric02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_210createCsric02Info[] = "createCsric02Info() -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_211createCsric02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createCsric02Info (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_210createCsric02Info(__pyx_self);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_210createCsric02Info(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createCsric02Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_createCsric02Info(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.createCsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2658
 *     return <size_t>info
 * 
 * cpdef destroyCsric02Info(size_t info):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyCsric02Info(<csric02Info_t>info)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_213destroyCsric02Info(PyObject *__pyx_self, PyObject *__pyx_arg_info); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroyCsric02Info(size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyCsric02Info", 0);

  /* "cupy/cuda/cusparse.pyx":2659
 * 
 * cpdef destroyCsric02Info(size_t info):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyCsric02Info(<csric02Info_t>info)
 *     check_status(status)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2660
 * cpdef destroyCsric02Info(size_t info):
 *     with nogil:
 *         status = cusparseDestroyCsric02Info(<csric02Info_t>info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
        __pyx_v_status = cusparseDestroyCsric02Info(((csric02Info_t)__pyx_v_info));
      }

      /* "cupy/cuda/cusparse.pyx":2659
 * 
 * cpdef destroyCsric02Info(size_t info):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyCsric02Info(<csric02Info_t>info)
 *     check_status(status)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2661
 *     with nogil:
 *         status = cusparseDestroyCsric02Info(<csric02Info_t>info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t createBsric02Info():
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2658
 *     return <size_t>info
 * 
 * cpdef destroyCsric02Info(size_t info):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyCsric02Info(<csric02Info_t>info)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyCsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_213destroyCsric02Info(PyObject *__pyx_self, PyObject *__pyx_arg_info); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_212destroyCsric02Info[] = "destroyCsric02Info(size_t info)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_213destroyCsric02Info(PyObject *__pyx_self, PyObject *__pyx_arg_info) {
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyCsric02Info (wrapper)", 0);
  assert(__pyx_arg_info); {
    __pyx_v_info = __Pyx_PyInt_As_size_t(__pyx_arg_info); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2658, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyCsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_212destroyCsric02Info(__pyx_self, ((size_t)__pyx_v_info));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_212destroyCsric02Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyCsric02Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_destroyCsric02Info(__pyx_v_info, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyCsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2663
 *     check_status(status)
 * 
 * cpdef size_t createBsric02Info():             # <<<<<<<<<<<<<<
 *     cdef bsric02Info_t info
 *     with nogil:
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_215createBsric02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createBsric02Info(CYTHON_UNUSED int __pyx_skip_dispatch) {
  bsric02Info_t __pyx_v_info;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createBsric02Info", 0);

  /* "cupy/cuda/cusparse.pyx":2665
 * cpdef size_t createBsric02Info():
 *     cdef bsric02Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateBsric02Info(&info)
 *     check_status(status)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2666
 *     cdef bsric02Info_t info
 *     with nogil:
 *         status = cusparseCreateBsric02Info(&info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>info
 */
        __pyx_v_status = cusparseCreateBsric02Info((&__pyx_v_info));
      }

      /* "cupy/cuda/cusparse.pyx":2665
 * cpdef size_t createBsric02Info():
 *     cdef bsric02Info_t info
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCreateBsric02Info(&info)
 *     check_status(status)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2667
 *     with nogil:
 *         status = cusparseCreateBsric02Info(&info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>info
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2668
 *         status = cusparseCreateBsric02Info(&info)
 *     check_status(status)
 *     return <size_t>info             # <<<<<<<<<<<<<<
 * 
 * cpdef destroyBsric02Info(size_t info):
 */
  __pyx_r = ((size_t)__pyx_v_info);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2663
 *     check_status(status)
 * 
 * cpdef size_t createBsric02Info():             # <<<<<<<<<<<<<<
 *     cdef bsric02Info_t info
 *     with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.createBsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_215createBsric02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_214createBsric02Info[] = "createBsric02Info() -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_215createBsric02Info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createBsric02Info (wrapper)", 0);
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_214createBsric02Info(__pyx_self);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_214createBsric02Info(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createBsric02Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_createBsric02Info(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.createBsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2670
 *     return <size_t>info
 * 
 * cpdef destroyBsric02Info(size_t info):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyBsric02Info(<bsric02Info_t>info)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_217destroyBsric02Info(PyObject *__pyx_self, PyObject *__pyx_arg_info); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroyBsric02Info(size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyBsric02Info", 0);

  /* "cupy/cuda/cusparse.pyx":2671
 * 
 * cpdef destroyBsric02Info(size_t info):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyBsric02Info(<bsric02Info_t>info)
 *     check_status(status)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2672
 * cpdef destroyBsric02Info(size_t info):
 *     with nogil:
 *         status = cusparseDestroyBsric02Info(<bsric02Info_t>info)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
        __pyx_v_status = cusparseDestroyBsric02Info(((bsric02Info_t)__pyx_v_info));
      }

      /* "cupy/cuda/cusparse.pyx":2671
 * 
 * cpdef destroyBsric02Info(size_t info):
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDestroyBsric02Info(<bsric02Info_t>info)
 *     check_status(status)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2673
 *     with nogil:
 *         status = cusparseDestroyBsric02Info(<bsric02Info_t>info)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef scsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2670
 *     return <size_t>info
 * 
 * cpdef destroyBsric02Info(size_t info):             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDestroyBsric02Info(<bsric02Info_t>info)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyBsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_217destroyBsric02Info(PyObject *__pyx_self, PyObject *__pyx_arg_info); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_216destroyBsric02Info[] = "destroyBsric02Info(size_t info)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_217destroyBsric02Info(PyObject *__pyx_self, PyObject *__pyx_arg_info) {
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyBsric02Info (wrapper)", 0);
  assert(__pyx_arg_info); {
    __pyx_v_info = __Pyx_PyInt_As_size_t(__pyx_arg_info); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2670, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyBsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_216destroyBsric02Info(__pyx_self, ((size_t)__pyx_v_info));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_216destroyBsric02Info(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyBsric02Info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_destroyBsric02Info(__pyx_v_info, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyBsric02Info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2675
 *     check_status(status)
 * 
 * cpdef scsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,             # <<<<<<<<<<<<<<
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_219scsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrilu02_numericBoost(size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrilu02_numericBoost", 0);

  /* "cupy/cuda/cusparse.pyx":2677
 * cpdef scsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseScsrilu02_numericBoost(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2678
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2679
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseScsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 *             <double*>tol, <float*>boost_val)
 */
        __pyx_v_status = cusparseScsrilu02_numericBoost(((cusparseHandle_t)__pyx_v_handle), ((csrilu02Info_t)__pyx_v_info), __pyx_v_enable_boost, ((double *)__pyx_v_tol), ((float *)__pyx_v_boost_val));
      }

      /* "cupy/cuda/cusparse.pyx":2678
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2682
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 *             <double*>tol, <float*>boost_val)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dcsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2675
 *     check_status(status)
 * 
 * cpdef scsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,             # <<<<<<<<<<<<<<
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_219scsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_218scsrilu02_numericBoost[] = "scsrilu02_numericBoost(size_t handle, size_t info, int enable_boost, size_t tol, size_t boost_val)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_219scsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  size_t __pyx_v_info;
  int __pyx_v_enable_boost;
  size_t __pyx_v_tol;
  size_t __pyx_v_boost_val;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrilu02_numericBoost (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_info,&__pyx_n_s_enable_boost,&__pyx_n_s_tol,&__pyx_n_s_boost_val,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_numericBoost", 1, 5, 5, 1); __PYX_ERR(0, 2675, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_enable_boost)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_numericBoost", 1, 5, 5, 2); __PYX_ERR(0, 2675, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_numericBoost", 1, 5, 5, 3); __PYX_ERR(0, 2675, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_boost_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_numericBoost", 1, 5, 5, 4); __PYX_ERR(0, 2675, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsrilu02_numericBoost") < 0)) __PYX_ERR(0, 2675, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2675, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2675, __pyx_L3_error)
    __pyx_v_enable_boost = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_enable_boost == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2675, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_tol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2676, __pyx_L3_error)
    __pyx_v_boost_val = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_boost_val == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2676, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrilu02_numericBoost", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2675, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_218scsrilu02_numericBoost(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_218scsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrilu02_numericBoost", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_scsrilu02_numericBoost(__pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2684
 *     check_status(status)
 * 
 * cpdef dcsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,             # <<<<<<<<<<<<<<
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_221dcsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrilu02_numericBoost(size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrilu02_numericBoost", 0);

  /* "cupy/cuda/cusparse.pyx":2686
 * cpdef dcsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDcsrilu02_numericBoost(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2687
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2688
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDcsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 *             <double*>tol, <double*>boost_val)
 */
        __pyx_v_status = cusparseDcsrilu02_numericBoost(((cusparseHandle_t)__pyx_v_handle), ((csrilu02Info_t)__pyx_v_info), __pyx_v_enable_boost, ((double *)__pyx_v_tol), ((double *)__pyx_v_boost_val));
      }

      /* "cupy/cuda/cusparse.pyx":2687
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2691
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 *             <double*>tol, <double*>boost_val)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef ccsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2684
 *     check_status(status)
 * 
 * cpdef dcsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,             # <<<<<<<<<<<<<<
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_221dcsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_220dcsrilu02_numericBoost[] = "dcsrilu02_numericBoost(size_t handle, size_t info, int enable_boost, size_t tol, size_t boost_val)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_221dcsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  size_t __pyx_v_info;
  int __pyx_v_enable_boost;
  size_t __pyx_v_tol;
  size_t __pyx_v_boost_val;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrilu02_numericBoost (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_info,&__pyx_n_s_enable_boost,&__pyx_n_s_tol,&__pyx_n_s_boost_val,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_numericBoost", 1, 5, 5, 1); __PYX_ERR(0, 2684, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_enable_boost)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_numericBoost", 1, 5, 5, 2); __PYX_ERR(0, 2684, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_numericBoost", 1, 5, 5, 3); __PYX_ERR(0, 2684, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_boost_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_numericBoost", 1, 5, 5, 4); __PYX_ERR(0, 2684, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsrilu02_numericBoost") < 0)) __PYX_ERR(0, 2684, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2684, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2684, __pyx_L3_error)
    __pyx_v_enable_boost = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_enable_boost == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2684, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_tol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2685, __pyx_L3_error)
    __pyx_v_boost_val = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_boost_val == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2685, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrilu02_numericBoost", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2684, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_220dcsrilu02_numericBoost(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_220dcsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrilu02_numericBoost", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dcsrilu02_numericBoost(__pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2693
 *     check_status(status)
 * 
 * cpdef ccsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,             # <<<<<<<<<<<<<<
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_223ccsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrilu02_numericBoost(size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrilu02_numericBoost", 0);

  /* "cupy/cuda/cusparse.pyx":2695
 * cpdef ccsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCcsrilu02_numericBoost(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2696
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2697
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCcsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 *             <double*>tol, <cuComplex*>boost_val)
 */
        __pyx_v_status = cusparseCcsrilu02_numericBoost(((cusparseHandle_t)__pyx_v_handle), ((csrilu02Info_t)__pyx_v_info), __pyx_v_enable_boost, ((double *)__pyx_v_tol), ((cuComplex *)__pyx_v_boost_val));
      }

      /* "cupy/cuda/cusparse.pyx":2696
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2700
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 *             <double*>tol, <cuComplex*>boost_val)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zcsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2693
 *     check_status(status)
 * 
 * cpdef ccsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,             # <<<<<<<<<<<<<<
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_223ccsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_222ccsrilu02_numericBoost[] = "ccsrilu02_numericBoost(size_t handle, size_t info, int enable_boost, size_t tol, size_t boost_val)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_223ccsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  size_t __pyx_v_info;
  int __pyx_v_enable_boost;
  size_t __pyx_v_tol;
  size_t __pyx_v_boost_val;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrilu02_numericBoost (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_info,&__pyx_n_s_enable_boost,&__pyx_n_s_tol,&__pyx_n_s_boost_val,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_numericBoost", 1, 5, 5, 1); __PYX_ERR(0, 2693, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_enable_boost)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_numericBoost", 1, 5, 5, 2); __PYX_ERR(0, 2693, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_numericBoost", 1, 5, 5, 3); __PYX_ERR(0, 2693, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_boost_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_numericBoost", 1, 5, 5, 4); __PYX_ERR(0, 2693, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsrilu02_numericBoost") < 0)) __PYX_ERR(0, 2693, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2693, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2693, __pyx_L3_error)
    __pyx_v_enable_boost = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_enable_boost == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2693, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_tol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2694, __pyx_L3_error)
    __pyx_v_boost_val = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_boost_val == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2694, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrilu02_numericBoost", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2693, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_222ccsrilu02_numericBoost(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_222ccsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrilu02_numericBoost", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ccsrilu02_numericBoost(__pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2702
 *     check_status(status)
 * 
 * cpdef zcsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,             # <<<<<<<<<<<<<<
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_225zcsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrilu02_numericBoost(size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrilu02_numericBoost", 0);

  /* "cupy/cuda/cusparse.pyx":2704
 * cpdef zcsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZcsrilu02_numericBoost(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2705
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2706
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZcsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 *             <double*>tol, <cuDoubleComplex*>boost_val)
 */
        __pyx_v_status = cusparseZcsrilu02_numericBoost(((cusparseHandle_t)__pyx_v_handle), ((csrilu02Info_t)__pyx_v_info), __pyx_v_enable_boost, ((double *)__pyx_v_tol), ((cuDoubleComplex *)__pyx_v_boost_val));
      }

      /* "cupy/cuda/cusparse.pyx":2705
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2709
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, enable_boost,
 *             <double*>tol, <cuDoubleComplex*>boost_val)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef xcsrilu02_zeroPivot(size_t handle, size_t info, size_t position):
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2702
 *     check_status(status)
 * 
 * cpdef zcsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,             # <<<<<<<<<<<<<<
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_225zcsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_224zcsrilu02_numericBoost[] = "zcsrilu02_numericBoost(size_t handle, size_t info, int enable_boost, size_t tol, size_t boost_val)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_225zcsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  size_t __pyx_v_info;
  int __pyx_v_enable_boost;
  size_t __pyx_v_tol;
  size_t __pyx_v_boost_val;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrilu02_numericBoost (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_info,&__pyx_n_s_enable_boost,&__pyx_n_s_tol,&__pyx_n_s_boost_val,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_numericBoost", 1, 5, 5, 1); __PYX_ERR(0, 2702, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_enable_boost)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_numericBoost", 1, 5, 5, 2); __PYX_ERR(0, 2702, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_numericBoost", 1, 5, 5, 3); __PYX_ERR(0, 2702, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_boost_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_numericBoost", 1, 5, 5, 4); __PYX_ERR(0, 2702, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsrilu02_numericBoost") < 0)) __PYX_ERR(0, 2702, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2702, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2702, __pyx_L3_error)
    __pyx_v_enable_boost = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_enable_boost == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2702, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_tol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2703, __pyx_L3_error)
    __pyx_v_boost_val = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_boost_val == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2703, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrilu02_numericBoost", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2702, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_224zcsrilu02_numericBoost(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_224zcsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrilu02_numericBoost", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zcsrilu02_numericBoost(__pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2711
 *     check_status(status)
 * 
 * cpdef xcsrilu02_zeroPivot(size_t handle, size_t info, size_t position):             # <<<<<<<<<<<<<<
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_227xcsrilu02_zeroPivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcsrilu02_zeroPivot(size_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsrilu02_zeroPivot", 0);

  /* "cupy/cuda/cusparse.pyx":2712
 * 
 * cpdef xcsrilu02_zeroPivot(size_t handle, size_t info, size_t position):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseXcsrilu02_zeroPivot(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2713
 * cpdef xcsrilu02_zeroPivot(size_t handle, size_t info, size_t position):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseXcsrilu02_zeroPivot(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, <int*>position)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2714
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseXcsrilu02_zeroPivot(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, <int*>position)
 *     check_status(status)
 */
        __pyx_v_status = cusparseXcsrilu02_zeroPivot(((cusparseHandle_t)__pyx_v_handle), ((csrilu02Info_t)__pyx_v_info), ((int *)__pyx_v_position));
      }

      /* "cupy/cuda/cusparse.pyx":2713
 * cpdef xcsrilu02_zeroPivot(size_t handle, size_t info, size_t position):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseXcsrilu02_zeroPivot(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, <int*>position)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2716
 *         status = cusparseXcsrilu02_zeroPivot(
 *             <cusparseHandle_t>handle, <csrilu02Info_t>info, <int*>position)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef int scsrilu02_bufferSize(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2711
 *     check_status(status)
 * 
 * cpdef xcsrilu02_zeroPivot(size_t handle, size_t info, size_t position):             # <<<<<<<<<<<<<<
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrilu02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_227xcsrilu02_zeroPivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_226xcsrilu02_zeroPivot[] = "xcsrilu02_zeroPivot(size_t handle, size_t info, size_t position)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_227xcsrilu02_zeroPivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  size_t __pyx_v_info;
  size_t __pyx_v_position;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsrilu02_zeroPivot (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_info,&__pyx_n_s_position,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrilu02_zeroPivot", 1, 3, 3, 1); __PYX_ERR(0, 2711, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_position)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsrilu02_zeroPivot", 1, 3, 3, 2); __PYX_ERR(0, 2711, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xcsrilu02_zeroPivot") < 0)) __PYX_ERR(0, 2711, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2711, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2711, __pyx_L3_error)
    __pyx_v_position = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_position == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2711, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsrilu02_zeroPivot", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2711, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrilu02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_226xcsrilu02_zeroPivot(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_position);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_226xcsrilu02_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsrilu02_zeroPivot", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_xcsrilu02_zeroPivot(__pyx_v_handle, __pyx_v_info, __pyx_v_position, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsrilu02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2718
 *     check_status(status)
 * 
 * cpdef int scsrilu02_bufferSize(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                                size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                                size_t csrSortedColIndA, size_t info):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_229scsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_scsrilu02_bufferSize(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrilu02_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":2722
 *                                size_t csrSortedColIndA, size_t info):
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseScsrilu02_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2723
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2724
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseScsrilu02_bufferSize(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <float*>csrSortedValA, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseScsrilu02_bufferSize(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((float *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csrilu02Info_t)__pyx_v_info), (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":2723
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2729
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2730
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int dcsrilu02_bufferSize(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2718
 *     check_status(status)
 * 
 * cpdef int scsrilu02_bufferSize(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                                size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                                size_t csrSortedColIndA, size_t info):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.scsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_229scsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_228scsrilu02_bufferSize[] = "scsrilu02_bufferSize(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_229scsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrilu02_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_bufferSize", 1, 8, 8, 1); __PYX_ERR(0, 2718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_bufferSize", 1, 8, 8, 2); __PYX_ERR(0, 2718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_bufferSize", 1, 8, 8, 3); __PYX_ERR(0, 2718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_bufferSize", 1, 8, 8, 4); __PYX_ERR(0, 2718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_bufferSize", 1, 8, 8, 5); __PYX_ERR(0, 2718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_bufferSize", 1, 8, 8, 6); __PYX_ERR(0, 2718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_bufferSize", 1, 8, 8, 7); __PYX_ERR(0, 2718, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsrilu02_bufferSize") < 0)) __PYX_ERR(0, 2718, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2718, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2718, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2718, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2718, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2719, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2719, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2720, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2720, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrilu02_bufferSize", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2718, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_228scsrilu02_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_228scsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrilu02_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_scsrilu02_bufferSize(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2732
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int dcsrilu02_bufferSize(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                                size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                                size_t csrSortedColIndA, size_t info):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_231dcsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_dcsrilu02_bufferSize(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrilu02_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":2736
 *                                size_t csrSortedColIndA, size_t info):
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDcsrilu02_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2737
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2738
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDcsrilu02_bufferSize(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <double*>csrSortedValA, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseDcsrilu02_bufferSize(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((double *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csrilu02Info_t)__pyx_v_info), (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":2737
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2743
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2744
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int ccsrilu02_bufferSize(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2732
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int dcsrilu02_bufferSize(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                                size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                                size_t csrSortedColIndA, size_t info):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.dcsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_231dcsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_230dcsrilu02_bufferSize[] = "dcsrilu02_bufferSize(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_231dcsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrilu02_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_bufferSize", 1, 8, 8, 1); __PYX_ERR(0, 2732, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_bufferSize", 1, 8, 8, 2); __PYX_ERR(0, 2732, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_bufferSize", 1, 8, 8, 3); __PYX_ERR(0, 2732, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_bufferSize", 1, 8, 8, 4); __PYX_ERR(0, 2732, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_bufferSize", 1, 8, 8, 5); __PYX_ERR(0, 2732, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_bufferSize", 1, 8, 8, 6); __PYX_ERR(0, 2732, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_bufferSize", 1, 8, 8, 7); __PYX_ERR(0, 2732, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsrilu02_bufferSize") < 0)) __PYX_ERR(0, 2732, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2732, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2732, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2732, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2732, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2733, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2733, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2734, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2734, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrilu02_bufferSize", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2732, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_230dcsrilu02_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_230dcsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrilu02_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_dcsrilu02_bufferSize(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2746
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int ccsrilu02_bufferSize(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                                size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                                size_t csrSortedColIndA, size_t info):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_233ccsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_ccsrilu02_bufferSize(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrilu02_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":2750
 *                                size_t csrSortedColIndA, size_t info):
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCcsrilu02_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2751
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2752
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCcsrilu02_bufferSize(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <cuComplex*>csrSortedValA, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseCcsrilu02_bufferSize(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csrilu02Info_t)__pyx_v_info), (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":2751
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2757
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2758
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int zcsrilu02_bufferSize(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2746
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int ccsrilu02_bufferSize(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                                size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                                size_t csrSortedColIndA, size_t info):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.ccsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_233ccsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_232ccsrilu02_bufferSize[] = "ccsrilu02_bufferSize(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_233ccsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrilu02_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_bufferSize", 1, 8, 8, 1); __PYX_ERR(0, 2746, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_bufferSize", 1, 8, 8, 2); __PYX_ERR(0, 2746, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_bufferSize", 1, 8, 8, 3); __PYX_ERR(0, 2746, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_bufferSize", 1, 8, 8, 4); __PYX_ERR(0, 2746, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_bufferSize", 1, 8, 8, 5); __PYX_ERR(0, 2746, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_bufferSize", 1, 8, 8, 6); __PYX_ERR(0, 2746, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_bufferSize", 1, 8, 8, 7); __PYX_ERR(0, 2746, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsrilu02_bufferSize") < 0)) __PYX_ERR(0, 2746, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2746, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2746, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2746, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2746, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2747, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2747, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2748, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2748, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrilu02_bufferSize", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2746, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_232ccsrilu02_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_232ccsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrilu02_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_ccsrilu02_bufferSize(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2760
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int zcsrilu02_bufferSize(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                                size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                                size_t csrSortedColIndA, size_t info):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_235zcsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_zcsrilu02_bufferSize(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrilu02_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":2764
 *                                size_t csrSortedColIndA, size_t info):
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZcsrilu02_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2765
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2766
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZcsrilu02_bufferSize(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <cuDoubleComplex*>csrSortedValA, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseZcsrilu02_bufferSize(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csrilu02Info_t)__pyx_v_info), (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":2765
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2771
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2772
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef scsrilu02_analysis(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2760
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int zcsrilu02_bufferSize(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                                size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                                size_t csrSortedColIndA, size_t info):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.zcsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_235zcsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_234zcsrilu02_bufferSize[] = "zcsrilu02_bufferSize(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_235zcsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrilu02_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_bufferSize", 1, 8, 8, 1); __PYX_ERR(0, 2760, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_bufferSize", 1, 8, 8, 2); __PYX_ERR(0, 2760, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_bufferSize", 1, 8, 8, 3); __PYX_ERR(0, 2760, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_bufferSize", 1, 8, 8, 4); __PYX_ERR(0, 2760, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_bufferSize", 1, 8, 8, 5); __PYX_ERR(0, 2760, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_bufferSize", 1, 8, 8, 6); __PYX_ERR(0, 2760, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_bufferSize", 1, 8, 8, 7); __PYX_ERR(0, 2760, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsrilu02_bufferSize") < 0)) __PYX_ERR(0, 2760, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2760, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2760, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2760, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2760, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2761, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2761, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2762, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2762, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrilu02_bufferSize", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2760, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_234zcsrilu02_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_234zcsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrilu02_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_zcsrilu02_bufferSize(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2774
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef scsrilu02_analysis(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                          size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                          size_t csrSortedColIndA, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_237scsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrilu02_analysis(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrilu02_analysis", 0);

  /* "cupy/cuda/cusparse.pyx":2778
 *                          size_t csrSortedColIndA, size_t info, int policy,
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseScsrilu02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2779
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsrilu02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2780
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseScsrilu02_analysis(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <const float*>csrSortedValA, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseScsrilu02_analysis(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((float const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csrilu02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":2779
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsrilu02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2785
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dcsrilu02_analysis(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2774
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef scsrilu02_analysis(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                          size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                          size_t csrSortedColIndA, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_237scsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_236scsrilu02_analysis[] = "scsrilu02_analysis(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_237scsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrilu02_analysis (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_analysis", 1, 10, 10, 1); __PYX_ERR(0, 2774, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_analysis", 1, 10, 10, 2); __PYX_ERR(0, 2774, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_analysis", 1, 10, 10, 3); __PYX_ERR(0, 2774, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_analysis", 1, 10, 10, 4); __PYX_ERR(0, 2774, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_analysis", 1, 10, 10, 5); __PYX_ERR(0, 2774, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_analysis", 1, 10, 10, 6); __PYX_ERR(0, 2774, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_analysis", 1, 10, 10, 7); __PYX_ERR(0, 2774, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_analysis", 1, 10, 10, 8); __PYX_ERR(0, 2774, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02_analysis", 1, 10, 10, 9); __PYX_ERR(0, 2774, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsrilu02_analysis") < 0)) __PYX_ERR(0, 2774, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2774, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2774, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2774, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2774, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2775, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2775, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2776, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2776, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2776, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2777, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrilu02_analysis", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2774, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_236scsrilu02_analysis(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_236scsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrilu02_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_scsrilu02_analysis(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2787
 *     check_status(status)
 * 
 * cpdef dcsrilu02_analysis(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                          size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                          size_t csrSortedColIndA, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_239dcsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrilu02_analysis(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrilu02_analysis", 0);

  /* "cupy/cuda/cusparse.pyx":2791
 *                          size_t csrSortedColIndA, size_t info, int policy,
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDcsrilu02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2792
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsrilu02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2793
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDcsrilu02_analysis(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <const double*>csrSortedValA, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseDcsrilu02_analysis(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((double const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csrilu02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":2792
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsrilu02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2798
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef ccsrilu02_analysis(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2787
 *     check_status(status)
 * 
 * cpdef dcsrilu02_analysis(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                          size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                          size_t csrSortedColIndA, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_239dcsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_238dcsrilu02_analysis[] = "dcsrilu02_analysis(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_239dcsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrilu02_analysis (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_analysis", 1, 10, 10, 1); __PYX_ERR(0, 2787, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_analysis", 1, 10, 10, 2); __PYX_ERR(0, 2787, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_analysis", 1, 10, 10, 3); __PYX_ERR(0, 2787, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_analysis", 1, 10, 10, 4); __PYX_ERR(0, 2787, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_analysis", 1, 10, 10, 5); __PYX_ERR(0, 2787, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_analysis", 1, 10, 10, 6); __PYX_ERR(0, 2787, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_analysis", 1, 10, 10, 7); __PYX_ERR(0, 2787, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_analysis", 1, 10, 10, 8); __PYX_ERR(0, 2787, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02_analysis", 1, 10, 10, 9); __PYX_ERR(0, 2787, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsrilu02_analysis") < 0)) __PYX_ERR(0, 2787, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2787, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2787, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2787, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2787, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2788, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2788, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2789, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2789, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2789, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2790, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrilu02_analysis", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2787, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_238dcsrilu02_analysis(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_238dcsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrilu02_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dcsrilu02_analysis(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2800
 *     check_status(status)
 * 
 * cpdef ccsrilu02_analysis(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                          size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                          size_t csrSortedColIndA, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_241ccsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrilu02_analysis(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrilu02_analysis", 0);

  /* "cupy/cuda/cusparse.pyx":2804
 *                          size_t csrSortedColIndA, size_t info, int policy,
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCcsrilu02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2805
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsrilu02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2806
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCcsrilu02_analysis(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <const cuComplex*>csrSortedValA, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseCcsrilu02_analysis(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csrilu02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":2805
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsrilu02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2811
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zcsrilu02_analysis(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2800
 *     check_status(status)
 * 
 * cpdef ccsrilu02_analysis(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                          size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                          size_t csrSortedColIndA, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_241ccsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_240ccsrilu02_analysis[] = "ccsrilu02_analysis(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_241ccsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrilu02_analysis (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_analysis", 1, 10, 10, 1); __PYX_ERR(0, 2800, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_analysis", 1, 10, 10, 2); __PYX_ERR(0, 2800, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_analysis", 1, 10, 10, 3); __PYX_ERR(0, 2800, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_analysis", 1, 10, 10, 4); __PYX_ERR(0, 2800, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_analysis", 1, 10, 10, 5); __PYX_ERR(0, 2800, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_analysis", 1, 10, 10, 6); __PYX_ERR(0, 2800, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_analysis", 1, 10, 10, 7); __PYX_ERR(0, 2800, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_analysis", 1, 10, 10, 8); __PYX_ERR(0, 2800, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02_analysis", 1, 10, 10, 9); __PYX_ERR(0, 2800, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsrilu02_analysis") < 0)) __PYX_ERR(0, 2800, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2800, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2800, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2800, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2800, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2801, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2801, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2802, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2802, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2802, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2803, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrilu02_analysis", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2800, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_240ccsrilu02_analysis(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_240ccsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrilu02_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ccsrilu02_analysis(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2813
 *     check_status(status)
 * 
 * cpdef zcsrilu02_analysis(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                          size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                          size_t csrSortedColIndA, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_243zcsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrilu02_analysis(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrilu02_analysis", 0);

  /* "cupy/cuda/cusparse.pyx":2817
 *                          size_t csrSortedColIndA, size_t info, int policy,
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZcsrilu02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2818
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsrilu02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2819
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZcsrilu02_analysis(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <const cuDoubleComplex*>csrSortedValA,
 */
        __pyx_v_status = cusparseZcsrilu02_analysis(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csrilu02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":2818
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsrilu02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2825
 *             <csrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef scsrilu02(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2813
 *     check_status(status)
 * 
 * cpdef zcsrilu02_analysis(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                          size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                          size_t csrSortedColIndA, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_243zcsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_242zcsrilu02_analysis[] = "zcsrilu02_analysis(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_243zcsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrilu02_analysis (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_analysis", 1, 10, 10, 1); __PYX_ERR(0, 2813, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_analysis", 1, 10, 10, 2); __PYX_ERR(0, 2813, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_analysis", 1, 10, 10, 3); __PYX_ERR(0, 2813, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_analysis", 1, 10, 10, 4); __PYX_ERR(0, 2813, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_analysis", 1, 10, 10, 5); __PYX_ERR(0, 2813, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_analysis", 1, 10, 10, 6); __PYX_ERR(0, 2813, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_analysis", 1, 10, 10, 7); __PYX_ERR(0, 2813, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_analysis", 1, 10, 10, 8); __PYX_ERR(0, 2813, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02_analysis", 1, 10, 10, 9); __PYX_ERR(0, 2813, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsrilu02_analysis") < 0)) __PYX_ERR(0, 2813, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2813, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2813, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2813, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2813, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2814, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2814, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2815, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2815, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2815, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2816, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrilu02_analysis", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2813, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_242zcsrilu02_analysis(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_242zcsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrilu02_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zcsrilu02_analysis(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2827
 *     check_status(status)
 * 
 * cpdef scsrilu02(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                 size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
 *                 size_t csrSortedColIndA, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_245scsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsrilu02(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrilu02", 0);

  /* "cupy/cuda/cusparse.pyx":2831
 *                 size_t csrSortedColIndA, size_t info, int policy,
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseScsrilu02(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2832
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsrilu02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2833
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseScsrilu02(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <float*>csrSortedValA_valM, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseScsrilu02(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((float *)__pyx_v_csrSortedValA_valM), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csrilu02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":2832
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsrilu02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2838
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dcsrilu02(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2827
 *     check_status(status)
 * 
 * cpdef scsrilu02(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                 size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
 *                 size_t csrSortedColIndA, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_245scsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_244scsrilu02[] = "scsrilu02(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA_valM, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_245scsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA_valM;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsrilu02 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA_valM,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02", 1, 10, 10, 1); __PYX_ERR(0, 2827, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02", 1, 10, 10, 2); __PYX_ERR(0, 2827, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02", 1, 10, 10, 3); __PYX_ERR(0, 2827, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA_valM)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02", 1, 10, 10, 4); __PYX_ERR(0, 2827, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02", 1, 10, 10, 5); __PYX_ERR(0, 2827, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02", 1, 10, 10, 6); __PYX_ERR(0, 2827, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02", 1, 10, 10, 7); __PYX_ERR(0, 2827, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02", 1, 10, 10, 8); __PYX_ERR(0, 2827, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsrilu02", 1, 10, 10, 9); __PYX_ERR(0, 2827, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsrilu02") < 0)) __PYX_ERR(0, 2827, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2827, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2827, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2827, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2827, __pyx_L3_error)
    __pyx_v_csrSortedValA_valM = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA_valM == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2828, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2828, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2829, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2829, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2829, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2830, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsrilu02", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2827, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_244scsrilu02(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA_valM, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_244scsrilu02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsrilu02", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_scsrilu02(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA_valM, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2840
 *     check_status(status)
 * 
 * cpdef dcsrilu02(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                 size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
 *                 size_t csrSortedColIndA, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_247dcsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsrilu02(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrilu02", 0);

  /* "cupy/cuda/cusparse.pyx":2844
 *                 size_t csrSortedColIndA, size_t info, int policy,
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDcsrilu02(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2845
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsrilu02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2846
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDcsrilu02(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <double*>csrSortedValA_valM, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseDcsrilu02(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((double *)__pyx_v_csrSortedValA_valM), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csrilu02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":2845
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsrilu02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2851
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef ccsrilu02(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2840
 *     check_status(status)
 * 
 * cpdef dcsrilu02(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                 size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
 *                 size_t csrSortedColIndA, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_247dcsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_246dcsrilu02[] = "dcsrilu02(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA_valM, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_247dcsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA_valM;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsrilu02 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA_valM,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02", 1, 10, 10, 1); __PYX_ERR(0, 2840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02", 1, 10, 10, 2); __PYX_ERR(0, 2840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02", 1, 10, 10, 3); __PYX_ERR(0, 2840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA_valM)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02", 1, 10, 10, 4); __PYX_ERR(0, 2840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02", 1, 10, 10, 5); __PYX_ERR(0, 2840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02", 1, 10, 10, 6); __PYX_ERR(0, 2840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02", 1, 10, 10, 7); __PYX_ERR(0, 2840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02", 1, 10, 10, 8); __PYX_ERR(0, 2840, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsrilu02", 1, 10, 10, 9); __PYX_ERR(0, 2840, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsrilu02") < 0)) __PYX_ERR(0, 2840, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2840, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2840, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2840, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2840, __pyx_L3_error)
    __pyx_v_csrSortedValA_valM = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA_valM == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2841, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2841, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2842, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2842, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2842, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2843, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsrilu02", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2840, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_246dcsrilu02(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA_valM, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_246dcsrilu02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsrilu02", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dcsrilu02(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA_valM, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2853
 *     check_status(status)
 * 
 * cpdef ccsrilu02(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                 size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
 *                 size_t csrSortedColIndA, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_249ccsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsrilu02(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrilu02", 0);

  /* "cupy/cuda/cusparse.pyx":2857
 *                 size_t csrSortedColIndA, size_t info, int policy,
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCcsrilu02(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2858
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsrilu02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2859
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCcsrilu02(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <cuComplex*>csrSortedValA_valM, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseCcsrilu02(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex *)__pyx_v_csrSortedValA_valM), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csrilu02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":2858
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsrilu02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2864
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zcsrilu02(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2853
 *     check_status(status)
 * 
 * cpdef ccsrilu02(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                 size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
 *                 size_t csrSortedColIndA, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_249ccsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_248ccsrilu02[] = "ccsrilu02(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA_valM, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_249ccsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA_valM;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsrilu02 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA_valM,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02", 1, 10, 10, 1); __PYX_ERR(0, 2853, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02", 1, 10, 10, 2); __PYX_ERR(0, 2853, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02", 1, 10, 10, 3); __PYX_ERR(0, 2853, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA_valM)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02", 1, 10, 10, 4); __PYX_ERR(0, 2853, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02", 1, 10, 10, 5); __PYX_ERR(0, 2853, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02", 1, 10, 10, 6); __PYX_ERR(0, 2853, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02", 1, 10, 10, 7); __PYX_ERR(0, 2853, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02", 1, 10, 10, 8); __PYX_ERR(0, 2853, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsrilu02", 1, 10, 10, 9); __PYX_ERR(0, 2853, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsrilu02") < 0)) __PYX_ERR(0, 2853, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2853, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2853, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2853, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2853, __pyx_L3_error)
    __pyx_v_csrSortedValA_valM = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA_valM == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2854, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2854, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2855, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2855, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2855, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2856, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsrilu02", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2853, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_248ccsrilu02(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA_valM, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_248ccsrilu02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsrilu02", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ccsrilu02(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA_valM, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2866
 *     check_status(status)
 * 
 * cpdef zcsrilu02(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                 size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
 *                 size_t csrSortedColIndA, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_251zcsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsrilu02(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrilu02", 0);

  /* "cupy/cuda/cusparse.pyx":2870
 *                 size_t csrSortedColIndA, size_t info, int policy,
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZcsrilu02(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2871
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsrilu02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2872
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZcsrilu02(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <cuDoubleComplex*>csrSortedValA_valM, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseZcsrilu02(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex *)__pyx_v_csrSortedValA_valM), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csrilu02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":2871
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsrilu02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2877
 *             <const int*>csrSortedColIndA, <csrilu02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef sbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2866
 *     check_status(status)
 * 
 * cpdef zcsrilu02(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                 size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
 *                 size_t csrSortedColIndA, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_251zcsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_250zcsrilu02[] = "zcsrilu02(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA_valM, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_251zcsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA_valM;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsrilu02 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA_valM,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02", 1, 10, 10, 1); __PYX_ERR(0, 2866, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02", 1, 10, 10, 2); __PYX_ERR(0, 2866, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02", 1, 10, 10, 3); __PYX_ERR(0, 2866, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA_valM)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02", 1, 10, 10, 4); __PYX_ERR(0, 2866, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02", 1, 10, 10, 5); __PYX_ERR(0, 2866, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02", 1, 10, 10, 6); __PYX_ERR(0, 2866, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02", 1, 10, 10, 7); __PYX_ERR(0, 2866, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02", 1, 10, 10, 8); __PYX_ERR(0, 2866, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsrilu02", 1, 10, 10, 9); __PYX_ERR(0, 2866, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsrilu02") < 0)) __PYX_ERR(0, 2866, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2866, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2866, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2866, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2866, __pyx_L3_error)
    __pyx_v_csrSortedValA_valM = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA_valM == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2867, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2867, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2868, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2868, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2868, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2869, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsrilu02", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2866, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_250zcsrilu02(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA_valM, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_250zcsrilu02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsrilu02", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zcsrilu02(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA_valM, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2879
 *     check_status(status)
 * 
 * cpdef sbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,             # <<<<<<<<<<<<<<
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_253sbsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sbsrilu02_numericBoost(size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sbsrilu02_numericBoost", 0);

  /* "cupy/cuda/cusparse.pyx":2881
 * cpdef sbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSbsrilu02_numericBoost(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2882
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2883
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSbsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 *             <double*>tol, <float*>boost_val)
 */
        __pyx_v_status = cusparseSbsrilu02_numericBoost(((cusparseHandle_t)__pyx_v_handle), ((bsrilu02Info_t)__pyx_v_info), __pyx_v_enable_boost, ((double *)__pyx_v_tol), ((float *)__pyx_v_boost_val));
      }

      /* "cupy/cuda/cusparse.pyx":2882
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2886
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 *             <double*>tol, <float*>boost_val)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2879
 *     check_status(status)
 * 
 * cpdef sbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,             # <<<<<<<<<<<<<<
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_253sbsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_252sbsrilu02_numericBoost[] = "sbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost, size_t tol, size_t boost_val)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_253sbsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  size_t __pyx_v_info;
  int __pyx_v_enable_boost;
  size_t __pyx_v_tol;
  size_t __pyx_v_boost_val;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sbsrilu02_numericBoost (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_info,&__pyx_n_s_enable_boost,&__pyx_n_s_tol,&__pyx_n_s_boost_val,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_numericBoost", 1, 5, 5, 1); __PYX_ERR(0, 2879, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_enable_boost)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_numericBoost", 1, 5, 5, 2); __PYX_ERR(0, 2879, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_numericBoost", 1, 5, 5, 3); __PYX_ERR(0, 2879, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_boost_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_numericBoost", 1, 5, 5, 4); __PYX_ERR(0, 2879, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sbsrilu02_numericBoost") < 0)) __PYX_ERR(0, 2879, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2879, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2879, __pyx_L3_error)
    __pyx_v_enable_boost = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_enable_boost == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2879, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_tol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2880, __pyx_L3_error)
    __pyx_v_boost_val = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_boost_val == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2880, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sbsrilu02_numericBoost", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2879, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_252sbsrilu02_numericBoost(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_252sbsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sbsrilu02_numericBoost", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_sbsrilu02_numericBoost(__pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2888
 *     check_status(status)
 * 
 * cpdef dbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,             # <<<<<<<<<<<<<<
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_255dbsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dbsrilu02_numericBoost(size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dbsrilu02_numericBoost", 0);

  /* "cupy/cuda/cusparse.pyx":2890
 * cpdef dbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDbsrilu02_numericBoost(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2891
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2892
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDbsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 *             <double*>tol, <double*>boost_val)
 */
        __pyx_v_status = cusparseDbsrilu02_numericBoost(((cusparseHandle_t)__pyx_v_handle), ((bsrilu02Info_t)__pyx_v_info), __pyx_v_enable_boost, ((double *)__pyx_v_tol), ((double *)__pyx_v_boost_val));
      }

      /* "cupy/cuda/cusparse.pyx":2891
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2895
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 *             <double*>tol, <double*>boost_val)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2888
 *     check_status(status)
 * 
 * cpdef dbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,             # <<<<<<<<<<<<<<
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_255dbsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_254dbsrilu02_numericBoost[] = "dbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost, size_t tol, size_t boost_val)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_255dbsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  size_t __pyx_v_info;
  int __pyx_v_enable_boost;
  size_t __pyx_v_tol;
  size_t __pyx_v_boost_val;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dbsrilu02_numericBoost (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_info,&__pyx_n_s_enable_boost,&__pyx_n_s_tol,&__pyx_n_s_boost_val,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_numericBoost", 1, 5, 5, 1); __PYX_ERR(0, 2888, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_enable_boost)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_numericBoost", 1, 5, 5, 2); __PYX_ERR(0, 2888, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_numericBoost", 1, 5, 5, 3); __PYX_ERR(0, 2888, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_boost_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_numericBoost", 1, 5, 5, 4); __PYX_ERR(0, 2888, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dbsrilu02_numericBoost") < 0)) __PYX_ERR(0, 2888, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2888, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2888, __pyx_L3_error)
    __pyx_v_enable_boost = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_enable_boost == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2888, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_tol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2889, __pyx_L3_error)
    __pyx_v_boost_val = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_boost_val == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2889, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dbsrilu02_numericBoost", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2888, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_254dbsrilu02_numericBoost(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_254dbsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dbsrilu02_numericBoost", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dbsrilu02_numericBoost(__pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2897
 *     check_status(status)
 * 
 * cpdef cbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,             # <<<<<<<<<<<<<<
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_257cbsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cbsrilu02_numericBoost(size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cbsrilu02_numericBoost", 0);

  /* "cupy/cuda/cusparse.pyx":2899
 * cpdef cbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCbsrilu02_numericBoost(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2900
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2901
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCbsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 *             <double*>tol, <cuComplex*>boost_val)
 */
        __pyx_v_status = cusparseCbsrilu02_numericBoost(((cusparseHandle_t)__pyx_v_handle), ((bsrilu02Info_t)__pyx_v_info), __pyx_v_enable_boost, ((double *)__pyx_v_tol), ((cuComplex *)__pyx_v_boost_val));
      }

      /* "cupy/cuda/cusparse.pyx":2900
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2904
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 *             <double*>tol, <cuComplex*>boost_val)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2897
 *     check_status(status)
 * 
 * cpdef cbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,             # <<<<<<<<<<<<<<
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_257cbsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_256cbsrilu02_numericBoost[] = "cbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost, size_t tol, size_t boost_val)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_257cbsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  size_t __pyx_v_info;
  int __pyx_v_enable_boost;
  size_t __pyx_v_tol;
  size_t __pyx_v_boost_val;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cbsrilu02_numericBoost (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_info,&__pyx_n_s_enable_boost,&__pyx_n_s_tol,&__pyx_n_s_boost_val,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_numericBoost", 1, 5, 5, 1); __PYX_ERR(0, 2897, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_enable_boost)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_numericBoost", 1, 5, 5, 2); __PYX_ERR(0, 2897, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_numericBoost", 1, 5, 5, 3); __PYX_ERR(0, 2897, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_boost_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_numericBoost", 1, 5, 5, 4); __PYX_ERR(0, 2897, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cbsrilu02_numericBoost") < 0)) __PYX_ERR(0, 2897, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2897, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2897, __pyx_L3_error)
    __pyx_v_enable_boost = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_enable_boost == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2897, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_tol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2898, __pyx_L3_error)
    __pyx_v_boost_val = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_boost_val == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2898, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cbsrilu02_numericBoost", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2897, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_256cbsrilu02_numericBoost(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_256cbsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cbsrilu02_numericBoost", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cbsrilu02_numericBoost(__pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2906
 *     check_status(status)
 * 
 * cpdef zbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,             # <<<<<<<<<<<<<<
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_259zbsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zbsrilu02_numericBoost(size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zbsrilu02_numericBoost", 0);

  /* "cupy/cuda/cusparse.pyx":2908
 * cpdef zbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZbsrilu02_numericBoost(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2909
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2910
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZbsrilu02_numericBoost(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 *             <double*>tol, <cuDoubleComplex*>boost_val)
 */
        __pyx_v_status = cusparseZbsrilu02_numericBoost(((cusparseHandle_t)__pyx_v_handle), ((bsrilu02Info_t)__pyx_v_info), __pyx_v_enable_boost, ((double *)__pyx_v_tol), ((cuDoubleComplex *)__pyx_v_boost_val));
      }

      /* "cupy/cuda/cusparse.pyx":2909
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsrilu02_numericBoost(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2913
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, enable_boost,
 *             <double*>tol, <cuDoubleComplex*>boost_val)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef xbsrilu02_zeroPivot(size_t handle, size_t info, size_t position):
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2906
 *     check_status(status)
 * 
 * cpdef zbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost,             # <<<<<<<<<<<<<<
 *                              size_t tol, size_t boost_val):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_259zbsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_258zbsrilu02_numericBoost[] = "zbsrilu02_numericBoost(size_t handle, size_t info, int enable_boost, size_t tol, size_t boost_val)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_259zbsrilu02_numericBoost(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  size_t __pyx_v_info;
  int __pyx_v_enable_boost;
  size_t __pyx_v_tol;
  size_t __pyx_v_boost_val;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zbsrilu02_numericBoost (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_info,&__pyx_n_s_enable_boost,&__pyx_n_s_tol,&__pyx_n_s_boost_val,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_numericBoost", 1, 5, 5, 1); __PYX_ERR(0, 2906, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_enable_boost)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_numericBoost", 1, 5, 5, 2); __PYX_ERR(0, 2906, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_numericBoost", 1, 5, 5, 3); __PYX_ERR(0, 2906, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_boost_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_numericBoost", 1, 5, 5, 4); __PYX_ERR(0, 2906, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zbsrilu02_numericBoost") < 0)) __PYX_ERR(0, 2906, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2906, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2906, __pyx_L3_error)
    __pyx_v_enable_boost = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_enable_boost == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2906, __pyx_L3_error)
    __pyx_v_tol = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_tol == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2907, __pyx_L3_error)
    __pyx_v_boost_val = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_boost_val == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2907, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zbsrilu02_numericBoost", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2906, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_258zbsrilu02_numericBoost(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_258zbsrilu02_numericBoost(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, int __pyx_v_enable_boost, size_t __pyx_v_tol, size_t __pyx_v_boost_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zbsrilu02_numericBoost", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zbsrilu02_numericBoost(__pyx_v_handle, __pyx_v_info, __pyx_v_enable_boost, __pyx_v_tol, __pyx_v_boost_val, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsrilu02_numericBoost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2915
 *     check_status(status)
 * 
 * cpdef xbsrilu02_zeroPivot(size_t handle, size_t info, size_t position):             # <<<<<<<<<<<<<<
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_261xbsrilu02_zeroPivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xbsrilu02_zeroPivot(size_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xbsrilu02_zeroPivot", 0);

  /* "cupy/cuda/cusparse.pyx":2916
 * 
 * cpdef xbsrilu02_zeroPivot(size_t handle, size_t info, size_t position):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseXbsrilu02_zeroPivot(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2917
 * cpdef xbsrilu02_zeroPivot(size_t handle, size_t info, size_t position):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseXbsrilu02_zeroPivot(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, <int*>position)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2918
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseXbsrilu02_zeroPivot(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, <int*>position)
 *     check_status(status)
 */
        __pyx_v_status = cusparseXbsrilu02_zeroPivot(((cusparseHandle_t)__pyx_v_handle), ((bsrilu02Info_t)__pyx_v_info), ((int *)__pyx_v_position));
      }

      /* "cupy/cuda/cusparse.pyx":2917
 * cpdef xbsrilu02_zeroPivot(size_t handle, size_t info, size_t position):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseXbsrilu02_zeroPivot(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, <int*>position)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2920
 *         status = cusparseXbsrilu02_zeroPivot(
 *             <cusparseHandle_t>handle, <bsrilu02Info_t>info, <int*>position)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef int sbsrilu02_bufferSize(size_t handle, int dirA, int mb, int nnzb,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2915
 *     check_status(status)
 * 
 * cpdef xbsrilu02_zeroPivot(size_t handle, size_t info, size_t position):             # <<<<<<<<<<<<<<
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xbsrilu02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_261xbsrilu02_zeroPivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_260xbsrilu02_zeroPivot[] = "xbsrilu02_zeroPivot(size_t handle, size_t info, size_t position)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_261xbsrilu02_zeroPivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  size_t __pyx_v_info;
  size_t __pyx_v_position;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xbsrilu02_zeroPivot (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_info,&__pyx_n_s_position,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xbsrilu02_zeroPivot", 1, 3, 3, 1); __PYX_ERR(0, 2915, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_position)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xbsrilu02_zeroPivot", 1, 3, 3, 2); __PYX_ERR(0, 2915, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xbsrilu02_zeroPivot") < 0)) __PYX_ERR(0, 2915, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2915, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2915, __pyx_L3_error)
    __pyx_v_position = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_position == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2915, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xbsrilu02_zeroPivot", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2915, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.xbsrilu02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_260xbsrilu02_zeroPivot(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_position);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_260xbsrilu02_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xbsrilu02_zeroPivot", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_xbsrilu02_zeroPivot(__pyx_v_handle, __pyx_v_info, __pyx_v_position, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xbsrilu02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2922
 *     check_status(status)
 * 
 * cpdef int sbsrilu02_bufferSize(size_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                                size_t descrA, size_t bsrSortedVal,
 *                                size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_263sbsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_sbsrilu02_bufferSize(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sbsrilu02_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":2927
 *                                int blockDim, size_t info):
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSbsrilu02_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2928
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2929
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSbsrilu02_bufferSize(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <float*>bsrSortedVal,
 */
        __pyx_v_status = cusparseSbsrilu02_bufferSize(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((float *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsrilu02Info_t)__pyx_v_info), (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":2928
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2934
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsrilu02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2935
 *             <bsrilu02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int dbsrilu02_bufferSize(size_t handle, int dirA, int mb, int nnzb,
 */
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2922
 *     check_status(status)
 * 
 * cpdef int sbsrilu02_bufferSize(size_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                                size_t descrA, size_t bsrSortedVal,
 *                                size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.sbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_263sbsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_262sbsrilu02_bufferSize[] = "sbsrilu02_bufferSize(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_263sbsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sbsrilu02_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_bufferSize", 1, 10, 10, 1); __PYX_ERR(0, 2922, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_bufferSize", 1, 10, 10, 2); __PYX_ERR(0, 2922, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_bufferSize", 1, 10, 10, 3); __PYX_ERR(0, 2922, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_bufferSize", 1, 10, 10, 4); __PYX_ERR(0, 2922, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_bufferSize", 1, 10, 10, 5); __PYX_ERR(0, 2922, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_bufferSize", 1, 10, 10, 6); __PYX_ERR(0, 2922, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_bufferSize", 1, 10, 10, 7); __PYX_ERR(0, 2922, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_bufferSize", 1, 10, 10, 8); __PYX_ERR(0, 2922, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_bufferSize", 1, 10, 10, 9); __PYX_ERR(0, 2922, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sbsrilu02_bufferSize") < 0)) __PYX_ERR(0, 2922, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2922, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2922, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2922, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2922, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2923, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2923, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2924, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2924, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2925, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2925, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sbsrilu02_bufferSize", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2922, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_262sbsrilu02_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_262sbsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sbsrilu02_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_sbsrilu02_bufferSize(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2937
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int dbsrilu02_bufferSize(size_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                                size_t descrA, size_t bsrSortedVal,
 *                                size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_265dbsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_dbsrilu02_bufferSize(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dbsrilu02_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":2942
 *                                int blockDim, size_t info):
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDbsrilu02_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2943
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2944
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDbsrilu02_bufferSize(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <double*>bsrSortedVal,
 */
        __pyx_v_status = cusparseDbsrilu02_bufferSize(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((double *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsrilu02Info_t)__pyx_v_info), (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":2943
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2949
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsrilu02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2950
 *             <bsrilu02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int cbsrilu02_bufferSize(size_t handle, int dirA, int mb, int nnzb,
 */
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2937
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int dbsrilu02_bufferSize(size_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                                size_t descrA, size_t bsrSortedVal,
 *                                size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.dbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_265dbsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_264dbsrilu02_bufferSize[] = "dbsrilu02_bufferSize(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_265dbsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dbsrilu02_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_bufferSize", 1, 10, 10, 1); __PYX_ERR(0, 2937, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_bufferSize", 1, 10, 10, 2); __PYX_ERR(0, 2937, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_bufferSize", 1, 10, 10, 3); __PYX_ERR(0, 2937, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_bufferSize", 1, 10, 10, 4); __PYX_ERR(0, 2937, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_bufferSize", 1, 10, 10, 5); __PYX_ERR(0, 2937, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_bufferSize", 1, 10, 10, 6); __PYX_ERR(0, 2937, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_bufferSize", 1, 10, 10, 7); __PYX_ERR(0, 2937, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_bufferSize", 1, 10, 10, 8); __PYX_ERR(0, 2937, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_bufferSize", 1, 10, 10, 9); __PYX_ERR(0, 2937, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dbsrilu02_bufferSize") < 0)) __PYX_ERR(0, 2937, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2937, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2937, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2937, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2937, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2938, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2938, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2939, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2939, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2940, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2940, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dbsrilu02_bufferSize", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2937, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_264dbsrilu02_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_264dbsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dbsrilu02_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_dbsrilu02_bufferSize(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2952
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int cbsrilu02_bufferSize(size_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                                size_t descrA, size_t bsrSortedVal,
 *                                size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_267cbsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_cbsrilu02_bufferSize(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cbsrilu02_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":2957
 *                                int blockDim, size_t info):
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCbsrilu02_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2958
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2959
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCbsrilu02_bufferSize(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <cuComplex*>bsrSortedVal,
 */
        __pyx_v_status = cusparseCbsrilu02_bufferSize(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsrilu02Info_t)__pyx_v_info), (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":2958
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2964
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsrilu02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2965
 *             <bsrilu02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int zbsrilu02_bufferSize(size_t handle, int dirA, int mb, int nnzb,
 */
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2952
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int cbsrilu02_bufferSize(size_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                                size_t descrA, size_t bsrSortedVal,
 *                                size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.cbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_267cbsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_266cbsrilu02_bufferSize[] = "cbsrilu02_bufferSize(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_267cbsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cbsrilu02_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_bufferSize", 1, 10, 10, 1); __PYX_ERR(0, 2952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_bufferSize", 1, 10, 10, 2); __PYX_ERR(0, 2952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_bufferSize", 1, 10, 10, 3); __PYX_ERR(0, 2952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_bufferSize", 1, 10, 10, 4); __PYX_ERR(0, 2952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_bufferSize", 1, 10, 10, 5); __PYX_ERR(0, 2952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_bufferSize", 1, 10, 10, 6); __PYX_ERR(0, 2952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_bufferSize", 1, 10, 10, 7); __PYX_ERR(0, 2952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_bufferSize", 1, 10, 10, 8); __PYX_ERR(0, 2952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_bufferSize", 1, 10, 10, 9); __PYX_ERR(0, 2952, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cbsrilu02_bufferSize") < 0)) __PYX_ERR(0, 2952, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2952, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2952, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2952, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2952, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2953, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2953, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2954, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2954, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2955, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2955, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cbsrilu02_bufferSize", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2952, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_266cbsrilu02_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_266cbsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cbsrilu02_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_cbsrilu02_bufferSize(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2967
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int zbsrilu02_bufferSize(size_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                                size_t descrA, size_t bsrSortedVal,
 *                                size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_269zbsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_zbsrilu02_bufferSize(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zbsrilu02_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":2972
 *                                int blockDim, size_t info):
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZbsrilu02_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2973
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2974
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZbsrilu02_bufferSize(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <cuDoubleComplex*>bsrSortedVal,
 */
        __pyx_v_status = cusparseZbsrilu02_bufferSize(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsrilu02Info_t)__pyx_v_info), (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":2973
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsrilu02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2979
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsrilu02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2980
 *             <bsrilu02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef sbsrilu02_analysis(
 */
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":2967
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int zbsrilu02_bufferSize(size_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                                size_t descrA, size_t bsrSortedVal,
 *                                size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.zbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_269zbsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_268zbsrilu02_bufferSize[] = "zbsrilu02_bufferSize(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_269zbsrilu02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zbsrilu02_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_bufferSize", 1, 10, 10, 1); __PYX_ERR(0, 2967, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_bufferSize", 1, 10, 10, 2); __PYX_ERR(0, 2967, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_bufferSize", 1, 10, 10, 3); __PYX_ERR(0, 2967, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_bufferSize", 1, 10, 10, 4); __PYX_ERR(0, 2967, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_bufferSize", 1, 10, 10, 5); __PYX_ERR(0, 2967, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_bufferSize", 1, 10, 10, 6); __PYX_ERR(0, 2967, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_bufferSize", 1, 10, 10, 7); __PYX_ERR(0, 2967, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_bufferSize", 1, 10, 10, 8); __PYX_ERR(0, 2967, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_bufferSize", 1, 10, 10, 9); __PYX_ERR(0, 2967, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zbsrilu02_bufferSize") < 0)) __PYX_ERR(0, 2967, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2967, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2967, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2967, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2967, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2968, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2968, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2969, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2969, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2970, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2970, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zbsrilu02_bufferSize", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2967, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_268zbsrilu02_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_268zbsrilu02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zbsrilu02_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_zbsrilu02_bufferSize(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsrilu02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2982
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef sbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_271sbsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sbsrilu02_analysis(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sbsrilu02_analysis", 0);

  /* "cupy/cuda/cusparse.pyx":2986
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 *         int blockDim, size_t info, int policy, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSbsrilu02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2987
 *         int blockDim, size_t info, int policy, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsrilu02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":2988
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <float*>bsrSortedVal,
 */
        __pyx_v_status = cusparseSbsrilu02_analysis(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((float *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsrilu02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":2987
 *         int blockDim, size_t info, int policy, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsrilu02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":2994
 *             <bsrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dbsrilu02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2982
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef sbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_271sbsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_270sbsrilu02_analysis[] = "sbsrilu02_analysis(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_271sbsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sbsrilu02_analysis (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_analysis", 1, 12, 12, 1); __PYX_ERR(0, 2982, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_analysis", 1, 12, 12, 2); __PYX_ERR(0, 2982, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_analysis", 1, 12, 12, 3); __PYX_ERR(0, 2982, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_analysis", 1, 12, 12, 4); __PYX_ERR(0, 2982, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_analysis", 1, 12, 12, 5); __PYX_ERR(0, 2982, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_analysis", 1, 12, 12, 6); __PYX_ERR(0, 2982, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_analysis", 1, 12, 12, 7); __PYX_ERR(0, 2982, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_analysis", 1, 12, 12, 8); __PYX_ERR(0, 2982, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_analysis", 1, 12, 12, 9); __PYX_ERR(0, 2982, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_analysis", 1, 12, 12, 10); __PYX_ERR(0, 2982, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02_analysis", 1, 12, 12, 11); __PYX_ERR(0, 2982, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sbsrilu02_analysis") < 0)) __PYX_ERR(0, 2982, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2983, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2983, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2983, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2983, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2983, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2984, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2984, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2984, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2985, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2985, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2985, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2985, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sbsrilu02_analysis", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2982, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_270sbsrilu02_analysis(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_270sbsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sbsrilu02_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_sbsrilu02_analysis(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":2996
 *     check_status(status)
 * 
 * cpdef dbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_273dbsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dbsrilu02_analysis(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dbsrilu02_analysis", 0);

  /* "cupy/cuda/cusparse.pyx":3000
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 *         int blockDim, size_t info, int policy, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDbsrilu02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3001
 *         int blockDim, size_t info, int policy, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsrilu02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3002
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <double*>bsrSortedVal,
 */
        __pyx_v_status = cusparseDbsrilu02_analysis(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((double *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsrilu02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3001
 *         int blockDim, size_t info, int policy, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsrilu02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3008
 *             <bsrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cbsrilu02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":2996
 *     check_status(status)
 * 
 * cpdef dbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_273dbsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_272dbsrilu02_analysis[] = "dbsrilu02_analysis(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_273dbsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dbsrilu02_analysis (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_analysis", 1, 12, 12, 1); __PYX_ERR(0, 2996, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_analysis", 1, 12, 12, 2); __PYX_ERR(0, 2996, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_analysis", 1, 12, 12, 3); __PYX_ERR(0, 2996, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_analysis", 1, 12, 12, 4); __PYX_ERR(0, 2996, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_analysis", 1, 12, 12, 5); __PYX_ERR(0, 2996, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_analysis", 1, 12, 12, 6); __PYX_ERR(0, 2996, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_analysis", 1, 12, 12, 7); __PYX_ERR(0, 2996, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_analysis", 1, 12, 12, 8); __PYX_ERR(0, 2996, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_analysis", 1, 12, 12, 9); __PYX_ERR(0, 2996, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_analysis", 1, 12, 12, 10); __PYX_ERR(0, 2996, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02_analysis", 1, 12, 12, 11); __PYX_ERR(0, 2996, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dbsrilu02_analysis") < 0)) __PYX_ERR(0, 2996, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2997, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2997, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2997, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2997, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2997, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2998, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2998, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2998, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2999, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2999, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2999, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2999, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dbsrilu02_analysis", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2996, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_272dbsrilu02_analysis(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_272dbsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dbsrilu02_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dbsrilu02_analysis(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3010
 *     check_status(status)
 * 
 * cpdef cbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_275cbsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cbsrilu02_analysis(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cbsrilu02_analysis", 0);

  /* "cupy/cuda/cusparse.pyx":3014
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 *         int blockDim, size_t info, int policy, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCbsrilu02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3015
 *         int blockDim, size_t info, int policy, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsrilu02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3016
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <cuComplex*>bsrSortedVal,
 */
        __pyx_v_status = cusparseCbsrilu02_analysis(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsrilu02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3015
 *         int blockDim, size_t info, int policy, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsrilu02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3022
 *             <bsrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zbsrilu02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3010
 *     check_status(status)
 * 
 * cpdef cbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_275cbsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_274cbsrilu02_analysis[] = "cbsrilu02_analysis(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_275cbsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cbsrilu02_analysis (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_analysis", 1, 12, 12, 1); __PYX_ERR(0, 3010, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_analysis", 1, 12, 12, 2); __PYX_ERR(0, 3010, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_analysis", 1, 12, 12, 3); __PYX_ERR(0, 3010, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_analysis", 1, 12, 12, 4); __PYX_ERR(0, 3010, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_analysis", 1, 12, 12, 5); __PYX_ERR(0, 3010, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_analysis", 1, 12, 12, 6); __PYX_ERR(0, 3010, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_analysis", 1, 12, 12, 7); __PYX_ERR(0, 3010, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_analysis", 1, 12, 12, 8); __PYX_ERR(0, 3010, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_analysis", 1, 12, 12, 9); __PYX_ERR(0, 3010, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_analysis", 1, 12, 12, 10); __PYX_ERR(0, 3010, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02_analysis", 1, 12, 12, 11); __PYX_ERR(0, 3010, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cbsrilu02_analysis") < 0)) __PYX_ERR(0, 3010, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3011, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3011, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3011, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3011, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3011, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3012, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3012, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3012, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3013, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3013, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3013, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3013, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cbsrilu02_analysis", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3010, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_274cbsrilu02_analysis(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_274cbsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cbsrilu02_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cbsrilu02_analysis(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3024
 *     check_status(status)
 * 
 * cpdef zbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_277zbsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zbsrilu02_analysis(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zbsrilu02_analysis", 0);

  /* "cupy/cuda/cusparse.pyx":3028
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 *         int blockDim, size_t info, int policy, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZbsrilu02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3029
 *         int blockDim, size_t info, int policy, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsrilu02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3030
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <cuDoubleComplex*>bsrSortedVal,
 */
        __pyx_v_status = cusparseZbsrilu02_analysis(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsrilu02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3029
 *         int blockDim, size_t info, int policy, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsrilu02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3036
 *             <bsrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef sbsrilu02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3024
 *     check_status(status)
 * 
 * cpdef zbsrilu02_analysis(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_277zbsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_276zbsrilu02_analysis[] = "zbsrilu02_analysis(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_277zbsrilu02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zbsrilu02_analysis (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_analysis", 1, 12, 12, 1); __PYX_ERR(0, 3024, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_analysis", 1, 12, 12, 2); __PYX_ERR(0, 3024, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_analysis", 1, 12, 12, 3); __PYX_ERR(0, 3024, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_analysis", 1, 12, 12, 4); __PYX_ERR(0, 3024, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_analysis", 1, 12, 12, 5); __PYX_ERR(0, 3024, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_analysis", 1, 12, 12, 6); __PYX_ERR(0, 3024, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_analysis", 1, 12, 12, 7); __PYX_ERR(0, 3024, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_analysis", 1, 12, 12, 8); __PYX_ERR(0, 3024, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_analysis", 1, 12, 12, 9); __PYX_ERR(0, 3024, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_analysis", 1, 12, 12, 10); __PYX_ERR(0, 3024, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02_analysis", 1, 12, 12, 11); __PYX_ERR(0, 3024, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zbsrilu02_analysis") < 0)) __PYX_ERR(0, 3024, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3025, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3025, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3025, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3025, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3025, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3026, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3026, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3026, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3027, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3027, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3027, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3027, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zbsrilu02_analysis", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3024, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_276zbsrilu02_analysis(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_276zbsrilu02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zbsrilu02_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zbsrilu02_analysis(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsrilu02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3038
 *     check_status(status)
 * 
 * cpdef sbsrilu02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,             # <<<<<<<<<<<<<<
 *                 size_t bsrSortedVal, size_t bsrSortedRowPtr,
 *                 size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_279sbsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sbsrilu02(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sbsrilu02", 0);

  /* "cupy/cuda/cusparse.pyx":3042
 *                 size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSbsrilu02(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3043
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsrilu02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3044
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSbsrilu02(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <float*>bsrSortedVal,
 */
        __pyx_v_status = cusparseSbsrilu02(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((float *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsrilu02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3043
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsrilu02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3050
 *             <bsrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dbsrilu02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3038
 *     check_status(status)
 * 
 * cpdef sbsrilu02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,             # <<<<<<<<<<<<<<
 *                 size_t bsrSortedVal, size_t bsrSortedRowPtr,
 *                 size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_279sbsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_278sbsrilu02[] = "sbsrilu02(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_279sbsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sbsrilu02 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02", 1, 12, 12, 1); __PYX_ERR(0, 3038, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02", 1, 12, 12, 2); __PYX_ERR(0, 3038, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02", 1, 12, 12, 3); __PYX_ERR(0, 3038, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02", 1, 12, 12, 4); __PYX_ERR(0, 3038, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02", 1, 12, 12, 5); __PYX_ERR(0, 3038, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02", 1, 12, 12, 6); __PYX_ERR(0, 3038, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02", 1, 12, 12, 7); __PYX_ERR(0, 3038, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02", 1, 12, 12, 8); __PYX_ERR(0, 3038, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02", 1, 12, 12, 9); __PYX_ERR(0, 3038, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02", 1, 12, 12, 10); __PYX_ERR(0, 3038, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsrilu02", 1, 12, 12, 11); __PYX_ERR(0, 3038, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sbsrilu02") < 0)) __PYX_ERR(0, 3038, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3038, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3038, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3038, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3038, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3038, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3039, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3039, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3040, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3040, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3040, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3040, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3041, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sbsrilu02", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3038, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_278sbsrilu02(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_278sbsrilu02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sbsrilu02", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_sbsrilu02(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3052
 *     check_status(status)
 * 
 * cpdef dbsrilu02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,             # <<<<<<<<<<<<<<
 *                 size_t bsrSortedVal, size_t bsrSortedRowPtr,
 *                 size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_281dbsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dbsrilu02(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dbsrilu02", 0);

  /* "cupy/cuda/cusparse.pyx":3056
 *                 size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDbsrilu02(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3057
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsrilu02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3058
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDbsrilu02(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <double*>bsrSortedVal,
 */
        __pyx_v_status = cusparseDbsrilu02(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((double *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsrilu02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3057
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsrilu02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3064
 *             <bsrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cbsrilu02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3052
 *     check_status(status)
 * 
 * cpdef dbsrilu02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,             # <<<<<<<<<<<<<<
 *                 size_t bsrSortedVal, size_t bsrSortedRowPtr,
 *                 size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_281dbsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_280dbsrilu02[] = "dbsrilu02(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_281dbsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dbsrilu02 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02", 1, 12, 12, 1); __PYX_ERR(0, 3052, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02", 1, 12, 12, 2); __PYX_ERR(0, 3052, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02", 1, 12, 12, 3); __PYX_ERR(0, 3052, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02", 1, 12, 12, 4); __PYX_ERR(0, 3052, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02", 1, 12, 12, 5); __PYX_ERR(0, 3052, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02", 1, 12, 12, 6); __PYX_ERR(0, 3052, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02", 1, 12, 12, 7); __PYX_ERR(0, 3052, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02", 1, 12, 12, 8); __PYX_ERR(0, 3052, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02", 1, 12, 12, 9); __PYX_ERR(0, 3052, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02", 1, 12, 12, 10); __PYX_ERR(0, 3052, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsrilu02", 1, 12, 12, 11); __PYX_ERR(0, 3052, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dbsrilu02") < 0)) __PYX_ERR(0, 3052, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3052, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3052, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3052, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3052, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3052, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3053, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3053, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3054, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3054, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3054, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3054, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3055, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dbsrilu02", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3052, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_280dbsrilu02(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_280dbsrilu02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dbsrilu02", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dbsrilu02(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3066
 *     check_status(status)
 * 
 * cpdef cbsrilu02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,             # <<<<<<<<<<<<<<
 *                 size_t bsrSortedVal, size_t bsrSortedRowPtr,
 *                 size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_283cbsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cbsrilu02(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cbsrilu02", 0);

  /* "cupy/cuda/cusparse.pyx":3070
 *                 size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCbsrilu02(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3071
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsrilu02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3072
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCbsrilu02(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <cuComplex*>bsrSortedVal,
 */
        __pyx_v_status = cusparseCbsrilu02(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsrilu02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3071
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsrilu02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3078
 *             <bsrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zbsrilu02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3066
 *     check_status(status)
 * 
 * cpdef cbsrilu02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,             # <<<<<<<<<<<<<<
 *                 size_t bsrSortedVal, size_t bsrSortedRowPtr,
 *                 size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_283cbsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_282cbsrilu02[] = "cbsrilu02(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_283cbsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cbsrilu02 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02", 1, 12, 12, 1); __PYX_ERR(0, 3066, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02", 1, 12, 12, 2); __PYX_ERR(0, 3066, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02", 1, 12, 12, 3); __PYX_ERR(0, 3066, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02", 1, 12, 12, 4); __PYX_ERR(0, 3066, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02", 1, 12, 12, 5); __PYX_ERR(0, 3066, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02", 1, 12, 12, 6); __PYX_ERR(0, 3066, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02", 1, 12, 12, 7); __PYX_ERR(0, 3066, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02", 1, 12, 12, 8); __PYX_ERR(0, 3066, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02", 1, 12, 12, 9); __PYX_ERR(0, 3066, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02", 1, 12, 12, 10); __PYX_ERR(0, 3066, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsrilu02", 1, 12, 12, 11); __PYX_ERR(0, 3066, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cbsrilu02") < 0)) __PYX_ERR(0, 3066, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3066, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3066, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3066, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3066, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3066, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3067, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3067, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3068, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3068, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3068, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3068, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3069, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cbsrilu02", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3066, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_282cbsrilu02(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_282cbsrilu02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cbsrilu02", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cbsrilu02(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3080
 *     check_status(status)
 * 
 * cpdef zbsrilu02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,             # <<<<<<<<<<<<<<
 *                 size_t bsrSortedVal, size_t bsrSortedRowPtr,
 *                 size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_285zbsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zbsrilu02(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zbsrilu02", 0);

  /* "cupy/cuda/cusparse.pyx":3084
 *                 size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZbsrilu02(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3085
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsrilu02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3086
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZbsrilu02(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <cuDoubleComplex*>bsrSortedVal,
 */
        __pyx_v_status = cusparseZbsrilu02(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsrilu02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3085
 *                 size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsrilu02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3092
 *             <bsrilu02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef xcsric02_zeroPivot(size_t handle, size_t info, size_t position):
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3080
 *     check_status(status)
 * 
 * cpdef zbsrilu02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,             # <<<<<<<<<<<<<<
 *                 size_t bsrSortedVal, size_t bsrSortedRowPtr,
 *                 size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_285zbsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_284zbsrilu02[] = "zbsrilu02(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_285zbsrilu02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zbsrilu02 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02", 1, 12, 12, 1); __PYX_ERR(0, 3080, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02", 1, 12, 12, 2); __PYX_ERR(0, 3080, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02", 1, 12, 12, 3); __PYX_ERR(0, 3080, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02", 1, 12, 12, 4); __PYX_ERR(0, 3080, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02", 1, 12, 12, 5); __PYX_ERR(0, 3080, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02", 1, 12, 12, 6); __PYX_ERR(0, 3080, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02", 1, 12, 12, 7); __PYX_ERR(0, 3080, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02", 1, 12, 12, 8); __PYX_ERR(0, 3080, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02", 1, 12, 12, 9); __PYX_ERR(0, 3080, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02", 1, 12, 12, 10); __PYX_ERR(0, 3080, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsrilu02", 1, 12, 12, 11); __PYX_ERR(0, 3080, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zbsrilu02") < 0)) __PYX_ERR(0, 3080, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3080, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3080, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3080, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3080, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3080, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3081, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3081, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3082, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3082, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3082, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3082, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3083, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zbsrilu02", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3080, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_284zbsrilu02(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_284zbsrilu02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zbsrilu02", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zbsrilu02(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsrilu02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3094
 *     check_status(status)
 * 
 * cpdef xcsric02_zeroPivot(size_t handle, size_t info, size_t position):             # <<<<<<<<<<<<<<
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_287xcsric02_zeroPivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xcsric02_zeroPivot(size_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsric02_zeroPivot", 0);

  /* "cupy/cuda/cusparse.pyx":3095
 * 
 * cpdef xcsric02_zeroPivot(size_t handle, size_t info, size_t position):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseXcsric02_zeroPivot(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3096
 * cpdef xcsric02_zeroPivot(size_t handle, size_t info, size_t position):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseXcsric02_zeroPivot(
 *             <cusparseHandle_t>handle, <csric02Info_t>info, <int*>position)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3097
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseXcsric02_zeroPivot(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <csric02Info_t>info, <int*>position)
 *     check_status(status)
 */
        __pyx_v_status = cusparseXcsric02_zeroPivot(((cusparseHandle_t)__pyx_v_handle), ((csric02Info_t)__pyx_v_info), ((int *)__pyx_v_position));
      }

      /* "cupy/cuda/cusparse.pyx":3096
 * cpdef xcsric02_zeroPivot(size_t handle, size_t info, size_t position):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseXcsric02_zeroPivot(
 *             <cusparseHandle_t>handle, <csric02Info_t>info, <int*>position)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3099
 *         status = cusparseXcsric02_zeroPivot(
 *             <cusparseHandle_t>handle, <csric02Info_t>info, <int*>position)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef int scsric02_bufferSize(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3094
 *     check_status(status)
 * 
 * cpdef xcsric02_zeroPivot(size_t handle, size_t info, size_t position):             # <<<<<<<<<<<<<<
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsric02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_287xcsric02_zeroPivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_286xcsric02_zeroPivot[] = "xcsric02_zeroPivot(size_t handle, size_t info, size_t position)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_287xcsric02_zeroPivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  size_t __pyx_v_info;
  size_t __pyx_v_position;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xcsric02_zeroPivot (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_info,&__pyx_n_s_position,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsric02_zeroPivot", 1, 3, 3, 1); __PYX_ERR(0, 3094, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_position)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xcsric02_zeroPivot", 1, 3, 3, 2); __PYX_ERR(0, 3094, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xcsric02_zeroPivot") < 0)) __PYX_ERR(0, 3094, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3094, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3094, __pyx_L3_error)
    __pyx_v_position = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_position == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3094, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xcsric02_zeroPivot", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3094, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsric02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_286xcsric02_zeroPivot(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_position);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_286xcsric02_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xcsric02_zeroPivot", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_xcsric02_zeroPivot(__pyx_v_handle, __pyx_v_info, __pyx_v_position, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xcsric02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3101
 *     check_status(status)
 * 
 * cpdef int scsric02_bufferSize(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                               size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                               size_t csrSortedColIndA, size_t info):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_289scsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_scsric02_bufferSize(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsric02_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":3105
 *                               size_t csrSortedColIndA, size_t info):
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseScsric02_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3106
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsric02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3107
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseScsric02_bufferSize(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <float*>csrSortedValA, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseScsric02_bufferSize(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((float *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csric02Info_t)__pyx_v_info), (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3106
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsric02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3112
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3113
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int dcsric02_bufferSize(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3101
 *     check_status(status)
 * 
 * cpdef int scsric02_bufferSize(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                               size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                               size_t csrSortedColIndA, size_t info):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.scsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_289scsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_288scsric02_bufferSize[] = "scsric02_bufferSize(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_289scsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsric02_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02_bufferSize", 1, 8, 8, 1); __PYX_ERR(0, 3101, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02_bufferSize", 1, 8, 8, 2); __PYX_ERR(0, 3101, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02_bufferSize", 1, 8, 8, 3); __PYX_ERR(0, 3101, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02_bufferSize", 1, 8, 8, 4); __PYX_ERR(0, 3101, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02_bufferSize", 1, 8, 8, 5); __PYX_ERR(0, 3101, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02_bufferSize", 1, 8, 8, 6); __PYX_ERR(0, 3101, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02_bufferSize", 1, 8, 8, 7); __PYX_ERR(0, 3101, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsric02_bufferSize") < 0)) __PYX_ERR(0, 3101, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3101, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3101, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3101, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3101, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3102, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3102, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3103, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3103, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsric02_bufferSize", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3101, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_288scsric02_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_288scsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsric02_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_scsric02_bufferSize(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3115
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int dcsric02_bufferSize(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                               size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                               size_t csrSortedColIndA, size_t info):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_291dcsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_dcsric02_bufferSize(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsric02_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":3119
 *                               size_t csrSortedColIndA, size_t info):
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDcsric02_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3120
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsric02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3121
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDcsric02_bufferSize(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <double*>csrSortedValA, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseDcsric02_bufferSize(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((double *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csric02Info_t)__pyx_v_info), (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3120
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsric02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3126
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3127
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int ccsric02_bufferSize(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3115
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int dcsric02_bufferSize(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                               size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                               size_t csrSortedColIndA, size_t info):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.dcsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_291dcsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_290dcsric02_bufferSize[] = "dcsric02_bufferSize(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_291dcsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsric02_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02_bufferSize", 1, 8, 8, 1); __PYX_ERR(0, 3115, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02_bufferSize", 1, 8, 8, 2); __PYX_ERR(0, 3115, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02_bufferSize", 1, 8, 8, 3); __PYX_ERR(0, 3115, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02_bufferSize", 1, 8, 8, 4); __PYX_ERR(0, 3115, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02_bufferSize", 1, 8, 8, 5); __PYX_ERR(0, 3115, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02_bufferSize", 1, 8, 8, 6); __PYX_ERR(0, 3115, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02_bufferSize", 1, 8, 8, 7); __PYX_ERR(0, 3115, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsric02_bufferSize") < 0)) __PYX_ERR(0, 3115, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3115, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3115, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3115, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3115, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3116, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3116, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3117, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3117, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsric02_bufferSize", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3115, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_290dcsric02_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_290dcsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsric02_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_dcsric02_bufferSize(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3129
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int ccsric02_bufferSize(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                               size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                               size_t csrSortedColIndA, size_t info):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_293ccsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_ccsric02_bufferSize(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsric02_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":3133
 *                               size_t csrSortedColIndA, size_t info):
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCcsric02_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3134
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsric02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3135
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCcsric02_bufferSize(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <cuComplex*>csrSortedValA, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseCcsric02_bufferSize(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csric02Info_t)__pyx_v_info), (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3134
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsric02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3140
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3141
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int zcsric02_bufferSize(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3129
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int ccsric02_bufferSize(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                               size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                               size_t csrSortedColIndA, size_t info):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.ccsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_293ccsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_292ccsric02_bufferSize[] = "ccsric02_bufferSize(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_293ccsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsric02_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02_bufferSize", 1, 8, 8, 1); __PYX_ERR(0, 3129, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02_bufferSize", 1, 8, 8, 2); __PYX_ERR(0, 3129, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02_bufferSize", 1, 8, 8, 3); __PYX_ERR(0, 3129, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02_bufferSize", 1, 8, 8, 4); __PYX_ERR(0, 3129, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02_bufferSize", 1, 8, 8, 5); __PYX_ERR(0, 3129, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02_bufferSize", 1, 8, 8, 6); __PYX_ERR(0, 3129, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02_bufferSize", 1, 8, 8, 7); __PYX_ERR(0, 3129, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsric02_bufferSize") < 0)) __PYX_ERR(0, 3129, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3129, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3129, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3129, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3129, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3130, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3130, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3131, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3131, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsric02_bufferSize", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3129, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_292ccsric02_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_292ccsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsric02_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_ccsric02_bufferSize(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3143
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int zcsric02_bufferSize(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                               size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                               size_t csrSortedColIndA, size_t info):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_295zcsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_zcsric02_bufferSize(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsric02_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":3147
 *                               size_t csrSortedColIndA, size_t info):
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZcsric02_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3148
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsric02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3149
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZcsric02_bufferSize(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <cuDoubleComplex*>csrSortedValA, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseZcsric02_bufferSize(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csric02Info_t)__pyx_v_info), (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3148
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsric02_bufferSize(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3154
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3155
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef scsric02_analysis(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3143
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int zcsric02_bufferSize(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                               size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                               size_t csrSortedColIndA, size_t info):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.zcsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_295zcsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_294zcsric02_bufferSize[] = "zcsric02_bufferSize(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_295zcsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsric02_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02_bufferSize", 1, 8, 8, 1); __PYX_ERR(0, 3143, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02_bufferSize", 1, 8, 8, 2); __PYX_ERR(0, 3143, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02_bufferSize", 1, 8, 8, 3); __PYX_ERR(0, 3143, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02_bufferSize", 1, 8, 8, 4); __PYX_ERR(0, 3143, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02_bufferSize", 1, 8, 8, 5); __PYX_ERR(0, 3143, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02_bufferSize", 1, 8, 8, 6); __PYX_ERR(0, 3143, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02_bufferSize", 1, 8, 8, 7); __PYX_ERR(0, 3143, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsric02_bufferSize") < 0)) __PYX_ERR(0, 3143, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3143, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3143, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3143, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3143, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3144, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3144, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3145, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3145, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsric02_bufferSize", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3143, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_294zcsric02_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_294zcsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsric02_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_zcsric02_bufferSize(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3157
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef scsric02_analysis(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                         size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                         size_t csrSortedColIndA, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_297scsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsric02_analysis(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsric02_analysis", 0);

  /* "cupy/cuda/cusparse.pyx":3161
 *                         size_t csrSortedColIndA, size_t info, int policy,
 *                         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseScsric02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3162
 *                         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsric02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3163
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseScsric02_analysis(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <const float*>csrSortedValA, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseScsric02_analysis(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((float const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csric02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3162
 *                         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsric02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3168
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dcsric02_analysis(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3157
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef scsric02_analysis(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                         size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                         size_t csrSortedColIndA, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_297scsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_296scsric02_analysis[] = "scsric02_analysis(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_297scsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsric02_analysis (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02_analysis", 1, 10, 10, 1); __PYX_ERR(0, 3157, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02_analysis", 1, 10, 10, 2); __PYX_ERR(0, 3157, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02_analysis", 1, 10, 10, 3); __PYX_ERR(0, 3157, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02_analysis", 1, 10, 10, 4); __PYX_ERR(0, 3157, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02_analysis", 1, 10, 10, 5); __PYX_ERR(0, 3157, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02_analysis", 1, 10, 10, 6); __PYX_ERR(0, 3157, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02_analysis", 1, 10, 10, 7); __PYX_ERR(0, 3157, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02_analysis", 1, 10, 10, 8); __PYX_ERR(0, 3157, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02_analysis", 1, 10, 10, 9); __PYX_ERR(0, 3157, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsric02_analysis") < 0)) __PYX_ERR(0, 3157, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3157, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3157, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3157, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3157, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3158, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3158, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3159, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3159, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3159, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3160, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsric02_analysis", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3157, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_296scsric02_analysis(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_296scsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsric02_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_scsric02_analysis(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3170
 *     check_status(status)
 * 
 * cpdef dcsric02_analysis(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                         size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                         size_t csrSortedColIndA, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_299dcsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsric02_analysis(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsric02_analysis", 0);

  /* "cupy/cuda/cusparse.pyx":3174
 *                         size_t csrSortedColIndA, size_t info, int policy,
 *                         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDcsric02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3175
 *                         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsric02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3176
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDcsric02_analysis(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <const double*>csrSortedValA, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseDcsric02_analysis(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((double const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csric02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3175
 *                         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsric02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3181
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef ccsric02_analysis(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3170
 *     check_status(status)
 * 
 * cpdef dcsric02_analysis(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                         size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                         size_t csrSortedColIndA, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_299dcsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_298dcsric02_analysis[] = "dcsric02_analysis(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_299dcsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsric02_analysis (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02_analysis", 1, 10, 10, 1); __PYX_ERR(0, 3170, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02_analysis", 1, 10, 10, 2); __PYX_ERR(0, 3170, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02_analysis", 1, 10, 10, 3); __PYX_ERR(0, 3170, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02_analysis", 1, 10, 10, 4); __PYX_ERR(0, 3170, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02_analysis", 1, 10, 10, 5); __PYX_ERR(0, 3170, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02_analysis", 1, 10, 10, 6); __PYX_ERR(0, 3170, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02_analysis", 1, 10, 10, 7); __PYX_ERR(0, 3170, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02_analysis", 1, 10, 10, 8); __PYX_ERR(0, 3170, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02_analysis", 1, 10, 10, 9); __PYX_ERR(0, 3170, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsric02_analysis") < 0)) __PYX_ERR(0, 3170, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3170, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3170, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3170, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3170, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3171, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3171, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3172, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3172, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3172, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3173, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsric02_analysis", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3170, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_298dcsric02_analysis(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_298dcsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsric02_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dcsric02_analysis(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3183
 *     check_status(status)
 * 
 * cpdef ccsric02_analysis(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                         size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                         size_t csrSortedColIndA, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_301ccsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsric02_analysis(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsric02_analysis", 0);

  /* "cupy/cuda/cusparse.pyx":3187
 *                         size_t csrSortedColIndA, size_t info, int policy,
 *                         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCcsric02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3188
 *                         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsric02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3189
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCcsric02_analysis(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <const cuComplex*>csrSortedValA, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseCcsric02_analysis(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csric02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3188
 *                         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsric02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3194
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zcsric02_analysis(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3183
 *     check_status(status)
 * 
 * cpdef ccsric02_analysis(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                         size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                         size_t csrSortedColIndA, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_301ccsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_300ccsric02_analysis[] = "ccsric02_analysis(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_301ccsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsric02_analysis (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02_analysis", 1, 10, 10, 1); __PYX_ERR(0, 3183, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02_analysis", 1, 10, 10, 2); __PYX_ERR(0, 3183, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02_analysis", 1, 10, 10, 3); __PYX_ERR(0, 3183, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02_analysis", 1, 10, 10, 4); __PYX_ERR(0, 3183, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02_analysis", 1, 10, 10, 5); __PYX_ERR(0, 3183, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02_analysis", 1, 10, 10, 6); __PYX_ERR(0, 3183, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02_analysis", 1, 10, 10, 7); __PYX_ERR(0, 3183, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02_analysis", 1, 10, 10, 8); __PYX_ERR(0, 3183, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02_analysis", 1, 10, 10, 9); __PYX_ERR(0, 3183, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsric02_analysis") < 0)) __PYX_ERR(0, 3183, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3183, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3183, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3183, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3183, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3184, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3184, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3185, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3185, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3185, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3186, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsric02_analysis", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3183, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_300ccsric02_analysis(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_300ccsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsric02_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ccsric02_analysis(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3196
 *     check_status(status)
 * 
 * cpdef zcsric02_analysis(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                         size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                         size_t csrSortedColIndA, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_303zcsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsric02_analysis(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsric02_analysis", 0);

  /* "cupy/cuda/cusparse.pyx":3200
 *                         size_t csrSortedColIndA, size_t info, int policy,
 *                         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZcsric02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3201
 *                         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsric02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3202
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZcsric02_analysis(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <const cuDoubleComplex*>csrSortedValA,
 */
        __pyx_v_status = cusparseZcsric02_analysis(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex const *)__pyx_v_csrSortedValA), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csric02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3201
 *                         size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsric02_analysis(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3207
 *             <const int*>csrSortedRowPtrA, <const int*>csrSortedColIndA,
 *             <csric02Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef scsric02(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3196
 *     check_status(status)
 * 
 * cpdef zcsric02_analysis(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                         size_t csrSortedValA, size_t csrSortedRowPtrA,
 *                         size_t csrSortedColIndA, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_303zcsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_302zcsric02_analysis[] = "zcsric02_analysis(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_303zcsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsric02_analysis (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02_analysis", 1, 10, 10, 1); __PYX_ERR(0, 3196, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02_analysis", 1, 10, 10, 2); __PYX_ERR(0, 3196, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02_analysis", 1, 10, 10, 3); __PYX_ERR(0, 3196, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02_analysis", 1, 10, 10, 4); __PYX_ERR(0, 3196, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02_analysis", 1, 10, 10, 5); __PYX_ERR(0, 3196, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02_analysis", 1, 10, 10, 6); __PYX_ERR(0, 3196, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02_analysis", 1, 10, 10, 7); __PYX_ERR(0, 3196, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02_analysis", 1, 10, 10, 8); __PYX_ERR(0, 3196, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02_analysis", 1, 10, 10, 9); __PYX_ERR(0, 3196, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsric02_analysis") < 0)) __PYX_ERR(0, 3196, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3196, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3196, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3196, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3196, __pyx_L3_error)
    __pyx_v_csrSortedValA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3197, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3197, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3198, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3198, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3198, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3199, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsric02_analysis", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3196, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_302zcsric02_analysis(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_302zcsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsric02_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zcsric02_analysis(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3209
 *     check_status(status)
 * 
 * cpdef scsric02(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
 *                size_t csrSortedColIndA, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_305scsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_scsric02(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsric02", 0);

  /* "cupy/cuda/cusparse.pyx":3213
 *                size_t csrSortedColIndA, size_t info, int policy,
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseScsric02(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3214
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsric02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3215
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseScsric02(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <float*>csrSortedValA_valM, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseScsric02(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((float *)__pyx_v_csrSortedValA_valM), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csric02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3214
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseScsric02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3220
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dcsric02(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3209
 *     check_status(status)
 * 
 * cpdef scsric02(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
 *                size_t csrSortedColIndA, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_305scsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_304scsric02[] = "scsric02(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA_valM, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_305scsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA_valM;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scsric02 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA_valM,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02", 1, 10, 10, 1); __PYX_ERR(0, 3209, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02", 1, 10, 10, 2); __PYX_ERR(0, 3209, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02", 1, 10, 10, 3); __PYX_ERR(0, 3209, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA_valM)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02", 1, 10, 10, 4); __PYX_ERR(0, 3209, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02", 1, 10, 10, 5); __PYX_ERR(0, 3209, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02", 1, 10, 10, 6); __PYX_ERR(0, 3209, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02", 1, 10, 10, 7); __PYX_ERR(0, 3209, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02", 1, 10, 10, 8); __PYX_ERR(0, 3209, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scsric02", 1, 10, 10, 9); __PYX_ERR(0, 3209, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scsric02") < 0)) __PYX_ERR(0, 3209, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3209, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3209, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3209, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3209, __pyx_L3_error)
    __pyx_v_csrSortedValA_valM = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA_valM == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3210, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3210, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3211, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3211, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3211, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3212, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scsric02", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3209, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_304scsric02(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA_valM, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_304scsric02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scsric02", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_scsric02(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA_valM, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.scsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3222
 *     check_status(status)
 * 
 * cpdef dcsric02(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
 *                size_t csrSortedColIndA, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_307dcsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dcsric02(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsric02", 0);

  /* "cupy/cuda/cusparse.pyx":3226
 *                size_t csrSortedColIndA, size_t info, int policy,
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDcsric02(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3227
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsric02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3228
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDcsric02(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <double*>csrSortedValA_valM, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseDcsric02(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((double *)__pyx_v_csrSortedValA_valM), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csric02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3227
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDcsric02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3233
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef ccsric02(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3222
 *     check_status(status)
 * 
 * cpdef dcsric02(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
 *                size_t csrSortedColIndA, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_307dcsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_306dcsric02[] = "dcsric02(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA_valM, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_307dcsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA_valM;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dcsric02 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA_valM,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02", 1, 10, 10, 1); __PYX_ERR(0, 3222, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02", 1, 10, 10, 2); __PYX_ERR(0, 3222, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02", 1, 10, 10, 3); __PYX_ERR(0, 3222, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA_valM)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02", 1, 10, 10, 4); __PYX_ERR(0, 3222, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02", 1, 10, 10, 5); __PYX_ERR(0, 3222, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02", 1, 10, 10, 6); __PYX_ERR(0, 3222, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02", 1, 10, 10, 7); __PYX_ERR(0, 3222, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02", 1, 10, 10, 8); __PYX_ERR(0, 3222, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dcsric02", 1, 10, 10, 9); __PYX_ERR(0, 3222, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dcsric02") < 0)) __PYX_ERR(0, 3222, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3222, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3222, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3222, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3222, __pyx_L3_error)
    __pyx_v_csrSortedValA_valM = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA_valM == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3223, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3223, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3224, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3224, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3224, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3225, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dcsric02", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3222, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_306dcsric02(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA_valM, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_306dcsric02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dcsric02", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dcsric02(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA_valM, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dcsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3235
 *     check_status(status)
 * 
 * cpdef ccsric02(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
 *                size_t csrSortedColIndA, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_309ccsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_ccsric02(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsric02", 0);

  /* "cupy/cuda/cusparse.pyx":3239
 *                size_t csrSortedColIndA, size_t info, int policy,
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCcsric02(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3240
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsric02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3241
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCcsric02(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <cuComplex*>csrSortedValA_valM, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseCcsric02(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex *)__pyx_v_csrSortedValA_valM), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csric02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3240
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCcsric02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3246
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zcsric02(size_t handle, int m, int nnz, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3235
 *     check_status(status)
 * 
 * cpdef ccsric02(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
 *                size_t csrSortedColIndA, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_309ccsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_308ccsric02[] = "ccsric02(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA_valM, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_309ccsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA_valM;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ccsric02 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA_valM,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02", 1, 10, 10, 1); __PYX_ERR(0, 3235, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02", 1, 10, 10, 2); __PYX_ERR(0, 3235, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02", 1, 10, 10, 3); __PYX_ERR(0, 3235, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA_valM)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02", 1, 10, 10, 4); __PYX_ERR(0, 3235, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02", 1, 10, 10, 5); __PYX_ERR(0, 3235, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02", 1, 10, 10, 6); __PYX_ERR(0, 3235, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02", 1, 10, 10, 7); __PYX_ERR(0, 3235, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02", 1, 10, 10, 8); __PYX_ERR(0, 3235, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ccsric02", 1, 10, 10, 9); __PYX_ERR(0, 3235, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ccsric02") < 0)) __PYX_ERR(0, 3235, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3235, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3235, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3235, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3235, __pyx_L3_error)
    __pyx_v_csrSortedValA_valM = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA_valM == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3236, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3236, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3237, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3237, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3237, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3238, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ccsric02", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3235, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_308ccsric02(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA_valM, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_308ccsric02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ccsric02", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_ccsric02(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA_valM, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.ccsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3248
 *     check_status(status)
 * 
 * cpdef zcsric02(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
 *                size_t csrSortedColIndA, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_311zcsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zcsric02(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsric02", 0);

  /* "cupy/cuda/cusparse.pyx":3252
 *                size_t csrSortedColIndA, size_t info, int policy,
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZcsric02(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3253
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsric02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3254
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZcsric02(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 *             <cuDoubleComplex*>csrSortedValA_valM, <const int*>csrSortedRowPtrA,
 */
        __pyx_v_status = cusparseZcsric02(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_nnz, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex *)__pyx_v_csrSortedValA_valM), ((int const *)__pyx_v_csrSortedRowPtrA), ((int const *)__pyx_v_csrSortedColIndA), ((csric02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3253
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZcsric02(
 *             <cusparseHandle_t>handle, m, nnz, <const cusparseMatDescr_t>descrA,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3259
 *             <const int*>csrSortedColIndA, <csric02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef xbsric02_zeroPivot(size_t handle, size_t info, size_t position):
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3248
 *     check_status(status)
 * 
 * cpdef zcsric02(size_t handle, int m, int nnz, size_t descrA,             # <<<<<<<<<<<<<<
 *                size_t csrSortedValA_valM, size_t csrSortedRowPtrA,
 *                size_t csrSortedColIndA, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_311zcsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_310zcsric02[] = "zcsric02(size_t handle, int m, int nnz, size_t descrA, size_t csrSortedValA_valM, size_t csrSortedRowPtrA, size_t csrSortedColIndA, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_311zcsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_nnz;
  size_t __pyx_v_descrA;
  size_t __pyx_v_csrSortedValA_valM;
  size_t __pyx_v_csrSortedRowPtrA;
  size_t __pyx_v_csrSortedColIndA;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zcsric02 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_nnz,&__pyx_n_s_descrA,&__pyx_n_s_csrSortedValA_valM,&__pyx_n_s_csrSortedRowPtrA,&__pyx_n_s_csrSortedColIndA,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02", 1, 10, 10, 1); __PYX_ERR(0, 3248, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02", 1, 10, 10, 2); __PYX_ERR(0, 3248, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02", 1, 10, 10, 3); __PYX_ERR(0, 3248, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedValA_valM)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02", 1, 10, 10, 4); __PYX_ERR(0, 3248, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedRowPtrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02", 1, 10, 10, 5); __PYX_ERR(0, 3248, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrSortedColIndA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02", 1, 10, 10, 6); __PYX_ERR(0, 3248, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02", 1, 10, 10, 7); __PYX_ERR(0, 3248, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02", 1, 10, 10, 8); __PYX_ERR(0, 3248, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zcsric02", 1, 10, 10, 9); __PYX_ERR(0, 3248, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zcsric02") < 0)) __PYX_ERR(0, 3248, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3248, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3248, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3248, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3248, __pyx_L3_error)
    __pyx_v_csrSortedValA_valM = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_csrSortedValA_valM == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3249, __pyx_L3_error)
    __pyx_v_csrSortedRowPtrA = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_csrSortedRowPtrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3249, __pyx_L3_error)
    __pyx_v_csrSortedColIndA = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_csrSortedColIndA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3250, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3250, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3250, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3251, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zcsric02", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3248, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_310zcsric02(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA_valM, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_310zcsric02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_nnz, size_t __pyx_v_descrA, size_t __pyx_v_csrSortedValA_valM, size_t __pyx_v_csrSortedRowPtrA, size_t __pyx_v_csrSortedColIndA, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zcsric02", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zcsric02(__pyx_v_handle, __pyx_v_m, __pyx_v_nnz, __pyx_v_descrA, __pyx_v_csrSortedValA_valM, __pyx_v_csrSortedRowPtrA, __pyx_v_csrSortedColIndA, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zcsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3261
 *     check_status(status)
 * 
 * cpdef xbsric02_zeroPivot(size_t handle, size_t info, size_t position):             # <<<<<<<<<<<<<<
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_313xbsric02_zeroPivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_xbsric02_zeroPivot(size_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xbsric02_zeroPivot", 0);

  /* "cupy/cuda/cusparse.pyx":3262
 * 
 * cpdef xbsric02_zeroPivot(size_t handle, size_t info, size_t position):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseXbsric02_zeroPivot(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3263
 * cpdef xbsric02_zeroPivot(size_t handle, size_t info, size_t position):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseXbsric02_zeroPivot(
 *             <cusparseHandle_t>handle, <bsric02Info_t>info, <int*>position)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3264
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseXbsric02_zeroPivot(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <bsric02Info_t>info, <int*>position)
 *     check_status(status)
 */
        __pyx_v_status = cusparseXbsric02_zeroPivot(((cusparseHandle_t)__pyx_v_handle), ((bsric02Info_t)__pyx_v_info), ((int *)__pyx_v_position));
      }

      /* "cupy/cuda/cusparse.pyx":3263
 * cpdef xbsric02_zeroPivot(size_t handle, size_t info, size_t position):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseXbsric02_zeroPivot(
 *             <cusparseHandle_t>handle, <bsric02Info_t>info, <int*>position)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3266
 *         status = cusparseXbsric02_zeroPivot(
 *             <cusparseHandle_t>handle, <bsric02Info_t>info, <int*>position)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef int sbsric02_bufferSize(size_t handle, int dirA, int mb, int nnzb,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3261
 *     check_status(status)
 * 
 * cpdef xbsric02_zeroPivot(size_t handle, size_t info, size_t position):             # <<<<<<<<<<<<<<
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xbsric02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_313xbsric02_zeroPivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_312xbsric02_zeroPivot[] = "xbsric02_zeroPivot(size_t handle, size_t info, size_t position)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_313xbsric02_zeroPivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  size_t __pyx_v_info;
  size_t __pyx_v_position;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xbsric02_zeroPivot (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_info,&__pyx_n_s_position,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xbsric02_zeroPivot", 1, 3, 3, 1); __PYX_ERR(0, 3261, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_position)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("xbsric02_zeroPivot", 1, 3, 3, 2); __PYX_ERR(0, 3261, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xbsric02_zeroPivot") < 0)) __PYX_ERR(0, 3261, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3261, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3261, __pyx_L3_error)
    __pyx_v_position = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_position == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3261, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xbsric02_zeroPivot", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3261, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.xbsric02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_312xbsric02_zeroPivot(__pyx_self, __pyx_v_handle, __pyx_v_info, __pyx_v_position);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_312xbsric02_zeroPivot(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, size_t __pyx_v_info, size_t __pyx_v_position) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xbsric02_zeroPivot", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_xbsric02_zeroPivot(__pyx_v_handle, __pyx_v_info, __pyx_v_position, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.xbsric02_zeroPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3268
 *     check_status(status)
 * 
 * cpdef int sbsric02_bufferSize(size_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                               size_t descrA, size_t bsrSortedVal,
 *                               size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_315sbsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_sbsric02_bufferSize(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sbsric02_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":3273
 *                               int blockDim, size_t info):
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSbsric02_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3274
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsric02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3275
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSbsric02_bufferSize(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <float*>bsrSortedVal,
 */
        __pyx_v_status = cusparseSbsric02_bufferSize(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((float *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsric02Info_t)__pyx_v_info), (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3274
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsric02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3280
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsric02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3281
 *             <bsric02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int dbsric02_bufferSize(size_t handle, int dirA, int mb, int nnzb,
 */
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3268
 *     check_status(status)
 * 
 * cpdef int sbsric02_bufferSize(size_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                               size_t descrA, size_t bsrSortedVal,
 *                               size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.sbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_315sbsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_314sbsric02_bufferSize[] = "sbsric02_bufferSize(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_315sbsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sbsric02_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_bufferSize", 1, 10, 10, 1); __PYX_ERR(0, 3268, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_bufferSize", 1, 10, 10, 2); __PYX_ERR(0, 3268, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_bufferSize", 1, 10, 10, 3); __PYX_ERR(0, 3268, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_bufferSize", 1, 10, 10, 4); __PYX_ERR(0, 3268, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_bufferSize", 1, 10, 10, 5); __PYX_ERR(0, 3268, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_bufferSize", 1, 10, 10, 6); __PYX_ERR(0, 3268, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_bufferSize", 1, 10, 10, 7); __PYX_ERR(0, 3268, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_bufferSize", 1, 10, 10, 8); __PYX_ERR(0, 3268, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_bufferSize", 1, 10, 10, 9); __PYX_ERR(0, 3268, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sbsric02_bufferSize") < 0)) __PYX_ERR(0, 3268, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3268, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3268, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3268, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3268, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3269, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3269, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3270, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3270, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3271, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3271, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sbsric02_bufferSize", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3268, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_314sbsric02_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_314sbsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sbsric02_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_sbsric02_bufferSize(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3283
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int dbsric02_bufferSize(size_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                               size_t descrA, size_t bsrSortedVal,
 *                               size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_317dbsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_dbsric02_bufferSize(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dbsric02_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":3288
 *                               int blockDim, size_t info):
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDbsric02_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3289
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsric02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3290
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDbsric02_bufferSize(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <double*>bsrSortedVal,
 */
        __pyx_v_status = cusparseDbsric02_bufferSize(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((double *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsric02Info_t)__pyx_v_info), (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3289
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsric02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3295
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsric02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3296
 *             <bsric02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int cbsric02_bufferSize(size_t handle, int dirA, int mb, int nnzb,
 */
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3283
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int dbsric02_bufferSize(size_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                               size_t descrA, size_t bsrSortedVal,
 *                               size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.dbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_317dbsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_316dbsric02_bufferSize[] = "dbsric02_bufferSize(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_317dbsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dbsric02_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_bufferSize", 1, 10, 10, 1); __PYX_ERR(0, 3283, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_bufferSize", 1, 10, 10, 2); __PYX_ERR(0, 3283, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_bufferSize", 1, 10, 10, 3); __PYX_ERR(0, 3283, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_bufferSize", 1, 10, 10, 4); __PYX_ERR(0, 3283, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_bufferSize", 1, 10, 10, 5); __PYX_ERR(0, 3283, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_bufferSize", 1, 10, 10, 6); __PYX_ERR(0, 3283, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_bufferSize", 1, 10, 10, 7); __PYX_ERR(0, 3283, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_bufferSize", 1, 10, 10, 8); __PYX_ERR(0, 3283, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_bufferSize", 1, 10, 10, 9); __PYX_ERR(0, 3283, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dbsric02_bufferSize") < 0)) __PYX_ERR(0, 3283, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3283, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3283, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3283, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3283, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3284, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3284, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3285, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3285, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3286, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3286, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dbsric02_bufferSize", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3283, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_316dbsric02_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_316dbsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dbsric02_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_dbsric02_bufferSize(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3298
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int cbsric02_bufferSize(size_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                               size_t descrA, size_t bsrSortedVal,
 *                               size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_319cbsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_cbsric02_bufferSize(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cbsric02_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":3303
 *                               int blockDim, size_t info):
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCbsric02_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3304
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsric02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3305
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCbsric02_bufferSize(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <cuComplex*>bsrSortedVal,
 */
        __pyx_v_status = cusparseCbsric02_bufferSize(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsric02Info_t)__pyx_v_info), (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3304
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsric02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3310
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsric02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3311
 *             <bsric02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef int zbsric02_bufferSize(size_t handle, int dirA, int mb, int nnzb,
 */
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3298
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int cbsric02_bufferSize(size_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                               size_t descrA, size_t bsrSortedVal,
 *                               size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.cbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_319cbsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_318cbsric02_bufferSize[] = "cbsric02_bufferSize(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_319cbsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cbsric02_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_bufferSize", 1, 10, 10, 1); __PYX_ERR(0, 3298, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_bufferSize", 1, 10, 10, 2); __PYX_ERR(0, 3298, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_bufferSize", 1, 10, 10, 3); __PYX_ERR(0, 3298, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_bufferSize", 1, 10, 10, 4); __PYX_ERR(0, 3298, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_bufferSize", 1, 10, 10, 5); __PYX_ERR(0, 3298, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_bufferSize", 1, 10, 10, 6); __PYX_ERR(0, 3298, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_bufferSize", 1, 10, 10, 7); __PYX_ERR(0, 3298, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_bufferSize", 1, 10, 10, 8); __PYX_ERR(0, 3298, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_bufferSize", 1, 10, 10, 9); __PYX_ERR(0, 3298, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cbsric02_bufferSize") < 0)) __PYX_ERR(0, 3298, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3298, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3298, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3298, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3298, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3299, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3299, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3300, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3300, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3301, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3301, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cbsric02_bufferSize", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3298, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_318cbsric02_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_318cbsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cbsric02_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_cbsric02_bufferSize(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3313
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int zbsric02_bufferSize(size_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                               size_t descrA, size_t bsrSortedVal,
 *                               size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_321zbsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_zbsric02_bufferSize(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zbsric02_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":3318
 *                               int blockDim, size_t info):
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZbsric02_bufferSize(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3319
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsric02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3320
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZbsric02_bufferSize(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <cuDoubleComplex*>bsrSortedVal,
 */
        __pyx_v_status = cusparseZbsric02_bufferSize(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsric02Info_t)__pyx_v_info), (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3319
 *     cdef int pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsric02_bufferSize(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3325
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsric02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3326
 *             <bsric02Info_t>info, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <int>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef sbsric02_analysis(
 */
  __pyx_r = ((int)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3313
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef int zbsric02_bufferSize(size_t handle, int dirA, int mb, int nnzb,             # <<<<<<<<<<<<<<
 *                               size_t descrA, size_t bsrSortedVal,
 *                               size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.zbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_321zbsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_320zbsric02_bufferSize[] = "zbsric02_bufferSize(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_321zbsric02_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zbsric02_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_bufferSize", 1, 10, 10, 1); __PYX_ERR(0, 3313, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_bufferSize", 1, 10, 10, 2); __PYX_ERR(0, 3313, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_bufferSize", 1, 10, 10, 3); __PYX_ERR(0, 3313, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_bufferSize", 1, 10, 10, 4); __PYX_ERR(0, 3313, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_bufferSize", 1, 10, 10, 5); __PYX_ERR(0, 3313, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_bufferSize", 1, 10, 10, 6); __PYX_ERR(0, 3313, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_bufferSize", 1, 10, 10, 7); __PYX_ERR(0, 3313, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_bufferSize", 1, 10, 10, 8); __PYX_ERR(0, 3313, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_bufferSize", 1, 10, 10, 9); __PYX_ERR(0, 3313, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zbsric02_bufferSize") < 0)) __PYX_ERR(0, 3313, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3313, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3313, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3313, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3313, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3314, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3314, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3315, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3315, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3316, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3316, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zbsric02_bufferSize", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3313, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_320zbsric02_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_320zbsric02_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zbsric02_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_zbsric02_bufferSize(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsric02_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3328
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef sbsric02_analysis(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_323sbsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sbsric02_analysis(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pInputBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sbsric02_analysis", 0);

  /* "cupy/cuda/cusparse.pyx":3332
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 *         int blockDim, size_t info, int policy, size_t pInputBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSbsric02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3333
 *         int blockDim, size_t info, int policy, size_t pInputBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsric02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3334
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSbsric02_analysis(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <const float*>bsrSortedVal,
 */
        __pyx_v_status = cusparseSbsric02_analysis(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((float const *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsric02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pInputBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3333
 *         int blockDim, size_t info, int policy, size_t pInputBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsric02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3340
 *             <bsric02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pInputBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dbsric02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3328
 *     return <int>pBufferSizeInBytes
 * 
 * cpdef sbsric02_analysis(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_323sbsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_322sbsric02_analysis[] = "sbsric02_analysis(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info, int policy, size_t pInputBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_323sbsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pInputBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sbsric02_analysis (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pInputBuffer,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_analysis", 1, 12, 12, 1); __PYX_ERR(0, 3328, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_analysis", 1, 12, 12, 2); __PYX_ERR(0, 3328, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_analysis", 1, 12, 12, 3); __PYX_ERR(0, 3328, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_analysis", 1, 12, 12, 4); __PYX_ERR(0, 3328, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_analysis", 1, 12, 12, 5); __PYX_ERR(0, 3328, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_analysis", 1, 12, 12, 6); __PYX_ERR(0, 3328, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_analysis", 1, 12, 12, 7); __PYX_ERR(0, 3328, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_analysis", 1, 12, 12, 8); __PYX_ERR(0, 3328, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_analysis", 1, 12, 12, 9); __PYX_ERR(0, 3328, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_analysis", 1, 12, 12, 10); __PYX_ERR(0, 3328, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pInputBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02_analysis", 1, 12, 12, 11); __PYX_ERR(0, 3328, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sbsric02_analysis") < 0)) __PYX_ERR(0, 3328, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3329, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3329, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3329, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3329, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3329, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3330, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3330, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3330, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3331, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3331, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3331, __pyx_L3_error)
    __pyx_v_pInputBuffer = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_pInputBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3331, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sbsric02_analysis", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3328, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_322sbsric02_analysis(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pInputBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_322sbsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pInputBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sbsric02_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_sbsric02_analysis(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pInputBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3342
 *     check_status(status)
 * 
 * cpdef dbsric02_analysis(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_325dbsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dbsric02_analysis(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pInputBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dbsric02_analysis", 0);

  /* "cupy/cuda/cusparse.pyx":3346
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 *         int blockDim, size_t info, int policy, size_t pInputBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDbsric02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3347
 *         int blockDim, size_t info, int policy, size_t pInputBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsric02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3348
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDbsric02_analysis(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <const double*>bsrSortedVal,
 */
        __pyx_v_status = cusparseDbsric02_analysis(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((double const *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsric02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pInputBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3347
 *         int blockDim, size_t info, int policy, size_t pInputBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsric02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3354
 *             <bsric02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pInputBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cbsric02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3342
 *     check_status(status)
 * 
 * cpdef dbsric02_analysis(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_325dbsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_324dbsric02_analysis[] = "dbsric02_analysis(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info, int policy, size_t pInputBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_325dbsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pInputBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dbsric02_analysis (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pInputBuffer,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_analysis", 1, 12, 12, 1); __PYX_ERR(0, 3342, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_analysis", 1, 12, 12, 2); __PYX_ERR(0, 3342, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_analysis", 1, 12, 12, 3); __PYX_ERR(0, 3342, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_analysis", 1, 12, 12, 4); __PYX_ERR(0, 3342, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_analysis", 1, 12, 12, 5); __PYX_ERR(0, 3342, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_analysis", 1, 12, 12, 6); __PYX_ERR(0, 3342, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_analysis", 1, 12, 12, 7); __PYX_ERR(0, 3342, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_analysis", 1, 12, 12, 8); __PYX_ERR(0, 3342, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_analysis", 1, 12, 12, 9); __PYX_ERR(0, 3342, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_analysis", 1, 12, 12, 10); __PYX_ERR(0, 3342, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pInputBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02_analysis", 1, 12, 12, 11); __PYX_ERR(0, 3342, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dbsric02_analysis") < 0)) __PYX_ERR(0, 3342, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3343, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3343, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3343, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3343, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3343, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3344, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3344, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3344, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3345, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3345, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3345, __pyx_L3_error)
    __pyx_v_pInputBuffer = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_pInputBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3345, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dbsric02_analysis", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3342, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_324dbsric02_analysis(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pInputBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_324dbsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pInputBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dbsric02_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dbsric02_analysis(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pInputBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3356
 *     check_status(status)
 * 
 * cpdef cbsric02_analysis(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_327cbsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cbsric02_analysis(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pInputBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cbsric02_analysis", 0);

  /* "cupy/cuda/cusparse.pyx":3360
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 *         int blockDim, size_t info, int policy, size_t pInputBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCbsric02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3361
 *         int blockDim, size_t info, int policy, size_t pInputBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsric02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3362
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCbsric02_analysis(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <const cuComplex*>bsrSortedVal,
 */
        __pyx_v_status = cusparseCbsric02_analysis(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex const *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsric02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pInputBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3361
 *         int blockDim, size_t info, int policy, size_t pInputBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsric02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3368
 *             <bsric02Info_t>info, <cusparseSolvePolicy_t>policy,
 *             <void*>pInputBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zbsric02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3356
 *     check_status(status)
 * 
 * cpdef cbsric02_analysis(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_327cbsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_326cbsric02_analysis[] = "cbsric02_analysis(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info, int policy, size_t pInputBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_327cbsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pInputBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cbsric02_analysis (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pInputBuffer,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_analysis", 1, 12, 12, 1); __PYX_ERR(0, 3356, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_analysis", 1, 12, 12, 2); __PYX_ERR(0, 3356, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_analysis", 1, 12, 12, 3); __PYX_ERR(0, 3356, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_analysis", 1, 12, 12, 4); __PYX_ERR(0, 3356, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_analysis", 1, 12, 12, 5); __PYX_ERR(0, 3356, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_analysis", 1, 12, 12, 6); __PYX_ERR(0, 3356, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_analysis", 1, 12, 12, 7); __PYX_ERR(0, 3356, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_analysis", 1, 12, 12, 8); __PYX_ERR(0, 3356, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_analysis", 1, 12, 12, 9); __PYX_ERR(0, 3356, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_analysis", 1, 12, 12, 10); __PYX_ERR(0, 3356, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pInputBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02_analysis", 1, 12, 12, 11); __PYX_ERR(0, 3356, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cbsric02_analysis") < 0)) __PYX_ERR(0, 3356, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3357, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3357, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3357, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3357, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3357, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3358, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3358, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3358, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3359, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3359, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3359, __pyx_L3_error)
    __pyx_v_pInputBuffer = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_pInputBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3359, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cbsric02_analysis", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3356, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_326cbsric02_analysis(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pInputBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_326cbsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pInputBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cbsric02_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cbsric02_analysis(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pInputBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3370
 *     check_status(status)
 * 
 * cpdef zbsric02_analysis(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_329zbsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zbsric02_analysis(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pInputBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zbsric02_analysis", 0);

  /* "cupy/cuda/cusparse.pyx":3374
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 *         int blockDim, size_t info, int policy, size_t pInputBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZbsric02_analysis(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3375
 *         int blockDim, size_t info, int policy, size_t pInputBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsric02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3376
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZbsric02_analysis(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA,
 */
        __pyx_v_status = cusparseZbsric02_analysis(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex const *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsric02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pInputBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3375
 *         int blockDim, size_t info, int policy, size_t pInputBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsric02_analysis(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3382
 *             <const int*>bsrSortedColInd, blockDim, <bsric02Info_t>info,
 *             <cusparseSolvePolicy_t>policy, <void*>pInputBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef sbsric02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3370
 *     check_status(status)
 * 
 * cpdef zbsric02_analysis(             # <<<<<<<<<<<<<<
 *         size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 *         size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_329zbsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_328zbsric02_analysis[] = "zbsric02_analysis(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info, int policy, size_t pInputBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_329zbsric02_analysis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pInputBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zbsric02_analysis (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pInputBuffer,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_analysis", 1, 12, 12, 1); __PYX_ERR(0, 3370, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_analysis", 1, 12, 12, 2); __PYX_ERR(0, 3370, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_analysis", 1, 12, 12, 3); __PYX_ERR(0, 3370, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_analysis", 1, 12, 12, 4); __PYX_ERR(0, 3370, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_analysis", 1, 12, 12, 5); __PYX_ERR(0, 3370, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_analysis", 1, 12, 12, 6); __PYX_ERR(0, 3370, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_analysis", 1, 12, 12, 7); __PYX_ERR(0, 3370, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_analysis", 1, 12, 12, 8); __PYX_ERR(0, 3370, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_analysis", 1, 12, 12, 9); __PYX_ERR(0, 3370, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_analysis", 1, 12, 12, 10); __PYX_ERR(0, 3370, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pInputBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02_analysis", 1, 12, 12, 11); __PYX_ERR(0, 3370, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zbsric02_analysis") < 0)) __PYX_ERR(0, 3370, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3371, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3371, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3371, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3371, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3371, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3372, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3372, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3372, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3373, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3373, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3373, __pyx_L3_error)
    __pyx_v_pInputBuffer = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_pInputBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3373, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zbsric02_analysis", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3370, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_328zbsric02_analysis(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pInputBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_328zbsric02_analysis(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pInputBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zbsric02_analysis", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zbsric02_analysis(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pInputBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsric02_analysis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3384
 *     check_status(status)
 * 
 * cpdef sbsric02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,             # <<<<<<<<<<<<<<
 *                size_t bsrSortedVal, size_t bsrSortedRowPtr,
 *                size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_331sbsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sbsric02(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sbsric02", 0);

  /* "cupy/cuda/cusparse.pyx":3388
 *                size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSbsric02(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3389
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsric02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3390
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSbsric02(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <float*>bsrSortedVal,
 */
        __pyx_v_status = cusparseSbsric02(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((float *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsric02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3389
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSbsric02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3395
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsric02Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dbsric02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3384
 *     check_status(status)
 * 
 * cpdef sbsric02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,             # <<<<<<<<<<<<<<
 *                size_t bsrSortedVal, size_t bsrSortedRowPtr,
 *                size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_331sbsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_330sbsric02[] = "sbsric02(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_331sbsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sbsric02 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02", 1, 12, 12, 1); __PYX_ERR(0, 3384, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02", 1, 12, 12, 2); __PYX_ERR(0, 3384, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02", 1, 12, 12, 3); __PYX_ERR(0, 3384, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02", 1, 12, 12, 4); __PYX_ERR(0, 3384, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02", 1, 12, 12, 5); __PYX_ERR(0, 3384, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02", 1, 12, 12, 6); __PYX_ERR(0, 3384, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02", 1, 12, 12, 7); __PYX_ERR(0, 3384, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02", 1, 12, 12, 8); __PYX_ERR(0, 3384, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02", 1, 12, 12, 9); __PYX_ERR(0, 3384, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02", 1, 12, 12, 10); __PYX_ERR(0, 3384, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sbsric02", 1, 12, 12, 11); __PYX_ERR(0, 3384, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sbsric02") < 0)) __PYX_ERR(0, 3384, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3384, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3384, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3384, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3384, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3384, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3385, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3385, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3386, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3386, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3386, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3386, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3387, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sbsric02", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3384, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_330sbsric02(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_330sbsric02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sbsric02", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_sbsric02(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3397
 *     check_status(status)
 * 
 * cpdef dbsric02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,             # <<<<<<<<<<<<<<
 *                size_t bsrSortedVal, size_t bsrSortedRowPtr,
 *                size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_333dbsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dbsric02(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dbsric02", 0);

  /* "cupy/cuda/cusparse.pyx":3401
 *                size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDbsric02(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3402
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsric02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3403
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDbsric02(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <double*>bsrSortedVal,
 */
        __pyx_v_status = cusparseDbsric02(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((double *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsric02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3402
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDbsric02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3408
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsric02Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cbsric02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3397
 *     check_status(status)
 * 
 * cpdef dbsric02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,             # <<<<<<<<<<<<<<
 *                size_t bsrSortedVal, size_t bsrSortedRowPtr,
 *                size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_333dbsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_332dbsric02[] = "dbsric02(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_333dbsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dbsric02 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02", 1, 12, 12, 1); __PYX_ERR(0, 3397, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02", 1, 12, 12, 2); __PYX_ERR(0, 3397, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02", 1, 12, 12, 3); __PYX_ERR(0, 3397, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02", 1, 12, 12, 4); __PYX_ERR(0, 3397, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02", 1, 12, 12, 5); __PYX_ERR(0, 3397, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02", 1, 12, 12, 6); __PYX_ERR(0, 3397, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02", 1, 12, 12, 7); __PYX_ERR(0, 3397, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02", 1, 12, 12, 8); __PYX_ERR(0, 3397, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02", 1, 12, 12, 9); __PYX_ERR(0, 3397, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02", 1, 12, 12, 10); __PYX_ERR(0, 3397, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dbsric02", 1, 12, 12, 11); __PYX_ERR(0, 3397, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dbsric02") < 0)) __PYX_ERR(0, 3397, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3397, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3397, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3397, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3397, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3397, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3398, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3398, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3399, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3399, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3399, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3399, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3400, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dbsric02", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3397, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_332dbsric02(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_332dbsric02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dbsric02", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dbsric02(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3410
 *     check_status(status)
 * 
 * cpdef cbsric02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,             # <<<<<<<<<<<<<<
 *                size_t bsrSortedVal, size_t bsrSortedRowPtr,
 *                size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_335cbsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cbsric02(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cbsric02", 0);

  /* "cupy/cuda/cusparse.pyx":3414
 *                size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCbsric02(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3415
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsric02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3416
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCbsric02(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <cuComplex*>bsrSortedVal,
 */
        __pyx_v_status = cusparseCbsric02(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuComplex *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsric02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3415
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCbsric02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3421
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsric02Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zbsric02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3410
 *     check_status(status)
 * 
 * cpdef cbsric02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,             # <<<<<<<<<<<<<<
 *                size_t bsrSortedVal, size_t bsrSortedRowPtr,
 *                size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_335cbsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_334cbsric02[] = "cbsric02(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_335cbsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cbsric02 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02", 1, 12, 12, 1); __PYX_ERR(0, 3410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02", 1, 12, 12, 2); __PYX_ERR(0, 3410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02", 1, 12, 12, 3); __PYX_ERR(0, 3410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02", 1, 12, 12, 4); __PYX_ERR(0, 3410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02", 1, 12, 12, 5); __PYX_ERR(0, 3410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02", 1, 12, 12, 6); __PYX_ERR(0, 3410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02", 1, 12, 12, 7); __PYX_ERR(0, 3410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02", 1, 12, 12, 8); __PYX_ERR(0, 3410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02", 1, 12, 12, 9); __PYX_ERR(0, 3410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02", 1, 12, 12, 10); __PYX_ERR(0, 3410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cbsric02", 1, 12, 12, 11); __PYX_ERR(0, 3410, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cbsric02") < 0)) __PYX_ERR(0, 3410, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3410, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3410, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3410, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3410, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3410, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3411, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3411, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3412, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3412, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3412, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3412, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3413, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cbsric02", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3410, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_334cbsric02(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_334cbsric02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cbsric02", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cbsric02(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3423
 *     check_status(status)
 * 
 * cpdef zbsric02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,             # <<<<<<<<<<<<<<
 *                size_t bsrSortedVal, size_t bsrSortedRowPtr,
 *                size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_337zbsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zbsric02(size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zbsric02", 0);

  /* "cupy/cuda/cusparse.pyx":3427
 *                size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZbsric02(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3428
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsric02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3429
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZbsric02(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 *             <const cusparseMatDescr_t>descrA, <cuDoubleComplex*>bsrSortedVal,
 */
        __pyx_v_status = cusparseZbsric02(((cusparseHandle_t)__pyx_v_handle), ((cusparseDirection_t)__pyx_v_dirA), __pyx_v_mb, __pyx_v_nnzb, ((cusparseMatDescr_t const )__pyx_v_descrA), ((cuDoubleComplex *)__pyx_v_bsrSortedVal), ((int const *)__pyx_v_bsrSortedRowPtr), ((int const *)__pyx_v_bsrSortedColInd), __pyx_v_blockDim, ((bsric02Info_t)__pyx_v_info), ((cusparseSolvePolicy_t)__pyx_v_policy), ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3428
 *                size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZbsric02(
 *             <cusparseHandle_t>handle, <cusparseDirection_t>dirA, mb, nnzb,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3434
 *             <const int*>bsrSortedRowPtr, <const int*>bsrSortedColInd, blockDim,
 *             <bsric02Info_t>info, <cusparseSolvePolicy_t>policy, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef sgtsv2_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3423
 *     check_status(status)
 * 
 * cpdef zbsric02(size_t handle, int dirA, int mb, int nnzb, size_t descrA,             # <<<<<<<<<<<<<<
 *                size_t bsrSortedVal, size_t bsrSortedRowPtr,
 *                size_t bsrSortedColInd, int blockDim, size_t info, int policy,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_337zbsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_336zbsric02[] = "zbsric02(size_t handle, int dirA, int mb, int nnzb, size_t descrA, size_t bsrSortedVal, size_t bsrSortedRowPtr, size_t bsrSortedColInd, int blockDim, size_t info, int policy, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_337zbsric02(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_dirA;
  int __pyx_v_mb;
  int __pyx_v_nnzb;
  size_t __pyx_v_descrA;
  size_t __pyx_v_bsrSortedVal;
  size_t __pyx_v_bsrSortedRowPtr;
  size_t __pyx_v_bsrSortedColInd;
  int __pyx_v_blockDim;
  size_t __pyx_v_info;
  int __pyx_v_policy;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zbsric02 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_dirA,&__pyx_n_s_mb,&__pyx_n_s_nnzb,&__pyx_n_s_descrA,&__pyx_n_s_bsrSortedVal,&__pyx_n_s_bsrSortedRowPtr,&__pyx_n_s_bsrSortedColInd,&__pyx_n_s_blockDim,&__pyx_n_s_info,&__pyx_n_s_policy,&__pyx_n_s_pBuffer,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dirA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02", 1, 12, 12, 1); __PYX_ERR(0, 3423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02", 1, 12, 12, 2); __PYX_ERR(0, 3423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnzb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02", 1, 12, 12, 3); __PYX_ERR(0, 3423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_descrA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02", 1, 12, 12, 4); __PYX_ERR(0, 3423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02", 1, 12, 12, 5); __PYX_ERR(0, 3423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02", 1, 12, 12, 6); __PYX_ERR(0, 3423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsrSortedColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02", 1, 12, 12, 7); __PYX_ERR(0, 3423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockDim)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02", 1, 12, 12, 8); __PYX_ERR(0, 3423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02", 1, 12, 12, 9); __PYX_ERR(0, 3423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_policy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02", 1, 12, 12, 10); __PYX_ERR(0, 3423, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zbsric02", 1, 12, 12, 11); __PYX_ERR(0, 3423, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zbsric02") < 0)) __PYX_ERR(0, 3423, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3423, __pyx_L3_error)
    __pyx_v_dirA = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dirA == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3423, __pyx_L3_error)
    __pyx_v_mb = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3423, __pyx_L3_error)
    __pyx_v_nnzb = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnzb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3423, __pyx_L3_error)
    __pyx_v_descrA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_descrA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3423, __pyx_L3_error)
    __pyx_v_bsrSortedVal = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_bsrSortedVal == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3424, __pyx_L3_error)
    __pyx_v_bsrSortedRowPtr = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_bsrSortedRowPtr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3424, __pyx_L3_error)
    __pyx_v_bsrSortedColInd = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_bsrSortedColInd == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3425, __pyx_L3_error)
    __pyx_v_blockDim = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_blockDim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3425, __pyx_L3_error)
    __pyx_v_info = __Pyx_PyInt_As_size_t(values[9]); if (unlikely((__pyx_v_info == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3425, __pyx_L3_error)
    __pyx_v_policy = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_policy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3425, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[11]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3426, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zbsric02", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3423, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_336zbsric02(__pyx_self, __pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_336zbsric02(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_dirA, int __pyx_v_mb, int __pyx_v_nnzb, size_t __pyx_v_descrA, size_t __pyx_v_bsrSortedVal, size_t __pyx_v_bsrSortedRowPtr, size_t __pyx_v_bsrSortedColInd, int __pyx_v_blockDim, size_t __pyx_v_info, int __pyx_v_policy, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zbsric02", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zbsric02(__pyx_v_handle, __pyx_v_dirA, __pyx_v_mb, __pyx_v_nnzb, __pyx_v_descrA, __pyx_v_bsrSortedVal, __pyx_v_bsrSortedRowPtr, __pyx_v_bsrSortedColInd, __pyx_v_blockDim, __pyx_v_info, __pyx_v_policy, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zbsric02", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3436
 *     check_status(status)
 * 
 * cpdef sgtsv2_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d,             # <<<<<<<<<<<<<<
 *                            size_t du, size_t B, int ldb,
 *                            size_t bufferSizeInBytes):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_339sgtsv2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgtsv2_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgtsv2_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3439
 *                            size_t du, size_t B, int ldb,
 *                            size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgtsv2_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3440
 *                            size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3441
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSgtsv2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 *             <const float*>du, <const float*>B, ldb, <size_t*>bufferSizeInBytes)
 */
        __pyx_v_status = cusparseSgtsv2_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((float const *)__pyx_v_dl), ((float const *)__pyx_v_d), ((float const *)__pyx_v_du), ((float const *)__pyx_v_B), __pyx_v_ldb, ((size_t *)__pyx_v_bufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3440
 *                            size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3444
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 *             <const float*>du, <const float*>B, ldb, <size_t*>bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dgtsv2_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3436
 *     check_status(status)
 * 
 * cpdef sgtsv2_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d,             # <<<<<<<<<<<<<<
 *                            size_t du, size_t B, int ldb,
 *                            size_t bufferSizeInBytes):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_339sgtsv2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_338sgtsv2_bufferSizeExt[] = "sgtsv2_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t bufferSizeInBytes)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_339sgtsv2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_bufferSizeInBytes;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sgtsv2_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_bufferSizeInBytes,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_bufferSizeExt", 1, 9, 9, 1); __PYX_ERR(0, 3436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_bufferSizeExt", 1, 9, 9, 2); __PYX_ERR(0, 3436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_bufferSizeExt", 1, 9, 9, 3); __PYX_ERR(0, 3436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_bufferSizeExt", 1, 9, 9, 4); __PYX_ERR(0, 3436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_bufferSizeExt", 1, 9, 9, 5); __PYX_ERR(0, 3436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_bufferSizeExt", 1, 9, 9, 6); __PYX_ERR(0, 3436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_bufferSizeExt", 1, 9, 9, 7); __PYX_ERR(0, 3436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bufferSizeInBytes)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_bufferSizeExt", 1, 9, 9, 8); __PYX_ERR(0, 3436, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sgtsv2_bufferSizeExt") < 0)) __PYX_ERR(0, 3436, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3436, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3436, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3436, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3436, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3436, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3437, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3437, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3437, __pyx_L3_error)
    __pyx_v_bufferSizeInBytes = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_bufferSizeInBytes == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3438, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgtsv2_bufferSizeExt", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3436, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_338sgtsv2_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_bufferSizeInBytes);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_338sgtsv2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgtsv2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_sgtsv2_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_bufferSizeInBytes, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3446
 *     check_status(status)
 * 
 * cpdef dgtsv2_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d,             # <<<<<<<<<<<<<<
 *                            size_t du, size_t B, int ldb,
 *                            size_t bufferSizeInBytes):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_341dgtsv2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgtsv2_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgtsv2_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3449
 *                            size_t du, size_t B, int ldb,
 *                            size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgtsv2_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3450
 *                            size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const double*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3451
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDgtsv2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, n, <const double*>dl,
 *             <const double*>d, <const double*>du, <const double*>B, ldb,
 */
        __pyx_v_status = cusparseDgtsv2_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((double const *)__pyx_v_dl), ((double const *)__pyx_v_d), ((double const *)__pyx_v_du), ((double const *)__pyx_v_B), __pyx_v_ldb, ((size_t *)__pyx_v_bufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3450
 *                            size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const double*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3455
 *             <const double*>d, <const double*>du, <const double*>B, ldb,
 *             <size_t*>bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cgtsv2_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3446
 *     check_status(status)
 * 
 * cpdef dgtsv2_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d,             # <<<<<<<<<<<<<<
 *                            size_t du, size_t B, int ldb,
 *                            size_t bufferSizeInBytes):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_341dgtsv2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_340dgtsv2_bufferSizeExt[] = "dgtsv2_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t bufferSizeInBytes)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_341dgtsv2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_bufferSizeInBytes;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dgtsv2_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_bufferSizeInBytes,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_bufferSizeExt", 1, 9, 9, 1); __PYX_ERR(0, 3446, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_bufferSizeExt", 1, 9, 9, 2); __PYX_ERR(0, 3446, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_bufferSizeExt", 1, 9, 9, 3); __PYX_ERR(0, 3446, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_bufferSizeExt", 1, 9, 9, 4); __PYX_ERR(0, 3446, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_bufferSizeExt", 1, 9, 9, 5); __PYX_ERR(0, 3446, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_bufferSizeExt", 1, 9, 9, 6); __PYX_ERR(0, 3446, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_bufferSizeExt", 1, 9, 9, 7); __PYX_ERR(0, 3446, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bufferSizeInBytes)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_bufferSizeExt", 1, 9, 9, 8); __PYX_ERR(0, 3446, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dgtsv2_bufferSizeExt") < 0)) __PYX_ERR(0, 3446, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3446, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3446, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3446, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3446, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3446, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3447, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3447, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3447, __pyx_L3_error)
    __pyx_v_bufferSizeInBytes = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_bufferSizeInBytes == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3448, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgtsv2_bufferSizeExt", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3446, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_340dgtsv2_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_bufferSizeInBytes);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_340dgtsv2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgtsv2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dgtsv2_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_bufferSizeInBytes, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3457
 *     check_status(status)
 * 
 * cpdef cgtsv2_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d,             # <<<<<<<<<<<<<<
 *                            size_t du, size_t B, int ldb,
 *                            size_t bufferSizeInBytes):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_343cgtsv2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgtsv2_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgtsv2_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3460
 *                            size_t du, size_t B, int ldb,
 *                            size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgtsv2_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3461
 *                            size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const cuComplex*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3462
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCgtsv2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, n, <const cuComplex*>dl,
 *             <const cuComplex*>d, <const cuComplex*>du, <const cuComplex*>B,
 */
        __pyx_v_status = cusparseCgtsv2_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cuComplex const *)__pyx_v_dl), ((cuComplex const *)__pyx_v_d), ((cuComplex const *)__pyx_v_du), ((cuComplex const *)__pyx_v_B), __pyx_v_ldb, ((size_t *)__pyx_v_bufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3461
 *                            size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const cuComplex*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3466
 *             <const cuComplex*>d, <const cuComplex*>du, <const cuComplex*>B,
 *             ldb, <size_t*>bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zgtsv2_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3457
 *     check_status(status)
 * 
 * cpdef cgtsv2_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d,             # <<<<<<<<<<<<<<
 *                            size_t du, size_t B, int ldb,
 *                            size_t bufferSizeInBytes):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_343cgtsv2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_342cgtsv2_bufferSizeExt[] = "cgtsv2_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t bufferSizeInBytes)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_343cgtsv2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_bufferSizeInBytes;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cgtsv2_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_bufferSizeInBytes,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_bufferSizeExt", 1, 9, 9, 1); __PYX_ERR(0, 3457, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_bufferSizeExt", 1, 9, 9, 2); __PYX_ERR(0, 3457, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_bufferSizeExt", 1, 9, 9, 3); __PYX_ERR(0, 3457, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_bufferSizeExt", 1, 9, 9, 4); __PYX_ERR(0, 3457, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_bufferSizeExt", 1, 9, 9, 5); __PYX_ERR(0, 3457, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_bufferSizeExt", 1, 9, 9, 6); __PYX_ERR(0, 3457, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_bufferSizeExt", 1, 9, 9, 7); __PYX_ERR(0, 3457, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bufferSizeInBytes)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_bufferSizeExt", 1, 9, 9, 8); __PYX_ERR(0, 3457, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cgtsv2_bufferSizeExt") < 0)) __PYX_ERR(0, 3457, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3457, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3457, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3457, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3457, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3457, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3458, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3458, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3458, __pyx_L3_error)
    __pyx_v_bufferSizeInBytes = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_bufferSizeInBytes == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3459, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgtsv2_bufferSizeExt", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3457, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_342cgtsv2_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_bufferSizeInBytes);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_342cgtsv2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgtsv2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cgtsv2_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_bufferSizeInBytes, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3468
 *     check_status(status)
 * 
 * cpdef zgtsv2_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d,             # <<<<<<<<<<<<<<
 *                            size_t du, size_t B, int ldb,
 *                            size_t bufferSizeInBytes):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_345zgtsv2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgtsv2_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgtsv2_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3471
 *                            size_t du, size_t B, int ldb,
 *                            size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgtsv2_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3472
 *                            size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3473
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZgtsv2_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 */
        __pyx_v_status = cusparseZgtsv2_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cuDoubleComplex const *)__pyx_v_dl), ((cuDoubleComplex const *)__pyx_v_d), ((cuDoubleComplex const *)__pyx_v_du), ((cuDoubleComplex const *)__pyx_v_B), __pyx_v_ldb, ((size_t *)__pyx_v_bufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3472
 *                            size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3477
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 *             <const cuDoubleComplex*>B, ldb, <size_t*>bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef sgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3468
 *     check_status(status)
 * 
 * cpdef zgtsv2_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d,             # <<<<<<<<<<<<<<
 *                            size_t du, size_t B, int ldb,
 *                            size_t bufferSizeInBytes):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_345zgtsv2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_344zgtsv2_bufferSizeExt[] = "zgtsv2_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t bufferSizeInBytes)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_345zgtsv2_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_bufferSizeInBytes;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zgtsv2_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_bufferSizeInBytes,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_bufferSizeExt", 1, 9, 9, 1); __PYX_ERR(0, 3468, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_bufferSizeExt", 1, 9, 9, 2); __PYX_ERR(0, 3468, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_bufferSizeExt", 1, 9, 9, 3); __PYX_ERR(0, 3468, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_bufferSizeExt", 1, 9, 9, 4); __PYX_ERR(0, 3468, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_bufferSizeExt", 1, 9, 9, 5); __PYX_ERR(0, 3468, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_bufferSizeExt", 1, 9, 9, 6); __PYX_ERR(0, 3468, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_bufferSizeExt", 1, 9, 9, 7); __PYX_ERR(0, 3468, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bufferSizeInBytes)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_bufferSizeExt", 1, 9, 9, 8); __PYX_ERR(0, 3468, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zgtsv2_bufferSizeExt") < 0)) __PYX_ERR(0, 3468, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3468, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3468, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3468, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3468, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3468, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3469, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3469, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3469, __pyx_L3_error)
    __pyx_v_bufferSizeInBytes = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_bufferSizeInBytes == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3470, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgtsv2_bufferSizeExt", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3468, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_344zgtsv2_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_bufferSizeInBytes);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_344zgtsv2_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgtsv2_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zgtsv2_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_bufferSizeInBytes, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3479
 *     check_status(status)
 * 
 * cpdef sgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du,             # <<<<<<<<<<<<<<
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_347sgtsv2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgtsv2(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgtsv2", 0);

  /* "cupy/cuda/cusparse.pyx":3481
 * cpdef sgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du,
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgtsv2(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3482
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2(
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3483
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSgtsv2(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 *             <const float*>du, <float*>B, ldb, <void*>pBuffer)
 */
        __pyx_v_status = cusparseSgtsv2(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((float const *)__pyx_v_dl), ((float const *)__pyx_v_d), ((float const *)__pyx_v_du), ((float *)__pyx_v_B), __pyx_v_ldb, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3482
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2(
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3486
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 *             <const float*>du, <float*>B, ldb, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3479
 *     check_status(status)
 * 
 * cpdef sgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du,             # <<<<<<<<<<<<<<
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_347sgtsv2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_346sgtsv2[] = "sgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_347sgtsv2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sgtsv2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2", 1, 9, 9, 1); __PYX_ERR(0, 3479, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2", 1, 9, 9, 2); __PYX_ERR(0, 3479, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2", 1, 9, 9, 3); __PYX_ERR(0, 3479, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2", 1, 9, 9, 4); __PYX_ERR(0, 3479, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2", 1, 9, 9, 5); __PYX_ERR(0, 3479, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2", 1, 9, 9, 6); __PYX_ERR(0, 3479, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2", 1, 9, 9, 7); __PYX_ERR(0, 3479, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2", 1, 9, 9, 8); __PYX_ERR(0, 3479, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sgtsv2") < 0)) __PYX_ERR(0, 3479, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3479, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3479, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3479, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3479, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3479, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3479, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3480, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3480, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3480, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgtsv2", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3479, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_346sgtsv2(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_346sgtsv2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgtsv2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_sgtsv2(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3488
 *     check_status(status)
 * 
 * cpdef dgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du,             # <<<<<<<<<<<<<<
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_349dgtsv2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgtsv2(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgtsv2", 0);

  /* "cupy/cuda/cusparse.pyx":3490
 * cpdef dgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du,
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgtsv2(<cusparseHandle_t>handle, m, n,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3491
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2(<cusparseHandle_t>handle, m, n,
 *                                 <const double*>dl, <const double*>d,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3492
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDgtsv2(<cusparseHandle_t>handle, m, n,             # <<<<<<<<<<<<<<
 *                                 <const double*>dl, <const double*>d,
 *                                 <const double*>du, <double*>B, ldb,
 */
        __pyx_v_status = cusparseDgtsv2(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((double const *)__pyx_v_dl), ((double const *)__pyx_v_d), ((double const *)__pyx_v_du), ((double *)__pyx_v_B), __pyx_v_ldb, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3491
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2(<cusparseHandle_t>handle, m, n,
 *                                 <const double*>dl, <const double*>d,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3496
 *                                 <const double*>du, <double*>B, ldb,
 *                                 <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3488
 *     check_status(status)
 * 
 * cpdef dgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du,             # <<<<<<<<<<<<<<
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_349dgtsv2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_348dgtsv2[] = "dgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_349dgtsv2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dgtsv2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2", 1, 9, 9, 1); __PYX_ERR(0, 3488, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2", 1, 9, 9, 2); __PYX_ERR(0, 3488, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2", 1, 9, 9, 3); __PYX_ERR(0, 3488, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2", 1, 9, 9, 4); __PYX_ERR(0, 3488, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2", 1, 9, 9, 5); __PYX_ERR(0, 3488, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2", 1, 9, 9, 6); __PYX_ERR(0, 3488, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2", 1, 9, 9, 7); __PYX_ERR(0, 3488, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2", 1, 9, 9, 8); __PYX_ERR(0, 3488, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dgtsv2") < 0)) __PYX_ERR(0, 3488, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3488, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3488, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3488, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3488, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3488, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3488, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3489, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3489, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3489, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgtsv2", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3488, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_348dgtsv2(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_348dgtsv2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgtsv2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dgtsv2(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3498
 *     check_status(status)
 * 
 * cpdef cgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du,             # <<<<<<<<<<<<<<
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_351cgtsv2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgtsv2(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgtsv2", 0);

  /* "cupy/cuda/cusparse.pyx":3500
 * cpdef cgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du,
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgtsv2(<cusparseHandle_t>handle, m, n,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3501
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2(<cusparseHandle_t>handle, m, n,
 *                                 <const cuComplex*>dl, <const cuComplex*>d,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3502
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCgtsv2(<cusparseHandle_t>handle, m, n,             # <<<<<<<<<<<<<<
 *                                 <const cuComplex*>dl, <const cuComplex*>d,
 *                                 <const cuComplex*>du, <cuComplex*>B, ldb,
 */
        __pyx_v_status = cusparseCgtsv2(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cuComplex const *)__pyx_v_dl), ((cuComplex const *)__pyx_v_d), ((cuComplex const *)__pyx_v_du), ((cuComplex *)__pyx_v_B), __pyx_v_ldb, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3501
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2(<cusparseHandle_t>handle, m, n,
 *                                 <const cuComplex*>dl, <const cuComplex*>d,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3506
 *                                 <const cuComplex*>du, <cuComplex*>B, ldb,
 *                                 <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3498
 *     check_status(status)
 * 
 * cpdef cgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du,             # <<<<<<<<<<<<<<
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_351cgtsv2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_350cgtsv2[] = "cgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_351cgtsv2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cgtsv2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2", 1, 9, 9, 1); __PYX_ERR(0, 3498, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2", 1, 9, 9, 2); __PYX_ERR(0, 3498, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2", 1, 9, 9, 3); __PYX_ERR(0, 3498, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2", 1, 9, 9, 4); __PYX_ERR(0, 3498, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2", 1, 9, 9, 5); __PYX_ERR(0, 3498, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2", 1, 9, 9, 6); __PYX_ERR(0, 3498, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2", 1, 9, 9, 7); __PYX_ERR(0, 3498, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2", 1, 9, 9, 8); __PYX_ERR(0, 3498, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cgtsv2") < 0)) __PYX_ERR(0, 3498, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3498, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3498, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3498, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3498, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3498, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3498, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3499, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3499, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3499, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgtsv2", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3498, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_350cgtsv2(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_350cgtsv2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgtsv2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cgtsv2(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3508
 *     check_status(status)
 * 
 * cpdef zgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du,             # <<<<<<<<<<<<<<
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_353zgtsv2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgtsv2(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgtsv2", 0);

  /* "cupy/cuda/cusparse.pyx":3510
 * cpdef zgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du,
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgtsv2(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3511
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2(
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3512
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZgtsv2(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 */
        __pyx_v_status = cusparseZgtsv2(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cuDoubleComplex const *)__pyx_v_dl), ((cuDoubleComplex const *)__pyx_v_d), ((cuDoubleComplex const *)__pyx_v_du), ((cuDoubleComplex *)__pyx_v_B), __pyx_v_ldb, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3511
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2(
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3516
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 *             <cuDoubleComplex*>B, ldb, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef sgtsv2_nopivot_bufferSizeExt(size_t handle, int m, int n, size_t dl,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3508
 *     check_status(status)
 * 
 * cpdef zgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du,             # <<<<<<<<<<<<<<
 *              size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_353zgtsv2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_352zgtsv2[] = "zgtsv2(size_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_353zgtsv2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zgtsv2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2", 1, 9, 9, 1); __PYX_ERR(0, 3508, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2", 1, 9, 9, 2); __PYX_ERR(0, 3508, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2", 1, 9, 9, 3); __PYX_ERR(0, 3508, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2", 1, 9, 9, 4); __PYX_ERR(0, 3508, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2", 1, 9, 9, 5); __PYX_ERR(0, 3508, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2", 1, 9, 9, 6); __PYX_ERR(0, 3508, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2", 1, 9, 9, 7); __PYX_ERR(0, 3508, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2", 1, 9, 9, 8); __PYX_ERR(0, 3508, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zgtsv2") < 0)) __PYX_ERR(0, 3508, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3508, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3508, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3508, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3508, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3508, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3508, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3509, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3509, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3509, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgtsv2", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3508, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_352zgtsv2(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_352zgtsv2(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgtsv2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zgtsv2(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3518
 *     check_status(status)
 * 
 * cpdef sgtsv2_nopivot_bufferSizeExt(size_t handle, int m, int n, size_t dl,             # <<<<<<<<<<<<<<
 *                                    size_t d, size_t du, size_t B, int ldb,
 *                                    size_t bufferSizeInBytes):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_355sgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgtsv2_nopivot_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgtsv2_nopivot_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3521
 *                                    size_t d, size_t du, size_t B, int ldb,
 *                                    size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgtsv2_nopivot_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3522
 *                                    size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2_nopivot_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3523
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSgtsv2_nopivot_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 *             <const float*>du, <const float*>B, ldb, <size_t*>bufferSizeInBytes)
 */
        __pyx_v_status = cusparseSgtsv2_nopivot_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((float const *)__pyx_v_dl), ((float const *)__pyx_v_d), ((float const *)__pyx_v_du), ((float const *)__pyx_v_B), __pyx_v_ldb, ((size_t *)__pyx_v_bufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3522
 *                                    size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2_nopivot_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3526
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 *             <const float*>du, <const float*>B, ldb, <size_t*>bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dgtsv2_nopivot_bufferSizeExt(size_t handle, int m, int n, size_t dl,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3518
 *     check_status(status)
 * 
 * cpdef sgtsv2_nopivot_bufferSizeExt(size_t handle, int m, int n, size_t dl,             # <<<<<<<<<<<<<<
 *                                    size_t d, size_t du, size_t B, int ldb,
 *                                    size_t bufferSizeInBytes):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_355sgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_354sgtsv2_nopivot_bufferSizeExt[] = "sgtsv2_nopivot_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t bufferSizeInBytes)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_355sgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_bufferSizeInBytes;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sgtsv2_nopivot_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_bufferSizeInBytes,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 1); __PYX_ERR(0, 3518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 2); __PYX_ERR(0, 3518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 3); __PYX_ERR(0, 3518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 4); __PYX_ERR(0, 3518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 5); __PYX_ERR(0, 3518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 6); __PYX_ERR(0, 3518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 7); __PYX_ERR(0, 3518, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bufferSizeInBytes)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 8); __PYX_ERR(0, 3518, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sgtsv2_nopivot_bufferSizeExt") < 0)) __PYX_ERR(0, 3518, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3518, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3518, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3518, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3518, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3519, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3519, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3519, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3519, __pyx_L3_error)
    __pyx_v_bufferSizeInBytes = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_bufferSizeInBytes == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3520, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot_bufferSizeExt", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3518, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_354sgtsv2_nopivot_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_bufferSizeInBytes);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_354sgtsv2_nopivot_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgtsv2_nopivot_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_sgtsv2_nopivot_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_bufferSizeInBytes, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3528
 *     check_status(status)
 * 
 * cpdef dgtsv2_nopivot_bufferSizeExt(size_t handle, int m, int n, size_t dl,             # <<<<<<<<<<<<<<
 *                                    size_t d, size_t du, size_t B, int ldb,
 *                                    size_t bufferSizeInBytes):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_357dgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgtsv2_nopivot_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgtsv2_nopivot_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3531
 *                                    size_t d, size_t du, size_t B, int ldb,
 *                                    size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgtsv2_nopivot_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3532
 *                                    size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2_nopivot_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const double*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3533
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDgtsv2_nopivot_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, n, <const double*>dl,
 *             <const double*>d, <const double*>du, <const double*>B, ldb,
 */
        __pyx_v_status = cusparseDgtsv2_nopivot_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((double const *)__pyx_v_dl), ((double const *)__pyx_v_d), ((double const *)__pyx_v_du), ((double const *)__pyx_v_B), __pyx_v_ldb, ((size_t *)__pyx_v_bufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3532
 *                                    size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2_nopivot_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const double*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3537
 *             <const double*>d, <const double*>du, <const double*>B, ldb,
 *             <size_t*>bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cgtsv2_nopivot_bufferSizeExt(size_t handle, int m, int n, size_t dl,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3528
 *     check_status(status)
 * 
 * cpdef dgtsv2_nopivot_bufferSizeExt(size_t handle, int m, int n, size_t dl,             # <<<<<<<<<<<<<<
 *                                    size_t d, size_t du, size_t B, int ldb,
 *                                    size_t bufferSizeInBytes):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_357dgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_356dgtsv2_nopivot_bufferSizeExt[] = "dgtsv2_nopivot_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t bufferSizeInBytes)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_357dgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_bufferSizeInBytes;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dgtsv2_nopivot_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_bufferSizeInBytes,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 1); __PYX_ERR(0, 3528, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 2); __PYX_ERR(0, 3528, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 3); __PYX_ERR(0, 3528, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 4); __PYX_ERR(0, 3528, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 5); __PYX_ERR(0, 3528, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 6); __PYX_ERR(0, 3528, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 7); __PYX_ERR(0, 3528, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bufferSizeInBytes)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 8); __PYX_ERR(0, 3528, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dgtsv2_nopivot_bufferSizeExt") < 0)) __PYX_ERR(0, 3528, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3528, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3528, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3528, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3528, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3529, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3529, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3529, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3529, __pyx_L3_error)
    __pyx_v_bufferSizeInBytes = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_bufferSizeInBytes == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3530, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot_bufferSizeExt", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3528, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_356dgtsv2_nopivot_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_bufferSizeInBytes);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_356dgtsv2_nopivot_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgtsv2_nopivot_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dgtsv2_nopivot_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_bufferSizeInBytes, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3539
 *     check_status(status)
 * 
 * cpdef cgtsv2_nopivot_bufferSizeExt(size_t handle, int m, int n, size_t dl,             # <<<<<<<<<<<<<<
 *                                    size_t d, size_t du, size_t B, int ldb,
 *                                    size_t bufferSizeInBytes):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_359cgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgtsv2_nopivot_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgtsv2_nopivot_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3542
 *                                    size_t d, size_t du, size_t B, int ldb,
 *                                    size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgtsv2_nopivot_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3543
 *                                    size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2_nopivot_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const cuComplex*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3544
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCgtsv2_nopivot_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, n, <const cuComplex*>dl,
 *             <const cuComplex*>d, <const cuComplex*>du, <const cuComplex*>B,
 */
        __pyx_v_status = cusparseCgtsv2_nopivot_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cuComplex const *)__pyx_v_dl), ((cuComplex const *)__pyx_v_d), ((cuComplex const *)__pyx_v_du), ((cuComplex const *)__pyx_v_B), __pyx_v_ldb, ((size_t *)__pyx_v_bufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3543
 *                                    size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2_nopivot_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const cuComplex*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3548
 *             <const cuComplex*>d, <const cuComplex*>du, <const cuComplex*>B,
 *             ldb, <size_t*>bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zgtsv2_nopivot_bufferSizeExt(size_t handle, int m, int n, size_t dl,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3539
 *     check_status(status)
 * 
 * cpdef cgtsv2_nopivot_bufferSizeExt(size_t handle, int m, int n, size_t dl,             # <<<<<<<<<<<<<<
 *                                    size_t d, size_t du, size_t B, int ldb,
 *                                    size_t bufferSizeInBytes):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_359cgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_358cgtsv2_nopivot_bufferSizeExt[] = "cgtsv2_nopivot_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t bufferSizeInBytes)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_359cgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_bufferSizeInBytes;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cgtsv2_nopivot_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_bufferSizeInBytes,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 1); __PYX_ERR(0, 3539, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 2); __PYX_ERR(0, 3539, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 3); __PYX_ERR(0, 3539, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 4); __PYX_ERR(0, 3539, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 5); __PYX_ERR(0, 3539, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 6); __PYX_ERR(0, 3539, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 7); __PYX_ERR(0, 3539, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bufferSizeInBytes)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 8); __PYX_ERR(0, 3539, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cgtsv2_nopivot_bufferSizeExt") < 0)) __PYX_ERR(0, 3539, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3539, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3539, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3539, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3539, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3540, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3540, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3540, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3540, __pyx_L3_error)
    __pyx_v_bufferSizeInBytes = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_bufferSizeInBytes == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3541, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot_bufferSizeExt", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3539, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_358cgtsv2_nopivot_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_bufferSizeInBytes);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_358cgtsv2_nopivot_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgtsv2_nopivot_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cgtsv2_nopivot_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_bufferSizeInBytes, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3550
 *     check_status(status)
 * 
 * cpdef zgtsv2_nopivot_bufferSizeExt(size_t handle, int m, int n, size_t dl,             # <<<<<<<<<<<<<<
 *                                    size_t d, size_t du, size_t B, int ldb,
 *                                    size_t bufferSizeInBytes):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_361zgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgtsv2_nopivot_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgtsv2_nopivot_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3553
 *                                    size_t d, size_t du, size_t B, int ldb,
 *                                    size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgtsv2_nopivot_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3554
 *                                    size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2_nopivot_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3555
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZgtsv2_nopivot_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 */
        __pyx_v_status = cusparseZgtsv2_nopivot_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cuDoubleComplex const *)__pyx_v_dl), ((cuDoubleComplex const *)__pyx_v_d), ((cuDoubleComplex const *)__pyx_v_du), ((cuDoubleComplex const *)__pyx_v_B), __pyx_v_ldb, ((size_t *)__pyx_v_bufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3554
 *                                    size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2_nopivot_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3559
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 *             <const cuDoubleComplex*>B, ldb, <size_t*>bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef sgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3550
 *     check_status(status)
 * 
 * cpdef zgtsv2_nopivot_bufferSizeExt(size_t handle, int m, int n, size_t dl,             # <<<<<<<<<<<<<<
 *                                    size_t d, size_t du, size_t B, int ldb,
 *                                    size_t bufferSizeInBytes):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_361zgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_360zgtsv2_nopivot_bufferSizeExt[] = "zgtsv2_nopivot_bufferSizeExt(size_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t bufferSizeInBytes)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_361zgtsv2_nopivot_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_bufferSizeInBytes;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zgtsv2_nopivot_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_bufferSizeInBytes,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 1); __PYX_ERR(0, 3550, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 2); __PYX_ERR(0, 3550, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 3); __PYX_ERR(0, 3550, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 4); __PYX_ERR(0, 3550, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 5); __PYX_ERR(0, 3550, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 6); __PYX_ERR(0, 3550, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 7); __PYX_ERR(0, 3550, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bufferSizeInBytes)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot_bufferSizeExt", 1, 9, 9, 8); __PYX_ERR(0, 3550, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zgtsv2_nopivot_bufferSizeExt") < 0)) __PYX_ERR(0, 3550, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3550, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3550, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3550, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3550, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3551, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3551, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3551, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3551, __pyx_L3_error)
    __pyx_v_bufferSizeInBytes = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_bufferSizeInBytes == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3552, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot_bufferSizeExt", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3550, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_360zgtsv2_nopivot_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_bufferSizeInBytes);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_360zgtsv2_nopivot_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_bufferSizeInBytes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgtsv2_nopivot_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zgtsv2_nopivot_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_bufferSizeInBytes, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2_nopivot_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3561
 *     check_status(status)
 * 
 * cpdef sgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d,             # <<<<<<<<<<<<<<
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_363sgtsv2_nopivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgtsv2_nopivot(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgtsv2_nopivot", 0);

  /* "cupy/cuda/cusparse.pyx":3563
 * cpdef sgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d,
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgtsv2_nopivot(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3564
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2_nopivot(
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3565
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSgtsv2_nopivot(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 *             <const float*>du, <float*>B, ldb, <void*>pBuffer)
 */
        __pyx_v_status = cusparseSgtsv2_nopivot(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((float const *)__pyx_v_dl), ((float const *)__pyx_v_d), ((float const *)__pyx_v_du), ((float *)__pyx_v_B), __pyx_v_ldb, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3564
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2_nopivot(
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3568
 *             <cusparseHandle_t>handle, m, n, <const float*>dl, <const float*>d,
 *             <const float*>du, <float*>B, ldb, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3561
 *     check_status(status)
 * 
 * cpdef sgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d,             # <<<<<<<<<<<<<<
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_363sgtsv2_nopivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_362sgtsv2_nopivot[] = "sgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_363sgtsv2_nopivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sgtsv2_nopivot (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot", 1, 9, 9, 1); __PYX_ERR(0, 3561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot", 1, 9, 9, 2); __PYX_ERR(0, 3561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot", 1, 9, 9, 3); __PYX_ERR(0, 3561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot", 1, 9, 9, 4); __PYX_ERR(0, 3561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot", 1, 9, 9, 5); __PYX_ERR(0, 3561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot", 1, 9, 9, 6); __PYX_ERR(0, 3561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot", 1, 9, 9, 7); __PYX_ERR(0, 3561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot", 1, 9, 9, 8); __PYX_ERR(0, 3561, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sgtsv2_nopivot") < 0)) __PYX_ERR(0, 3561, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3561, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3561, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3561, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3561, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3561, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3562, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3562, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3562, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3562, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgtsv2_nopivot", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3561, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_362sgtsv2_nopivot(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_362sgtsv2_nopivot(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgtsv2_nopivot", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_sgtsv2_nopivot(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3570
 *     check_status(status)
 * 
 * cpdef dgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d,             # <<<<<<<<<<<<<<
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_365dgtsv2_nopivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgtsv2_nopivot(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgtsv2_nopivot", 0);

  /* "cupy/cuda/cusparse.pyx":3572
 * cpdef dgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d,
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgtsv2_nopivot(<cusparseHandle_t>handle, m, n,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3573
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2_nopivot(<cusparseHandle_t>handle, m, n,
 *                                         <const double*>dl, <const double*>d,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3574
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDgtsv2_nopivot(<cusparseHandle_t>handle, m, n,             # <<<<<<<<<<<<<<
 *                                         <const double*>dl, <const double*>d,
 *                                         <const double*>du, <double*>B, ldb,
 */
        __pyx_v_status = cusparseDgtsv2_nopivot(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((double const *)__pyx_v_dl), ((double const *)__pyx_v_d), ((double const *)__pyx_v_du), ((double *)__pyx_v_B), __pyx_v_ldb, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3573
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2_nopivot(<cusparseHandle_t>handle, m, n,
 *                                         <const double*>dl, <const double*>d,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3578
 *                                         <const double*>du, <double*>B, ldb,
 *                                         <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3570
 *     check_status(status)
 * 
 * cpdef dgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d,             # <<<<<<<<<<<<<<
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_365dgtsv2_nopivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_364dgtsv2_nopivot[] = "dgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_365dgtsv2_nopivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dgtsv2_nopivot (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot", 1, 9, 9, 1); __PYX_ERR(0, 3570, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot", 1, 9, 9, 2); __PYX_ERR(0, 3570, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot", 1, 9, 9, 3); __PYX_ERR(0, 3570, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot", 1, 9, 9, 4); __PYX_ERR(0, 3570, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot", 1, 9, 9, 5); __PYX_ERR(0, 3570, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot", 1, 9, 9, 6); __PYX_ERR(0, 3570, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot", 1, 9, 9, 7); __PYX_ERR(0, 3570, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot", 1, 9, 9, 8); __PYX_ERR(0, 3570, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dgtsv2_nopivot") < 0)) __PYX_ERR(0, 3570, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3570, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3570, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3570, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3570, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3570, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3571, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3571, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3571, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3571, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgtsv2_nopivot", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3570, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_364dgtsv2_nopivot(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_364dgtsv2_nopivot(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgtsv2_nopivot", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dgtsv2_nopivot(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3580
 *     check_status(status)
 * 
 * cpdef cgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d,             # <<<<<<<<<<<<<<
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_367cgtsv2_nopivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgtsv2_nopivot(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgtsv2_nopivot", 0);

  /* "cupy/cuda/cusparse.pyx":3582
 * cpdef cgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d,
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgtsv2_nopivot(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3583
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2_nopivot(
 *             <cusparseHandle_t>handle, m, n, <const cuComplex*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3584
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCgtsv2_nopivot(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, n, <const cuComplex*>dl,
 *             <const cuComplex*>d, <const cuComplex*>du, <cuComplex*>B, ldb,
 */
        __pyx_v_status = cusparseCgtsv2_nopivot(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cuComplex const *)__pyx_v_dl), ((cuComplex const *)__pyx_v_d), ((cuComplex const *)__pyx_v_du), ((cuComplex *)__pyx_v_B), __pyx_v_ldb, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3583
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2_nopivot(
 *             <cusparseHandle_t>handle, m, n, <const cuComplex*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3588
 *             <const cuComplex*>d, <const cuComplex*>du, <cuComplex*>B, ldb,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3580
 *     check_status(status)
 * 
 * cpdef cgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d,             # <<<<<<<<<<<<<<
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_367cgtsv2_nopivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_366cgtsv2_nopivot[] = "cgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_367cgtsv2_nopivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cgtsv2_nopivot (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot", 1, 9, 9, 1); __PYX_ERR(0, 3580, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot", 1, 9, 9, 2); __PYX_ERR(0, 3580, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot", 1, 9, 9, 3); __PYX_ERR(0, 3580, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot", 1, 9, 9, 4); __PYX_ERR(0, 3580, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot", 1, 9, 9, 5); __PYX_ERR(0, 3580, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot", 1, 9, 9, 6); __PYX_ERR(0, 3580, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot", 1, 9, 9, 7); __PYX_ERR(0, 3580, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot", 1, 9, 9, 8); __PYX_ERR(0, 3580, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cgtsv2_nopivot") < 0)) __PYX_ERR(0, 3580, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3580, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3580, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3580, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3580, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3580, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3581, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3581, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3581, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3581, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgtsv2_nopivot", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3580, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_366cgtsv2_nopivot(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_366cgtsv2_nopivot(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgtsv2_nopivot", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cgtsv2_nopivot(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3590
 *     check_status(status)
 * 
 * cpdef zgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d,             # <<<<<<<<<<<<<<
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_369zgtsv2_nopivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgtsv2_nopivot(size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgtsv2_nopivot", 0);

  /* "cupy/cuda/cusparse.pyx":3592
 * cpdef zgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d,
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgtsv2_nopivot(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3593
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2_nopivot(
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3594
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZgtsv2_nopivot(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 */
        __pyx_v_status = cusparseZgtsv2_nopivot(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, ((cuDoubleComplex const *)__pyx_v_dl), ((cuDoubleComplex const *)__pyx_v_d), ((cuDoubleComplex const *)__pyx_v_du), ((cuDoubleComplex *)__pyx_v_B), __pyx_v_ldb, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3593
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2_nopivot(
 *             <cusparseHandle_t>handle, m, n, <const cuDoubleComplex*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3598
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 *             <cuDoubleComplex*>B, ldb, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef sgtsv2StridedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3590
 *     check_status(status)
 * 
 * cpdef zgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d,             # <<<<<<<<<<<<<<
 *                      size_t du, size_t B, int ldb, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_369zgtsv2_nopivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_368zgtsv2_nopivot[] = "zgtsv2_nopivot(size_t handle, int m, int n, size_t dl, size_t d, size_t du, size_t B, int ldb, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_369zgtsv2_nopivot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_B;
  int __pyx_v_ldb;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zgtsv2_nopivot (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_B,&__pyx_n_s_ldb,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot", 1, 9, 9, 1); __PYX_ERR(0, 3590, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot", 1, 9, 9, 2); __PYX_ERR(0, 3590, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot", 1, 9, 9, 3); __PYX_ERR(0, 3590, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot", 1, 9, 9, 4); __PYX_ERR(0, 3590, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot", 1, 9, 9, 5); __PYX_ERR(0, 3590, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot", 1, 9, 9, 6); __PYX_ERR(0, 3590, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot", 1, 9, 9, 7); __PYX_ERR(0, 3590, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot", 1, 9, 9, 8); __PYX_ERR(0, 3590, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zgtsv2_nopivot") < 0)) __PYX_ERR(0, 3590, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3590, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3590, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3590, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3590, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3590, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3591, __pyx_L3_error)
    __pyx_v_B = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_B == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3591, __pyx_L3_error)
    __pyx_v_ldb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_ldb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3591, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3591, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgtsv2_nopivot", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3590, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_368zgtsv2_nopivot(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_368zgtsv2_nopivot(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_B, int __pyx_v_ldb, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgtsv2_nopivot", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zgtsv2_nopivot(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_B, __pyx_v_ldb, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2_nopivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3600
 *     check_status(status)
 * 
 * cpdef sgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_371sgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgtsv2StridedBatch_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_bufferSizeInBytes, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgtsv2StridedBatch_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3603
 *         size_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgtsv2StridedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3604
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2StridedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, <const float*>dl, <const float*>d,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3605
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, <const float*>dl, <const float*>d,
 *             <const float*>du, <const float*>x, batchCount, batchStride,
 */
        __pyx_v_status = cusparseSgtsv2StridedBatch_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, ((float const *)__pyx_v_dl), ((float const *)__pyx_v_d), ((float const *)__pyx_v_du), ((float const *)__pyx_v_x), __pyx_v_batchCount, __pyx_v_batchStride, ((size_t *)__pyx_v_bufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3604
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2StridedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, <const float*>dl, <const float*>d,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3609
 *             <const float*>du, <const float*>x, batchCount, batchStride,
 *             <size_t*>bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dgtsv2StridedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3600
 *     check_status(status)
 * 
 * cpdef sgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_371sgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_370sgtsv2StridedBatch_bufferSizeExt[] = "sgtsv2StridedBatch_bufferSizeExt(size_t handle, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, int batchStride, size_t bufferSizeInBytes)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_371sgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  int __pyx_v_batchStride;
  size_t __pyx_v_bufferSizeInBytes;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sgtsv2StridedBatch_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_x,&__pyx_n_s_batchCount,&__pyx_n_s_batchStride,&__pyx_n_s_bufferSizeInBytes,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 1); __PYX_ERR(0, 3600, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 2); __PYX_ERR(0, 3600, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 3); __PYX_ERR(0, 3600, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 4); __PYX_ERR(0, 3600, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 5); __PYX_ERR(0, 3600, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 6); __PYX_ERR(0, 3600, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchStride)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 7); __PYX_ERR(0, 3600, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bufferSizeInBytes)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 8); __PYX_ERR(0, 3600, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sgtsv2StridedBatch_bufferSizeExt") < 0)) __PYX_ERR(0, 3600, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3601, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3601, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3601, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3601, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3601, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3601, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3602, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_batchStride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3602, __pyx_L3_error)
    __pyx_v_bufferSizeInBytes = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_bufferSizeInBytes == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3602, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3600, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_370sgtsv2StridedBatch_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_batchStride, __pyx_v_bufferSizeInBytes);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_370sgtsv2StridedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_bufferSizeInBytes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgtsv2StridedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_sgtsv2StridedBatch_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_batchStride, __pyx_v_bufferSizeInBytes, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3611
 *     check_status(status)
 * 
 * cpdef dgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_373dgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgtsv2StridedBatch_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_bufferSizeInBytes, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgtsv2StridedBatch_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3614
 *         size_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgtsv2StridedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3615
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2StridedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, <const double*>dl, <const double*>d,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3616
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, <const double*>dl, <const double*>d,
 *             <const double*>du, <const double*>x, batchCount, batchStride,
 */
        __pyx_v_status = cusparseDgtsv2StridedBatch_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, ((double const *)__pyx_v_dl), ((double const *)__pyx_v_d), ((double const *)__pyx_v_du), ((double const *)__pyx_v_x), __pyx_v_batchCount, __pyx_v_batchStride, ((size_t *)__pyx_v_bufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3615
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2StridedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, <const double*>dl, <const double*>d,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3620
 *             <const double*>du, <const double*>x, batchCount, batchStride,
 *             <size_t*>bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cgtsv2StridedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3611
 *     check_status(status)
 * 
 * cpdef dgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_373dgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_372dgtsv2StridedBatch_bufferSizeExt[] = "dgtsv2StridedBatch_bufferSizeExt(size_t handle, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, int batchStride, size_t bufferSizeInBytes)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_373dgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  int __pyx_v_batchStride;
  size_t __pyx_v_bufferSizeInBytes;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dgtsv2StridedBatch_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_x,&__pyx_n_s_batchCount,&__pyx_n_s_batchStride,&__pyx_n_s_bufferSizeInBytes,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 1); __PYX_ERR(0, 3611, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 2); __PYX_ERR(0, 3611, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 3); __PYX_ERR(0, 3611, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 4); __PYX_ERR(0, 3611, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 5); __PYX_ERR(0, 3611, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 6); __PYX_ERR(0, 3611, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchStride)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 7); __PYX_ERR(0, 3611, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bufferSizeInBytes)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 8); __PYX_ERR(0, 3611, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dgtsv2StridedBatch_bufferSizeExt") < 0)) __PYX_ERR(0, 3611, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3612, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3612, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3612, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3612, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3612, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3612, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3613, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_batchStride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3613, __pyx_L3_error)
    __pyx_v_bufferSizeInBytes = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_bufferSizeInBytes == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3613, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3611, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_372dgtsv2StridedBatch_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_batchStride, __pyx_v_bufferSizeInBytes);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_372dgtsv2StridedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_bufferSizeInBytes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgtsv2StridedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dgtsv2StridedBatch_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_batchStride, __pyx_v_bufferSizeInBytes, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3622
 *     check_status(status)
 * 
 * cpdef cgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_375cgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgtsv2StridedBatch_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_bufferSizeInBytes, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgtsv2StridedBatch_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3625
 *         size_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgtsv2StridedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3626
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2StridedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, <const cuComplex*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3627
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, <const cuComplex*>dl,
 *             <const cuComplex*>d, <const cuComplex*>du, <const cuComplex*>x,
 */
        __pyx_v_status = cusparseCgtsv2StridedBatch_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, ((cuComplex const *)__pyx_v_dl), ((cuComplex const *)__pyx_v_d), ((cuComplex const *)__pyx_v_du), ((cuComplex const *)__pyx_v_x), __pyx_v_batchCount, __pyx_v_batchStride, ((size_t *)__pyx_v_bufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3626
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2StridedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, <const cuComplex*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3631
 *             <const cuComplex*>d, <const cuComplex*>du, <const cuComplex*>x,
 *             batchCount, batchStride, <size_t*>bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zgtsv2StridedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3622
 *     check_status(status)
 * 
 * cpdef cgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_375cgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_374cgtsv2StridedBatch_bufferSizeExt[] = "cgtsv2StridedBatch_bufferSizeExt(size_t handle, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, int batchStride, size_t bufferSizeInBytes)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_375cgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  int __pyx_v_batchStride;
  size_t __pyx_v_bufferSizeInBytes;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cgtsv2StridedBatch_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_x,&__pyx_n_s_batchCount,&__pyx_n_s_batchStride,&__pyx_n_s_bufferSizeInBytes,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 1); __PYX_ERR(0, 3622, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 2); __PYX_ERR(0, 3622, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 3); __PYX_ERR(0, 3622, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 4); __PYX_ERR(0, 3622, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 5); __PYX_ERR(0, 3622, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 6); __PYX_ERR(0, 3622, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchStride)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 7); __PYX_ERR(0, 3622, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bufferSizeInBytes)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 8); __PYX_ERR(0, 3622, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cgtsv2StridedBatch_bufferSizeExt") < 0)) __PYX_ERR(0, 3622, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3623, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3623, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3623, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3623, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3623, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3623, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3624, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_batchStride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3624, __pyx_L3_error)
    __pyx_v_bufferSizeInBytes = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_bufferSizeInBytes == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3624, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3622, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_374cgtsv2StridedBatch_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_batchStride, __pyx_v_bufferSizeInBytes);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_374cgtsv2StridedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_bufferSizeInBytes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgtsv2StridedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cgtsv2StridedBatch_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_batchStride, __pyx_v_bufferSizeInBytes, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3633
 *     check_status(status)
 * 
 * cpdef zgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_377zgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgtsv2StridedBatch_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_bufferSizeInBytes, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgtsv2StridedBatch_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3636
 *         size_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgtsv2StridedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3637
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2StridedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, <const cuDoubleComplex*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3638
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, <const cuDoubleComplex*>dl,
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 */
        __pyx_v_status = cusparseZgtsv2StridedBatch_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, ((cuDoubleComplex const *)__pyx_v_dl), ((cuDoubleComplex const *)__pyx_v_d), ((cuDoubleComplex const *)__pyx_v_du), ((cuDoubleComplex const *)__pyx_v_x), __pyx_v_batchCount, __pyx_v_batchStride, ((size_t *)__pyx_v_bufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3637
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2StridedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, m, <const cuDoubleComplex*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3643
 *             <const cuDoubleComplex*>x, batchCount, batchStride,
 *             <size_t*>bufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef sgtsv2StridedBatch(size_t handle, int m, size_t dl, size_t d, size_t du,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3633
 *     check_status(status)
 * 
 * cpdef zgtsv2StridedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int m, size_t dl, size_t d, size_t du, size_t x,
 *         int batchCount, int batchStride, size_t bufferSizeInBytes):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_377zgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_376zgtsv2StridedBatch_bufferSizeExt[] = "zgtsv2StridedBatch_bufferSizeExt(size_t handle, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, int batchStride, size_t bufferSizeInBytes)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_377zgtsv2StridedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  int __pyx_v_batchStride;
  size_t __pyx_v_bufferSizeInBytes;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zgtsv2StridedBatch_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_x,&__pyx_n_s_batchCount,&__pyx_n_s_batchStride,&__pyx_n_s_bufferSizeInBytes,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 1); __PYX_ERR(0, 3633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 2); __PYX_ERR(0, 3633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 3); __PYX_ERR(0, 3633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 4); __PYX_ERR(0, 3633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 5); __PYX_ERR(0, 3633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 6); __PYX_ERR(0, 3633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchStride)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 7); __PYX_ERR(0, 3633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bufferSizeInBytes)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, 8); __PYX_ERR(0, 3633, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zgtsv2StridedBatch_bufferSizeExt") < 0)) __PYX_ERR(0, 3633, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3634, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3634, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3634, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3634, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3634, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3634, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3635, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_batchStride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3635, __pyx_L3_error)
    __pyx_v_bufferSizeInBytes = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_bufferSizeInBytes == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3635, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch_bufferSizeExt", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3633, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_376zgtsv2StridedBatch_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_batchStride, __pyx_v_bufferSizeInBytes);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_376zgtsv2StridedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_bufferSizeInBytes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgtsv2StridedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zgtsv2StridedBatch_bufferSizeExt(__pyx_v_handle, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_batchStride, __pyx_v_bufferSizeInBytes, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2StridedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3645
 *     check_status(status)
 * 
 * cpdef sgtsv2StridedBatch(size_t handle, int m, size_t dl, size_t d, size_t du,             # <<<<<<<<<<<<<<
 *                          size_t x, int batchCount, int batchStride,
 *                          size_t pBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_379sgtsv2StridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgtsv2StridedBatch(size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgtsv2StridedBatch", 0);

  /* "cupy/cuda/cusparse.pyx":3648
 *                          size_t x, int batchCount, int batchStride,
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgtsv2StridedBatch(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3649
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2StridedBatch(
 *             <cusparseHandle_t>handle, m, <const float*>dl, <const float*>d,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3650
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSgtsv2StridedBatch(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, <const float*>dl, <const float*>d,
 *             <const float*>du, <float*>x, batchCount, batchStride,
 */
        __pyx_v_status = cusparseSgtsv2StridedBatch(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, ((float const *)__pyx_v_dl), ((float const *)__pyx_v_d), ((float const *)__pyx_v_du), ((float *)__pyx_v_x), __pyx_v_batchCount, __pyx_v_batchStride, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3649
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsv2StridedBatch(
 *             <cusparseHandle_t>handle, m, <const float*>dl, <const float*>d,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3654
 *             <const float*>du, <float*>x, batchCount, batchStride,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dgtsv2StridedBatch(size_t handle, int m, size_t dl, size_t d, size_t du,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3645
 *     check_status(status)
 * 
 * cpdef sgtsv2StridedBatch(size_t handle, int m, size_t dl, size_t d, size_t du,             # <<<<<<<<<<<<<<
 *                          size_t x, int batchCount, int batchStride,
 *                          size_t pBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_379sgtsv2StridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_378sgtsv2StridedBatch[] = "sgtsv2StridedBatch(size_t handle, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, int batchStride, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_379sgtsv2StridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  int __pyx_v_batchStride;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sgtsv2StridedBatch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_x,&__pyx_n_s_batchCount,&__pyx_n_s_batchStride,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch", 1, 9, 9, 1); __PYX_ERR(0, 3645, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch", 1, 9, 9, 2); __PYX_ERR(0, 3645, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch", 1, 9, 9, 3); __PYX_ERR(0, 3645, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch", 1, 9, 9, 4); __PYX_ERR(0, 3645, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch", 1, 9, 9, 5); __PYX_ERR(0, 3645, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch", 1, 9, 9, 6); __PYX_ERR(0, 3645, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchStride)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch", 1, 9, 9, 7); __PYX_ERR(0, 3645, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch", 1, 9, 9, 8); __PYX_ERR(0, 3645, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sgtsv2StridedBatch") < 0)) __PYX_ERR(0, 3645, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3645, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3645, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3645, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3645, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3645, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3646, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3646, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_batchStride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3646, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3647, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgtsv2StridedBatch", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3645, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_378sgtsv2StridedBatch(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_batchStride, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_378sgtsv2StridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgtsv2StridedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_sgtsv2StridedBatch(__pyx_v_handle, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_batchStride, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3656
 *     check_status(status)
 * 
 * cpdef dgtsv2StridedBatch(size_t handle, int m, size_t dl, size_t d, size_t du,             # <<<<<<<<<<<<<<
 *                          size_t x, int batchCount, int batchStride,
 *                          size_t pBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_381dgtsv2StridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgtsv2StridedBatch(size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgtsv2StridedBatch", 0);

  /* "cupy/cuda/cusparse.pyx":3659
 *                          size_t x, int batchCount, int batchStride,
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgtsv2StridedBatch(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3660
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2StridedBatch(
 *             <cusparseHandle_t>handle, m, <const double*>dl, <const double*>d,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3661
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDgtsv2StridedBatch(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, <const double*>dl, <const double*>d,
 *             <const double*>du, <double*>x, batchCount, batchStride,
 */
        __pyx_v_status = cusparseDgtsv2StridedBatch(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, ((double const *)__pyx_v_dl), ((double const *)__pyx_v_d), ((double const *)__pyx_v_du), ((double *)__pyx_v_x), __pyx_v_batchCount, __pyx_v_batchStride, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3660
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsv2StridedBatch(
 *             <cusparseHandle_t>handle, m, <const double*>dl, <const double*>d,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3665
 *             <const double*>du, <double*>x, batchCount, batchStride,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cgtsv2StridedBatch(size_t handle, int m, size_t dl, size_t d, size_t du,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3656
 *     check_status(status)
 * 
 * cpdef dgtsv2StridedBatch(size_t handle, int m, size_t dl, size_t d, size_t du,             # <<<<<<<<<<<<<<
 *                          size_t x, int batchCount, int batchStride,
 *                          size_t pBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_381dgtsv2StridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_380dgtsv2StridedBatch[] = "dgtsv2StridedBatch(size_t handle, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, int batchStride, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_381dgtsv2StridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  int __pyx_v_batchStride;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dgtsv2StridedBatch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_x,&__pyx_n_s_batchCount,&__pyx_n_s_batchStride,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch", 1, 9, 9, 1); __PYX_ERR(0, 3656, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch", 1, 9, 9, 2); __PYX_ERR(0, 3656, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch", 1, 9, 9, 3); __PYX_ERR(0, 3656, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch", 1, 9, 9, 4); __PYX_ERR(0, 3656, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch", 1, 9, 9, 5); __PYX_ERR(0, 3656, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch", 1, 9, 9, 6); __PYX_ERR(0, 3656, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchStride)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch", 1, 9, 9, 7); __PYX_ERR(0, 3656, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch", 1, 9, 9, 8); __PYX_ERR(0, 3656, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dgtsv2StridedBatch") < 0)) __PYX_ERR(0, 3656, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3656, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3656, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3656, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3656, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3656, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3657, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3657, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_batchStride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3657, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3658, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgtsv2StridedBatch", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3656, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_380dgtsv2StridedBatch(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_batchStride, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_380dgtsv2StridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgtsv2StridedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dgtsv2StridedBatch(__pyx_v_handle, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_batchStride, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3667
 *     check_status(status)
 * 
 * cpdef cgtsv2StridedBatch(size_t handle, int m, size_t dl, size_t d, size_t du,             # <<<<<<<<<<<<<<
 *                          size_t x, int batchCount, int batchStride,
 *                          size_t pBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_383cgtsv2StridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgtsv2StridedBatch(size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgtsv2StridedBatch", 0);

  /* "cupy/cuda/cusparse.pyx":3670
 *                          size_t x, int batchCount, int batchStride,
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgtsv2StridedBatch(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3671
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2StridedBatch(
 *             <cusparseHandle_t>handle, m, <const cuComplex*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3672
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCgtsv2StridedBatch(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, <const cuComplex*>dl,
 *             <const cuComplex*>d, <const cuComplex*>du, <cuComplex*>x,
 */
        __pyx_v_status = cusparseCgtsv2StridedBatch(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, ((cuComplex const *)__pyx_v_dl), ((cuComplex const *)__pyx_v_d), ((cuComplex const *)__pyx_v_du), ((cuComplex *)__pyx_v_x), __pyx_v_batchCount, __pyx_v_batchStride, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3671
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsv2StridedBatch(
 *             <cusparseHandle_t>handle, m, <const cuComplex*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3676
 *             <const cuComplex*>d, <const cuComplex*>du, <cuComplex*>x,
 *             batchCount, batchStride, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zgtsv2StridedBatch(size_t handle, int m, size_t dl, size_t d, size_t du,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3667
 *     check_status(status)
 * 
 * cpdef cgtsv2StridedBatch(size_t handle, int m, size_t dl, size_t d, size_t du,             # <<<<<<<<<<<<<<
 *                          size_t x, int batchCount, int batchStride,
 *                          size_t pBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_383cgtsv2StridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_382cgtsv2StridedBatch[] = "cgtsv2StridedBatch(size_t handle, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, int batchStride, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_383cgtsv2StridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  int __pyx_v_batchStride;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cgtsv2StridedBatch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_x,&__pyx_n_s_batchCount,&__pyx_n_s_batchStride,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch", 1, 9, 9, 1); __PYX_ERR(0, 3667, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch", 1, 9, 9, 2); __PYX_ERR(0, 3667, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch", 1, 9, 9, 3); __PYX_ERR(0, 3667, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch", 1, 9, 9, 4); __PYX_ERR(0, 3667, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch", 1, 9, 9, 5); __PYX_ERR(0, 3667, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch", 1, 9, 9, 6); __PYX_ERR(0, 3667, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchStride)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch", 1, 9, 9, 7); __PYX_ERR(0, 3667, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch", 1, 9, 9, 8); __PYX_ERR(0, 3667, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cgtsv2StridedBatch") < 0)) __PYX_ERR(0, 3667, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3667, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3667, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3667, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3667, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3667, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3668, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3668, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_batchStride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3668, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3669, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgtsv2StridedBatch", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3667, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_382cgtsv2StridedBatch(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_batchStride, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_382cgtsv2StridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgtsv2StridedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cgtsv2StridedBatch(__pyx_v_handle, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_batchStride, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3678
 *     check_status(status)
 * 
 * cpdef zgtsv2StridedBatch(size_t handle, int m, size_t dl, size_t d, size_t du,             # <<<<<<<<<<<<<<
 *                          size_t x, int batchCount, int batchStride,
 *                          size_t pBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_385zgtsv2StridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgtsv2StridedBatch(size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgtsv2StridedBatch", 0);

  /* "cupy/cuda/cusparse.pyx":3681
 *                          size_t x, int batchCount, int batchStride,
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgtsv2StridedBatch(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3682
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2StridedBatch(
 *             <cusparseHandle_t>handle, m, <const cuDoubleComplex*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3683
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZgtsv2StridedBatch(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, m, <const cuDoubleComplex*>dl,
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 */
        __pyx_v_status = cusparseZgtsv2StridedBatch(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, ((cuDoubleComplex const *)__pyx_v_dl), ((cuDoubleComplex const *)__pyx_v_d), ((cuDoubleComplex const *)__pyx_v_du), ((cuDoubleComplex *)__pyx_v_x), __pyx_v_batchCount, __pyx_v_batchStride, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3682
 *                          size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsv2StridedBatch(
 *             <cusparseHandle_t>handle, m, <const cuDoubleComplex*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3687
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 *             <cuDoubleComplex*>x, batchCount, batchStride, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t sgtsvInterleavedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3678
 *     check_status(status)
 * 
 * cpdef zgtsv2StridedBatch(size_t handle, int m, size_t dl, size_t d, size_t du,             # <<<<<<<<<<<<<<
 *                          size_t x, int batchCount, int batchStride,
 *                          size_t pBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_385zgtsv2StridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_384zgtsv2StridedBatch[] = "zgtsv2StridedBatch(size_t handle, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, int batchStride, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_385zgtsv2StridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_m;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  int __pyx_v_batchStride;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zgtsv2StridedBatch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_x,&__pyx_n_s_batchCount,&__pyx_n_s_batchStride,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch", 1, 9, 9, 1); __PYX_ERR(0, 3678, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch", 1, 9, 9, 2); __PYX_ERR(0, 3678, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch", 1, 9, 9, 3); __PYX_ERR(0, 3678, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch", 1, 9, 9, 4); __PYX_ERR(0, 3678, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch", 1, 9, 9, 5); __PYX_ERR(0, 3678, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch", 1, 9, 9, 6); __PYX_ERR(0, 3678, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchStride)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch", 1, 9, 9, 7); __PYX_ERR(0, 3678, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch", 1, 9, 9, 8); __PYX_ERR(0, 3678, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zgtsv2StridedBatch") < 0)) __PYX_ERR(0, 3678, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3678, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3678, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3678, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3678, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3678, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3679, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3679, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_batchStride == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3679, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3680, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgtsv2StridedBatch", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3678, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_384zgtsv2StridedBatch(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_batchStride, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_384zgtsv2StridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, int __pyx_v_batchStride, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgtsv2StridedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zgtsv2StridedBatch(__pyx_v_handle, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_batchStride, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsv2StridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3689
 *     check_status(status)
 * 
 * cpdef size_t sgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int algo, int m, size_t dl, size_t d, size_t du,
 *         size_t x, int batchCount):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_387sgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_sgtsvInterleavedBatch_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgtsvInterleavedBatch_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3693
 *         size_t x, int batchCount):
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgtsvInterleavedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3694
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const float*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3695
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, algo, m, <const float*>dl,
 *             <const float*>d, <const float*>du, <const float*>x, batchCount,
 */
        __pyx_v_status = cusparseSgtsvInterleavedBatch_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, __pyx_v_m, ((float const *)__pyx_v_dl), ((float const *)__pyx_v_d), ((float const *)__pyx_v_du), ((float const *)__pyx_v_x), __pyx_v_batchCount, (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3694
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const float*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3699
 *             <const float*>d, <const float*>du, <const float*>x, batchCount,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3700
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <size_t>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t dgtsvInterleavedBatch_bufferSizeExt(
 */
  __pyx_r = ((size_t)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3689
 *     check_status(status)
 * 
 * cpdef size_t sgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int algo, int m, size_t dl, size_t d, size_t du,
 *         size_t x, int batchCount):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.sgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_387sgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_386sgtsvInterleavedBatch_bufferSizeExt[] = "sgtsvInterleavedBatch_bufferSizeExt(size_t handle, int algo, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_387sgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_m;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sgtsvInterleavedBatch_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_algo,&__pyx_n_s_m,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_x,&__pyx_n_s_batchCount,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_algo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 1); __PYX_ERR(0, 3689, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 2); __PYX_ERR(0, 3689, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 3); __PYX_ERR(0, 3689, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 4); __PYX_ERR(0, 3689, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 5); __PYX_ERR(0, 3689, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 6); __PYX_ERR(0, 3689, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 7); __PYX_ERR(0, 3689, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sgtsvInterleavedBatch_bufferSizeExt") < 0)) __PYX_ERR(0, 3689, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3690, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3690, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3690, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3690, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3690, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3690, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3691, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3691, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3689, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_386sgtsvInterleavedBatch_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_386sgtsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgtsvInterleavedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_sgtsvInterleavedBatch_bufferSizeExt(__pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3702
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t dgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int algo, int m, size_t dl, size_t d, size_t du,
 *         size_t x, int batchCount):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_389dgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_dgtsvInterleavedBatch_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgtsvInterleavedBatch_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3706
 *         size_t x, int batchCount):
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgtsvInterleavedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3707
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const double*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3708
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, algo, m, <const double*>dl,
 *             <const double*>d, <const double*>du, <const double*>x, batchCount,
 */
        __pyx_v_status = cusparseDgtsvInterleavedBatch_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, __pyx_v_m, ((double const *)__pyx_v_dl), ((double const *)__pyx_v_d), ((double const *)__pyx_v_du), ((double const *)__pyx_v_x), __pyx_v_batchCount, (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3707
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const double*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3712
 *             <const double*>d, <const double*>du, <const double*>x, batchCount,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3713
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <size_t>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t cgtsvInterleavedBatch_bufferSizeExt(
 */
  __pyx_r = ((size_t)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3702
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t dgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int algo, int m, size_t dl, size_t d, size_t du,
 *         size_t x, int batchCount):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.dgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_389dgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_388dgtsvInterleavedBatch_bufferSizeExt[] = "dgtsvInterleavedBatch_bufferSizeExt(size_t handle, int algo, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_389dgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_m;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dgtsvInterleavedBatch_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_algo,&__pyx_n_s_m,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_x,&__pyx_n_s_batchCount,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_algo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 1); __PYX_ERR(0, 3702, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 2); __PYX_ERR(0, 3702, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 3); __PYX_ERR(0, 3702, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 4); __PYX_ERR(0, 3702, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 5); __PYX_ERR(0, 3702, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 6); __PYX_ERR(0, 3702, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 7); __PYX_ERR(0, 3702, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dgtsvInterleavedBatch_bufferSizeExt") < 0)) __PYX_ERR(0, 3702, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3703, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3703, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3703, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3703, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3703, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3703, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3704, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3704, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3702, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_388dgtsvInterleavedBatch_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_388dgtsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgtsvInterleavedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_dgtsvInterleavedBatch_bufferSizeExt(__pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3715
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t cgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int algo, int m, size_t dl, size_t d, size_t du,
 *         size_t x, int batchCount):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_391cgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_cgtsvInterleavedBatch_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgtsvInterleavedBatch_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3719
 *         size_t x, int batchCount):
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgtsvInterleavedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3720
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const cuComplex*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3721
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, algo, m, <const cuComplex*>dl,
 *             <const cuComplex*>d, <const cuComplex*>du, <const cuComplex*>x,
 */
        __pyx_v_status = cusparseCgtsvInterleavedBatch_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, __pyx_v_m, ((cuComplex const *)__pyx_v_dl), ((cuComplex const *)__pyx_v_d), ((cuComplex const *)__pyx_v_du), ((cuComplex const *)__pyx_v_x), __pyx_v_batchCount, (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3720
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const cuComplex*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3725
 *             <const cuComplex*>d, <const cuComplex*>du, <const cuComplex*>x,
 *             batchCount, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3726
 *             batchCount, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <size_t>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t zgtsvInterleavedBatch_bufferSizeExt(
 */
  __pyx_r = ((size_t)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3715
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t cgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int algo, int m, size_t dl, size_t d, size_t du,
 *         size_t x, int batchCount):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.cgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_391cgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_390cgtsvInterleavedBatch_bufferSizeExt[] = "cgtsvInterleavedBatch_bufferSizeExt(size_t handle, int algo, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_391cgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_m;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cgtsvInterleavedBatch_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_algo,&__pyx_n_s_m,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_x,&__pyx_n_s_batchCount,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_algo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 1); __PYX_ERR(0, 3715, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 2); __PYX_ERR(0, 3715, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 3); __PYX_ERR(0, 3715, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 4); __PYX_ERR(0, 3715, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 5); __PYX_ERR(0, 3715, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 6); __PYX_ERR(0, 3715, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 7); __PYX_ERR(0, 3715, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cgtsvInterleavedBatch_bufferSizeExt") < 0)) __PYX_ERR(0, 3715, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3716, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3716, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3716, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3716, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3716, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3716, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3717, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3717, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3715, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_390cgtsvInterleavedBatch_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_390cgtsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgtsvInterleavedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_cgtsvInterleavedBatch_bufferSizeExt(__pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3728
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t zgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int algo, int m, size_t dl, size_t d, size_t du,
 *         size_t x, int batchCount):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_393zgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_zgtsvInterleavedBatch_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgtsvInterleavedBatch_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3732
 *         size_t x, int batchCount):
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgtsvInterleavedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3733
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const cuDoubleComplex*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3734
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, algo, m, <const cuDoubleComplex*>dl,
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 */
        __pyx_v_status = cusparseZgtsvInterleavedBatch_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, __pyx_v_m, ((cuDoubleComplex const *)__pyx_v_dl), ((cuDoubleComplex const *)__pyx_v_d), ((cuDoubleComplex const *)__pyx_v_du), ((cuDoubleComplex const *)__pyx_v_x), __pyx_v_batchCount, (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3733
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const cuDoubleComplex*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3738
 *             <const cuDoubleComplex*>d, <const cuDoubleComplex*>du,
 *             <const cuDoubleComplex*>x, batchCount, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3739
 *             <const cuDoubleComplex*>x, batchCount, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <size_t>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef sgtsvInterleavedBatch(size_t handle, int algo, int m, size_t dl,
 */
  __pyx_r = ((size_t)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3728
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t zgtsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int algo, int m, size_t dl, size_t d, size_t du,
 *         size_t x, int batchCount):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.zgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_393zgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_392zgtsvInterleavedBatch_bufferSizeExt[] = "zgtsvInterleavedBatch_bufferSizeExt(size_t handle, int algo, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_393zgtsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_m;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zgtsvInterleavedBatch_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_algo,&__pyx_n_s_m,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_x,&__pyx_n_s_batchCount,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_algo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 1); __PYX_ERR(0, 3728, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 2); __PYX_ERR(0, 3728, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 3); __PYX_ERR(0, 3728, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 4); __PYX_ERR(0, 3728, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 5); __PYX_ERR(0, 3728, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 6); __PYX_ERR(0, 3728, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, 7); __PYX_ERR(0, 3728, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zgtsvInterleavedBatch_bufferSizeExt") < 0)) __PYX_ERR(0, 3728, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3729, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3729, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3729, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3729, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3729, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3729, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3730, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3730, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch_bufferSizeExt", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3728, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_392zgtsvInterleavedBatch_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_392zgtsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgtsvInterleavedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_zgtsvInterleavedBatch_bufferSizeExt(__pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3741
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef sgtsvInterleavedBatch(size_t handle, int algo, int m, size_t dl,             # <<<<<<<<<<<<<<
 *                             size_t d, size_t du, size_t x, int batchCount,
 *                             size_t pBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_395sgtsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgtsvInterleavedBatch(size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgtsvInterleavedBatch", 0);

  /* "cupy/cuda/cusparse.pyx":3744
 *                             size_t d, size_t du, size_t x, int batchCount,
 *                             size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgtsvInterleavedBatch(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3745
 *                             size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <float*>dl, <float*>d,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3746
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSgtsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, algo, m, <float*>dl, <float*>d,
 *             <float*>du, <float*>x, batchCount, <void*>pBuffer)
 */
        __pyx_v_status = cusparseSgtsvInterleavedBatch(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, __pyx_v_m, ((float *)__pyx_v_dl), ((float *)__pyx_v_d), ((float *)__pyx_v_du), ((float *)__pyx_v_x), __pyx_v_batchCount, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3745
 *                             size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgtsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <float*>dl, <float*>d,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3749
 *             <cusparseHandle_t>handle, algo, m, <float*>dl, <float*>d,
 *             <float*>du, <float*>x, batchCount, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dgtsvInterleavedBatch(size_t handle, int algo, int m, size_t dl,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3741
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef sgtsvInterleavedBatch(size_t handle, int algo, int m, size_t dl,             # <<<<<<<<<<<<<<
 *                             size_t d, size_t du, size_t x, int batchCount,
 *                             size_t pBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_395sgtsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_394sgtsvInterleavedBatch[] = "sgtsvInterleavedBatch(size_t handle, int algo, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_395sgtsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_m;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sgtsvInterleavedBatch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_algo,&__pyx_n_s_m,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_x,&__pyx_n_s_batchCount,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_algo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch", 1, 9, 9, 1); __PYX_ERR(0, 3741, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch", 1, 9, 9, 2); __PYX_ERR(0, 3741, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch", 1, 9, 9, 3); __PYX_ERR(0, 3741, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch", 1, 9, 9, 4); __PYX_ERR(0, 3741, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch", 1, 9, 9, 5); __PYX_ERR(0, 3741, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch", 1, 9, 9, 6); __PYX_ERR(0, 3741, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch", 1, 9, 9, 7); __PYX_ERR(0, 3741, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch", 1, 9, 9, 8); __PYX_ERR(0, 3741, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sgtsvInterleavedBatch") < 0)) __PYX_ERR(0, 3741, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3741, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3741, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3741, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3741, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3742, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3742, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3742, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3742, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3743, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgtsvInterleavedBatch", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3741, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_394sgtsvInterleavedBatch(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_394sgtsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgtsvInterleavedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_sgtsvInterleavedBatch(__pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3751
 *     check_status(status)
 * 
 * cpdef dgtsvInterleavedBatch(size_t handle, int algo, int m, size_t dl,             # <<<<<<<<<<<<<<
 *                             size_t d, size_t du, size_t x, int batchCount,
 *                             size_t pBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_397dgtsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgtsvInterleavedBatch(size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgtsvInterleavedBatch", 0);

  /* "cupy/cuda/cusparse.pyx":3754
 *                             size_t d, size_t du, size_t x, int batchCount,
 *                             size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgtsvInterleavedBatch(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3755
 *                             size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <double*>dl, <double*>d,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3756
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDgtsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, algo, m, <double*>dl, <double*>d,
 *             <double*>du, <double*>x, batchCount, <void*>pBuffer)
 */
        __pyx_v_status = cusparseDgtsvInterleavedBatch(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, __pyx_v_m, ((double *)__pyx_v_dl), ((double *)__pyx_v_d), ((double *)__pyx_v_du), ((double *)__pyx_v_x), __pyx_v_batchCount, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3755
 *                             size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgtsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <double*>dl, <double*>d,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3759
 *             <cusparseHandle_t>handle, algo, m, <double*>dl, <double*>d,
 *             <double*>du, <double*>x, batchCount, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cgtsvInterleavedBatch(size_t handle, int algo, int m, size_t dl,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3751
 *     check_status(status)
 * 
 * cpdef dgtsvInterleavedBatch(size_t handle, int algo, int m, size_t dl,             # <<<<<<<<<<<<<<
 *                             size_t d, size_t du, size_t x, int batchCount,
 *                             size_t pBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_397dgtsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_396dgtsvInterleavedBatch[] = "dgtsvInterleavedBatch(size_t handle, int algo, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_397dgtsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_m;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dgtsvInterleavedBatch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_algo,&__pyx_n_s_m,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_x,&__pyx_n_s_batchCount,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_algo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch", 1, 9, 9, 1); __PYX_ERR(0, 3751, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch", 1, 9, 9, 2); __PYX_ERR(0, 3751, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch", 1, 9, 9, 3); __PYX_ERR(0, 3751, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch", 1, 9, 9, 4); __PYX_ERR(0, 3751, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch", 1, 9, 9, 5); __PYX_ERR(0, 3751, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch", 1, 9, 9, 6); __PYX_ERR(0, 3751, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch", 1, 9, 9, 7); __PYX_ERR(0, 3751, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch", 1, 9, 9, 8); __PYX_ERR(0, 3751, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dgtsvInterleavedBatch") < 0)) __PYX_ERR(0, 3751, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3751, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3751, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3751, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3751, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3752, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3752, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3752, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3752, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3753, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgtsvInterleavedBatch", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3751, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_396dgtsvInterleavedBatch(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_396dgtsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgtsvInterleavedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dgtsvInterleavedBatch(__pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3761
 *     check_status(status)
 * 
 * cpdef cgtsvInterleavedBatch(size_t handle, int algo, int m, size_t dl,             # <<<<<<<<<<<<<<
 *                             size_t d, size_t du, size_t x, int batchCount,
 *                             size_t pBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_399cgtsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgtsvInterleavedBatch(size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgtsvInterleavedBatch", 0);

  /* "cupy/cuda/cusparse.pyx":3764
 *                             size_t d, size_t du, size_t x, int batchCount,
 *                             size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgtsvInterleavedBatch(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3765
 *                             size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <cuComplex*>dl, <cuComplex*>d,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3766
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCgtsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, algo, m, <cuComplex*>dl, <cuComplex*>d,
 *             <cuComplex*>du, <cuComplex*>x, batchCount, <void*>pBuffer)
 */
        __pyx_v_status = cusparseCgtsvInterleavedBatch(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, __pyx_v_m, ((cuComplex *)__pyx_v_dl), ((cuComplex *)__pyx_v_d), ((cuComplex *)__pyx_v_du), ((cuComplex *)__pyx_v_x), __pyx_v_batchCount, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3765
 *                             size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgtsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <cuComplex*>dl, <cuComplex*>d,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3769
 *             <cusparseHandle_t>handle, algo, m, <cuComplex*>dl, <cuComplex*>d,
 *             <cuComplex*>du, <cuComplex*>x, batchCount, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zgtsvInterleavedBatch(size_t handle, int algo, int m, size_t dl,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3761
 *     check_status(status)
 * 
 * cpdef cgtsvInterleavedBatch(size_t handle, int algo, int m, size_t dl,             # <<<<<<<<<<<<<<
 *                             size_t d, size_t du, size_t x, int batchCount,
 *                             size_t pBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_399cgtsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_398cgtsvInterleavedBatch[] = "cgtsvInterleavedBatch(size_t handle, int algo, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_399cgtsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_m;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cgtsvInterleavedBatch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_algo,&__pyx_n_s_m,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_x,&__pyx_n_s_batchCount,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_algo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch", 1, 9, 9, 1); __PYX_ERR(0, 3761, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch", 1, 9, 9, 2); __PYX_ERR(0, 3761, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch", 1, 9, 9, 3); __PYX_ERR(0, 3761, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch", 1, 9, 9, 4); __PYX_ERR(0, 3761, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch", 1, 9, 9, 5); __PYX_ERR(0, 3761, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch", 1, 9, 9, 6); __PYX_ERR(0, 3761, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch", 1, 9, 9, 7); __PYX_ERR(0, 3761, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch", 1, 9, 9, 8); __PYX_ERR(0, 3761, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cgtsvInterleavedBatch") < 0)) __PYX_ERR(0, 3761, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3761, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3761, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3761, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3761, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3762, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3762, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3762, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3762, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3763, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgtsvInterleavedBatch", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3761, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_398cgtsvInterleavedBatch(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_398cgtsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgtsvInterleavedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cgtsvInterleavedBatch(__pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3771
 *     check_status(status)
 * 
 * cpdef zgtsvInterleavedBatch(size_t handle, int algo, int m, size_t dl,             # <<<<<<<<<<<<<<
 *                             size_t d, size_t du, size_t x, int batchCount,
 *                             size_t pBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_401zgtsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgtsvInterleavedBatch(size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgtsvInterleavedBatch", 0);

  /* "cupy/cuda/cusparse.pyx":3774
 *                             size_t d, size_t du, size_t x, int batchCount,
 *                             size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgtsvInterleavedBatch(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3775
 *                             size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <cuDoubleComplex*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3776
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZgtsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, algo, m, <cuDoubleComplex*>dl,
 *             <cuDoubleComplex*>d, <cuDoubleComplex*>du, <cuDoubleComplex*>x,
 */
        __pyx_v_status = cusparseZgtsvInterleavedBatch(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, __pyx_v_m, ((cuDoubleComplex *)__pyx_v_dl), ((cuDoubleComplex *)__pyx_v_d), ((cuDoubleComplex *)__pyx_v_du), ((cuDoubleComplex *)__pyx_v_x), __pyx_v_batchCount, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3775
 *                             size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgtsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <cuDoubleComplex*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3780
 *             <cuDoubleComplex*>d, <cuDoubleComplex*>du, <cuDoubleComplex*>x,
 *             batchCount, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t sgpsvInterleavedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3771
 *     check_status(status)
 * 
 * cpdef zgtsvInterleavedBatch(size_t handle, int algo, int m, size_t dl,             # <<<<<<<<<<<<<<
 *                             size_t d, size_t du, size_t x, int batchCount,
 *                             size_t pBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_401zgtsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_400zgtsvInterleavedBatch[] = "zgtsvInterleavedBatch(size_t handle, int algo, int m, size_t dl, size_t d, size_t du, size_t x, int batchCount, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_401zgtsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_m;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zgtsvInterleavedBatch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_algo,&__pyx_n_s_m,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_x,&__pyx_n_s_batchCount,&__pyx_n_s_pBuffer,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_algo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch", 1, 9, 9, 1); __PYX_ERR(0, 3771, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch", 1, 9, 9, 2); __PYX_ERR(0, 3771, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch", 1, 9, 9, 3); __PYX_ERR(0, 3771, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch", 1, 9, 9, 4); __PYX_ERR(0, 3771, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch", 1, 9, 9, 5); __PYX_ERR(0, 3771, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch", 1, 9, 9, 6); __PYX_ERR(0, 3771, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch", 1, 9, 9, 7); __PYX_ERR(0, 3771, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch", 1, 9, 9, 8); __PYX_ERR(0, 3771, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zgtsvInterleavedBatch") < 0)) __PYX_ERR(0, 3771, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3771, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3771, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3771, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3771, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3772, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3772, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3772, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3772, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3773, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgtsvInterleavedBatch", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3771, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_400zgtsvInterleavedBatch(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_400zgtsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgtsvInterleavedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zgtsvInterleavedBatch(__pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_x, __pyx_v_batchCount, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgtsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3782
 *     check_status(status)
 * 
 * cpdef size_t sgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int algo, int m, size_t ds, size_t dl, size_t d,
 *         size_t du, size_t dw, size_t x, int batchCount):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_403sgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_sgpsvInterleavedBatch_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgpsvInterleavedBatch_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3786
 *         size_t du, size_t dw, size_t x, int batchCount):
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgpsvInterleavedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3787
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgpsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const float*>ds,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3788
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, algo, m, <const float*>ds,
 *             <const float*>dl, <const float*>d, <const float*>du,
 */
        __pyx_v_status = cusparseSgpsvInterleavedBatch_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, __pyx_v_m, ((float const *)__pyx_v_ds), ((float const *)__pyx_v_dl), ((float const *)__pyx_v_d), ((float const *)__pyx_v_du), ((float const *)__pyx_v_dw), ((float const *)__pyx_v_x), __pyx_v_batchCount, (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3787
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgpsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const float*>ds,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3792
 *             <const float*>dl, <const float*>d, <const float*>du,
 *             <const float*>dw, <const float*>x, batchCount, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3793
 *             <const float*>dw, <const float*>x, batchCount, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <size_t>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t dgpsvInterleavedBatch_bufferSizeExt(
 */
  __pyx_r = ((size_t)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3782
 *     check_status(status)
 * 
 * cpdef size_t sgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int algo, int m, size_t ds, size_t dl, size_t d,
 *         size_t du, size_t dw, size_t x, int batchCount):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.sgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_403sgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_402sgpsvInterleavedBatch_bufferSizeExt[] = "sgpsvInterleavedBatch_bufferSizeExt(size_t handle, int algo, int m, size_t ds, size_t dl, size_t d, size_t du, size_t dw, size_t x, int batchCount) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_403sgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_m;
  size_t __pyx_v_ds;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_dw;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sgpsvInterleavedBatch_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_algo,&__pyx_n_s_m,&__pyx_n_s_ds,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_dw,&__pyx_n_s_x,&__pyx_n_s_batchCount,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_algo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 1); __PYX_ERR(0, 3782, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 2); __PYX_ERR(0, 3782, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ds)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 3); __PYX_ERR(0, 3782, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 4); __PYX_ERR(0, 3782, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 5); __PYX_ERR(0, 3782, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 6); __PYX_ERR(0, 3782, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dw)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 7); __PYX_ERR(0, 3782, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 8); __PYX_ERR(0, 3782, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 9); __PYX_ERR(0, 3782, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sgpsvInterleavedBatch_bufferSizeExt") < 0)) __PYX_ERR(0, 3782, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3783, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3783, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3783, __pyx_L3_error)
    __pyx_v_ds = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_ds == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3783, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3783, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3783, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3784, __pyx_L3_error)
    __pyx_v_dw = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_dw == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3784, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3784, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3784, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3782, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_402sgpsvInterleavedBatch_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_ds, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_dw, __pyx_v_x, __pyx_v_batchCount);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_402sgpsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgpsvInterleavedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_sgpsvInterleavedBatch_bufferSizeExt(__pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_ds, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_dw, __pyx_v_x, __pyx_v_batchCount, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3795
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t dgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int algo, int m, size_t ds, size_t dl, size_t d,
 *         size_t du, size_t dw, size_t x, int batchCount):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_405dgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_dgpsvInterleavedBatch_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgpsvInterleavedBatch_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3799
 *         size_t du, size_t dw, size_t x, int batchCount):
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgpsvInterleavedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3800
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgpsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const double*>ds,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3801
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, algo, m, <const double*>ds,
 *             <const double*>dl, <const double*>d, <const double*>du,
 */
        __pyx_v_status = cusparseDgpsvInterleavedBatch_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, __pyx_v_m, ((double const *)__pyx_v_ds), ((double const *)__pyx_v_dl), ((double const *)__pyx_v_d), ((double const *)__pyx_v_du), ((double const *)__pyx_v_dw), ((double const *)__pyx_v_x), __pyx_v_batchCount, (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3800
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgpsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const double*>ds,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3806
 *             <const double*>dw, <const double*>x, batchCount,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3807
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <size_t>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t cgpsvInterleavedBatch_bufferSizeExt(
 */
  __pyx_r = ((size_t)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3795
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t dgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int algo, int m, size_t ds, size_t dl, size_t d,
 *         size_t du, size_t dw, size_t x, int batchCount):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.dgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_405dgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_404dgpsvInterleavedBatch_bufferSizeExt[] = "dgpsvInterleavedBatch_bufferSizeExt(size_t handle, int algo, int m, size_t ds, size_t dl, size_t d, size_t du, size_t dw, size_t x, int batchCount) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_405dgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_m;
  size_t __pyx_v_ds;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_dw;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dgpsvInterleavedBatch_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_algo,&__pyx_n_s_m,&__pyx_n_s_ds,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_dw,&__pyx_n_s_x,&__pyx_n_s_batchCount,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_algo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 1); __PYX_ERR(0, 3795, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 2); __PYX_ERR(0, 3795, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ds)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 3); __PYX_ERR(0, 3795, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 4); __PYX_ERR(0, 3795, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 5); __PYX_ERR(0, 3795, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 6); __PYX_ERR(0, 3795, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dw)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 7); __PYX_ERR(0, 3795, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 8); __PYX_ERR(0, 3795, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 9); __PYX_ERR(0, 3795, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dgpsvInterleavedBatch_bufferSizeExt") < 0)) __PYX_ERR(0, 3795, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3796, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3796, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3796, __pyx_L3_error)
    __pyx_v_ds = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_ds == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3796, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3796, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3796, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3797, __pyx_L3_error)
    __pyx_v_dw = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_dw == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3797, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3797, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3797, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3795, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_404dgpsvInterleavedBatch_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_ds, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_dw, __pyx_v_x, __pyx_v_batchCount);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_404dgpsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgpsvInterleavedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_dgpsvInterleavedBatch_bufferSizeExt(__pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_ds, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_dw, __pyx_v_x, __pyx_v_batchCount, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3809
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t cgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int algo, int m, size_t ds, size_t dl, size_t d,
 *         size_t du, size_t dw, size_t x, int batchCount):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_407cgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_cgpsvInterleavedBatch_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgpsvInterleavedBatch_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3813
 *         size_t du, size_t dw, size_t x, int batchCount):
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgpsvInterleavedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3814
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgpsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const cuComplex*>ds,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3815
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, algo, m, <const cuComplex*>ds,
 *             <const cuComplex*>dl, <const cuComplex*>d, <const cuComplex*>du,
 */
        __pyx_v_status = cusparseCgpsvInterleavedBatch_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, __pyx_v_m, ((cuComplex const *)__pyx_v_ds), ((cuComplex const *)__pyx_v_dl), ((cuComplex const *)__pyx_v_d), ((cuComplex const *)__pyx_v_du), ((cuComplex const *)__pyx_v_dw), ((cuComplex const *)__pyx_v_x), __pyx_v_batchCount, (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3814
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgpsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const cuComplex*>ds,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3820
 *             <const cuComplex*>dw, <const cuComplex*>x, batchCount,
 *             &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3821
 *             &pBufferSizeInBytes)
 *     check_status(status)
 *     return <size_t>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t zgpsvInterleavedBatch_bufferSizeExt(
 */
  __pyx_r = ((size_t)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3809
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t cgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int algo, int m, size_t ds, size_t dl, size_t d,
 *         size_t du, size_t dw, size_t x, int batchCount):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.cgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_407cgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_406cgpsvInterleavedBatch_bufferSizeExt[] = "cgpsvInterleavedBatch_bufferSizeExt(size_t handle, int algo, int m, size_t ds, size_t dl, size_t d, size_t du, size_t dw, size_t x, int batchCount) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_407cgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_m;
  size_t __pyx_v_ds;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_dw;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cgpsvInterleavedBatch_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_algo,&__pyx_n_s_m,&__pyx_n_s_ds,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_dw,&__pyx_n_s_x,&__pyx_n_s_batchCount,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_algo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 1); __PYX_ERR(0, 3809, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 2); __PYX_ERR(0, 3809, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ds)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 3); __PYX_ERR(0, 3809, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 4); __PYX_ERR(0, 3809, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 5); __PYX_ERR(0, 3809, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 6); __PYX_ERR(0, 3809, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dw)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 7); __PYX_ERR(0, 3809, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 8); __PYX_ERR(0, 3809, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 9); __PYX_ERR(0, 3809, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cgpsvInterleavedBatch_bufferSizeExt") < 0)) __PYX_ERR(0, 3809, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3810, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3810, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3810, __pyx_L3_error)
    __pyx_v_ds = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_ds == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3810, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3810, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3810, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3811, __pyx_L3_error)
    __pyx_v_dw = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_dw == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3811, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3811, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3811, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3809, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_406cgpsvInterleavedBatch_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_ds, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_dw, __pyx_v_x, __pyx_v_batchCount);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_406cgpsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgpsvInterleavedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_cgpsvInterleavedBatch_bufferSizeExt(__pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_ds, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_dw, __pyx_v_x, __pyx_v_batchCount, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3823
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t zgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int algo, int m, size_t ds, size_t dl, size_t d,
 *         size_t du, size_t dw, size_t x, int batchCount):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_409zgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_zgpsvInterleavedBatch_bufferSizeExt(size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_pBufferSizeInBytes;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgpsvInterleavedBatch_bufferSizeExt", 0);

  /* "cupy/cuda/cusparse.pyx":3827
 *         size_t du, size_t dw, size_t x, int batchCount):
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgpsvInterleavedBatch_bufferSizeExt(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3828
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgpsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const cuDoubleComplex*>ds,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3829
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, algo, m, <const cuDoubleComplex*>ds,
 *             <const cuDoubleComplex*>dl, <const cuDoubleComplex*>d,
 */
        __pyx_v_status = cusparseZgpsvInterleavedBatch_bufferSizeExt(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, __pyx_v_m, ((cuDoubleComplex const *)__pyx_v_ds), ((cuDoubleComplex const *)__pyx_v_dl), ((cuDoubleComplex const *)__pyx_v_d), ((cuDoubleComplex const *)__pyx_v_du), ((cuDoubleComplex const *)__pyx_v_dw), ((cuDoubleComplex const *)__pyx_v_x), __pyx_v_batchCount, (&__pyx_v_pBufferSizeInBytes));
      }

      /* "cupy/cuda/cusparse.pyx":3828
 *     cdef size_t pBufferSizeInBytes
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgpsvInterleavedBatch_bufferSizeExt(
 *             <cusparseHandle_t>handle, algo, m, <const cuDoubleComplex*>ds,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3834
 *             <const cuDoubleComplex*>du, <const cuDoubleComplex*>dw,
 *             <const cuDoubleComplex*>x, batchCount, &pBufferSizeInBytes)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>pBufferSizeInBytes
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3835
 *             <const cuDoubleComplex*>x, batchCount, &pBufferSizeInBytes)
 *     check_status(status)
 *     return <size_t>pBufferSizeInBytes             # <<<<<<<<<<<<<<
 * 
 * cpdef sgpsvInterleavedBatch(size_t handle, int algo, int m, size_t ds,
 */
  __pyx_r = ((size_t)__pyx_v_pBufferSizeInBytes);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3823
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef size_t zgpsvInterleavedBatch_bufferSizeExt(             # <<<<<<<<<<<<<<
 *         size_t handle, int algo, int m, size_t ds, size_t dl, size_t d,
 *         size_t du, size_t dw, size_t x, int batchCount):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.zgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_409zgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_408zgpsvInterleavedBatch_bufferSizeExt[] = "zgpsvInterleavedBatch_bufferSizeExt(size_t handle, int algo, int m, size_t ds, size_t dl, size_t d, size_t du, size_t dw, size_t x, int batchCount) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_409zgpsvInterleavedBatch_bufferSizeExt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_m;
  size_t __pyx_v_ds;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_dw;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zgpsvInterleavedBatch_bufferSizeExt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_algo,&__pyx_n_s_m,&__pyx_n_s_ds,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_dw,&__pyx_n_s_x,&__pyx_n_s_batchCount,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_algo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 1); __PYX_ERR(0, 3823, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 2); __PYX_ERR(0, 3823, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ds)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 3); __PYX_ERR(0, 3823, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 4); __PYX_ERR(0, 3823, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 5); __PYX_ERR(0, 3823, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 6); __PYX_ERR(0, 3823, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dw)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 7); __PYX_ERR(0, 3823, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 8); __PYX_ERR(0, 3823, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, 9); __PYX_ERR(0, 3823, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zgpsvInterleavedBatch_bufferSizeExt") < 0)) __PYX_ERR(0, 3823, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3824, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3824, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3824, __pyx_L3_error)
    __pyx_v_ds = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_ds == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3824, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3824, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3824, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3825, __pyx_L3_error)
    __pyx_v_dw = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_dw == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3825, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3825, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3825, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch_bufferSizeExt", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3823, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_408zgpsvInterleavedBatch_bufferSizeExt(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_ds, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_dw, __pyx_v_x, __pyx_v_batchCount);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_408zgpsvInterleavedBatch_bufferSizeExt(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgpsvInterleavedBatch_bufferSizeExt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_zgpsvInterleavedBatch_bufferSizeExt(__pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_ds, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_dw, __pyx_v_x, __pyx_v_batchCount, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgpsvInterleavedBatch_bufferSizeExt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3837
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef sgpsvInterleavedBatch(size_t handle, int algo, int m, size_t ds,             # <<<<<<<<<<<<<<
 *                             size_t dl, size_t d, size_t du, size_t dw,
 *                             size_t x, int batchCount, size_t pBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_411sgpsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_sgpsvInterleavedBatch(size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgpsvInterleavedBatch", 0);

  /* "cupy/cuda/cusparse.pyx":3840
 *                             size_t dl, size_t d, size_t du, size_t dw,
 *                             size_t x, int batchCount, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseSgpsvInterleavedBatch(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3841
 *                             size_t x, int batchCount, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgpsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <float*>ds, <float*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3842
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseSgpsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, algo, m, <float*>ds, <float*>dl,
 *             <float*>d, <float*>du, <float*>dw, <float*>x, batchCount,
 */
        __pyx_v_status = cusparseSgpsvInterleavedBatch(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, __pyx_v_m, ((float *)__pyx_v_ds), ((float *)__pyx_v_dl), ((float *)__pyx_v_d), ((float *)__pyx_v_du), ((float *)__pyx_v_dw), ((float *)__pyx_v_x), __pyx_v_batchCount, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3841
 *                             size_t x, int batchCount, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseSgpsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <float*>ds, <float*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3846
 *             <float*>d, <float*>du, <float*>dw, <float*>x, batchCount,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dgpsvInterleavedBatch(size_t handle, int algo, int m, size_t ds,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3837
 *     return <size_t>pBufferSizeInBytes
 * 
 * cpdef sgpsvInterleavedBatch(size_t handle, int algo, int m, size_t ds,             # <<<<<<<<<<<<<<
 *                             size_t dl, size_t d, size_t du, size_t dw,
 *                             size_t x, int batchCount, size_t pBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_411sgpsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_410sgpsvInterleavedBatch[] = "sgpsvInterleavedBatch(size_t handle, int algo, int m, size_t ds, size_t dl, size_t d, size_t du, size_t dw, size_t x, int batchCount, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_411sgpsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_m;
  size_t __pyx_v_ds;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_dw;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sgpsvInterleavedBatch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_algo,&__pyx_n_s_m,&__pyx_n_s_ds,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_dw,&__pyx_n_s_x,&__pyx_n_s_batchCount,&__pyx_n_s_pBuffer,0};
    PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_algo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch", 1, 11, 11, 1); __PYX_ERR(0, 3837, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch", 1, 11, 11, 2); __PYX_ERR(0, 3837, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ds)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch", 1, 11, 11, 3); __PYX_ERR(0, 3837, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch", 1, 11, 11, 4); __PYX_ERR(0, 3837, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch", 1, 11, 11, 5); __PYX_ERR(0, 3837, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch", 1, 11, 11, 6); __PYX_ERR(0, 3837, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dw)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch", 1, 11, 11, 7); __PYX_ERR(0, 3837, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch", 1, 11, 11, 8); __PYX_ERR(0, 3837, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch", 1, 11, 11, 9); __PYX_ERR(0, 3837, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch", 1, 11, 11, 10); __PYX_ERR(0, 3837, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sgpsvInterleavedBatch") < 0)) __PYX_ERR(0, 3837, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 11) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3837, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3837, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3837, __pyx_L3_error)
    __pyx_v_ds = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_ds == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3837, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3838, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3838, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3838, __pyx_L3_error)
    __pyx_v_dw = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_dw == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3838, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3839, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3839, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3839, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sgpsvInterleavedBatch", 1, 11, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3837, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_410sgpsvInterleavedBatch(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_ds, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_dw, __pyx_v_x, __pyx_v_batchCount, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_410sgpsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sgpsvInterleavedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_sgpsvInterleavedBatch(__pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_ds, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_dw, __pyx_v_x, __pyx_v_batchCount, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.sgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3848
 *     check_status(status)
 * 
 * cpdef dgpsvInterleavedBatch(size_t handle, int algo, int m, size_t ds,             # <<<<<<<<<<<<<<
 *                             size_t dl, size_t d, size_t du, size_t dw,
 *                             size_t x, int batchCount, size_t pBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_413dgpsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dgpsvInterleavedBatch(size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgpsvInterleavedBatch", 0);

  /* "cupy/cuda/cusparse.pyx":3851
 *                             size_t dl, size_t d, size_t du, size_t dw,
 *                             size_t x, int batchCount, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseDgpsvInterleavedBatch(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3852
 *                             size_t x, int batchCount, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgpsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <double*>ds, <double*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3853
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseDgpsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, algo, m, <double*>ds, <double*>dl,
 *             <double*>d, <double*>du, <double*>dw, <double*>x, batchCount,
 */
        __pyx_v_status = cusparseDgpsvInterleavedBatch(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, __pyx_v_m, ((double *)__pyx_v_ds), ((double *)__pyx_v_dl), ((double *)__pyx_v_d), ((double *)__pyx_v_du), ((double *)__pyx_v_dw), ((double *)__pyx_v_x), __pyx_v_batchCount, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3852
 *                             size_t x, int batchCount, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseDgpsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <double*>ds, <double*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3857
 *             <double*>d, <double*>du, <double*>dw, <double*>x, batchCount,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cgpsvInterleavedBatch(size_t handle, int algo, int m, size_t ds,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3848
 *     check_status(status)
 * 
 * cpdef dgpsvInterleavedBatch(size_t handle, int algo, int m, size_t ds,             # <<<<<<<<<<<<<<
 *                             size_t dl, size_t d, size_t du, size_t dw,
 *                             size_t x, int batchCount, size_t pBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_413dgpsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_412dgpsvInterleavedBatch[] = "dgpsvInterleavedBatch(size_t handle, int algo, int m, size_t ds, size_t dl, size_t d, size_t du, size_t dw, size_t x, int batchCount, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_413dgpsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_m;
  size_t __pyx_v_ds;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_dw;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dgpsvInterleavedBatch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_algo,&__pyx_n_s_m,&__pyx_n_s_ds,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_dw,&__pyx_n_s_x,&__pyx_n_s_batchCount,&__pyx_n_s_pBuffer,0};
    PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_algo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch", 1, 11, 11, 1); __PYX_ERR(0, 3848, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch", 1, 11, 11, 2); __PYX_ERR(0, 3848, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ds)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch", 1, 11, 11, 3); __PYX_ERR(0, 3848, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch", 1, 11, 11, 4); __PYX_ERR(0, 3848, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch", 1, 11, 11, 5); __PYX_ERR(0, 3848, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch", 1, 11, 11, 6); __PYX_ERR(0, 3848, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dw)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch", 1, 11, 11, 7); __PYX_ERR(0, 3848, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch", 1, 11, 11, 8); __PYX_ERR(0, 3848, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch", 1, 11, 11, 9); __PYX_ERR(0, 3848, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch", 1, 11, 11, 10); __PYX_ERR(0, 3848, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dgpsvInterleavedBatch") < 0)) __PYX_ERR(0, 3848, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 11) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3848, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3848, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3848, __pyx_L3_error)
    __pyx_v_ds = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_ds == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3848, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3849, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3849, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3849, __pyx_L3_error)
    __pyx_v_dw = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_dw == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3849, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3850, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3850, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3850, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dgpsvInterleavedBatch", 1, 11, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3848, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_412dgpsvInterleavedBatch(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_ds, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_dw, __pyx_v_x, __pyx_v_batchCount, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_412dgpsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dgpsvInterleavedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dgpsvInterleavedBatch(__pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_ds, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_dw, __pyx_v_x, __pyx_v_batchCount, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3859
 *     check_status(status)
 * 
 * cpdef cgpsvInterleavedBatch(size_t handle, int algo, int m, size_t ds,             # <<<<<<<<<<<<<<
 *                             size_t dl, size_t d, size_t du, size_t dw,
 *                             size_t x, int batchCount, size_t pBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_415cgpsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cgpsvInterleavedBatch(size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgpsvInterleavedBatch", 0);

  /* "cupy/cuda/cusparse.pyx":3862
 *                             size_t dl, size_t d, size_t du, size_t dw,
 *                             size_t x, int batchCount, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseCgpsvInterleavedBatch(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3863
 *                             size_t x, int batchCount, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgpsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <cuComplex*>ds, <cuComplex*>dl,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3864
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseCgpsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, algo, m, <cuComplex*>ds, <cuComplex*>dl,
 *             <cuComplex*>d, <cuComplex*>du, <cuComplex*>dw, <cuComplex*>x,
 */
        __pyx_v_status = cusparseCgpsvInterleavedBatch(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, __pyx_v_m, ((cuComplex *)__pyx_v_ds), ((cuComplex *)__pyx_v_dl), ((cuComplex *)__pyx_v_d), ((cuComplex *)__pyx_v_du), ((cuComplex *)__pyx_v_dw), ((cuComplex *)__pyx_v_x), __pyx_v_batchCount, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3863
 *                             size_t x, int batchCount, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseCgpsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <cuComplex*>ds, <cuComplex*>dl,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3868
 *             <cuComplex*>d, <cuComplex*>du, <cuComplex*>dw, <cuComplex*>x,
 *             batchCount, <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef zgpsvInterleavedBatch(size_t handle, int algo, int m, size_t ds,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3859
 *     check_status(status)
 * 
 * cpdef cgpsvInterleavedBatch(size_t handle, int algo, int m, size_t ds,             # <<<<<<<<<<<<<<
 *                             size_t dl, size_t d, size_t du, size_t dw,
 *                             size_t x, int batchCount, size_t pBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_415cgpsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_414cgpsvInterleavedBatch[] = "cgpsvInterleavedBatch(size_t handle, int algo, int m, size_t ds, size_t dl, size_t d, size_t du, size_t dw, size_t x, int batchCount, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_415cgpsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_m;
  size_t __pyx_v_ds;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_dw;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cgpsvInterleavedBatch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_algo,&__pyx_n_s_m,&__pyx_n_s_ds,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_dw,&__pyx_n_s_x,&__pyx_n_s_batchCount,&__pyx_n_s_pBuffer,0};
    PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_algo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch", 1, 11, 11, 1); __PYX_ERR(0, 3859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch", 1, 11, 11, 2); __PYX_ERR(0, 3859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ds)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch", 1, 11, 11, 3); __PYX_ERR(0, 3859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch", 1, 11, 11, 4); __PYX_ERR(0, 3859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch", 1, 11, 11, 5); __PYX_ERR(0, 3859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch", 1, 11, 11, 6); __PYX_ERR(0, 3859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dw)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch", 1, 11, 11, 7); __PYX_ERR(0, 3859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch", 1, 11, 11, 8); __PYX_ERR(0, 3859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch", 1, 11, 11, 9); __PYX_ERR(0, 3859, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch", 1, 11, 11, 10); __PYX_ERR(0, 3859, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cgpsvInterleavedBatch") < 0)) __PYX_ERR(0, 3859, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 11) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3859, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3859, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3859, __pyx_L3_error)
    __pyx_v_ds = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_ds == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3859, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3860, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3860, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3860, __pyx_L3_error)
    __pyx_v_dw = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_dw == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3860, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cgpsvInterleavedBatch", 1, 11, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3859, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_414cgpsvInterleavedBatch(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_ds, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_dw, __pyx_v_x, __pyx_v_batchCount, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_414cgpsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cgpsvInterleavedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cgpsvInterleavedBatch(__pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_ds, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_dw, __pyx_v_x, __pyx_v_batchCount, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3870
 *     check_status(status)
 * 
 * cpdef zgpsvInterleavedBatch(size_t handle, int algo, int m, size_t ds,             # <<<<<<<<<<<<<<
 *                             size_t dl, size_t d, size_t du, size_t dw,
 *                             size_t x, int batchCount, size_t pBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_417zgpsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_zgpsvInterleavedBatch(size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgpsvInterleavedBatch", 0);

  /* "cupy/cuda/cusparse.pyx":3873
 *                             size_t dl, size_t d, size_t du, size_t dw,
 *                             size_t x, int batchCount, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     with nogil:
 *         status = cusparseZgpsvInterleavedBatch(
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3874
 *                             size_t x, int batchCount, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgpsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <cuDoubleComplex*>ds,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "cupy/cuda/cusparse.pyx":3875
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:
 *         status = cusparseZgpsvInterleavedBatch(             # <<<<<<<<<<<<<<
 *             <cusparseHandle_t>handle, algo, m, <cuDoubleComplex*>ds,
 *             <cuDoubleComplex*>dl, <cuDoubleComplex*>d, <cuDoubleComplex*>du,
 */
        __pyx_v_status = cusparseZgpsvInterleavedBatch(((cusparseHandle_t)__pyx_v_handle), __pyx_v_algo, __pyx_v_m, ((cuDoubleComplex *)__pyx_v_ds), ((cuDoubleComplex *)__pyx_v_dl), ((cuDoubleComplex *)__pyx_v_d), ((cuDoubleComplex *)__pyx_v_du), ((cuDoubleComplex *)__pyx_v_dw), ((cuDoubleComplex *)__pyx_v_x), __pyx_v_batchCount, ((void *)__pyx_v_pBuffer));
      }

      /* "cupy/cuda/cusparse.pyx":3874
 *                             size_t x, int batchCount, size_t pBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     with nogil:             # <<<<<<<<<<<<<<
 *         status = cusparseZgpsvInterleavedBatch(
 *             <cusparseHandle_t>handle, algo, m, <cuDoubleComplex*>ds,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "cupy/cuda/cusparse.pyx":3880
 *             <cuDoubleComplex*>dw, <cuDoubleComplex*>x, batchCount,
 *             <void*>pBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ############################################################
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3870
 *     check_status(status)
 * 
 * cpdef zgpsvInterleavedBatch(size_t handle, int algo, int m, size_t ds,             # <<<<<<<<<<<<<<
 *                             size_t dl, size_t d, size_t du, size_t dw,
 *                             size_t x, int batchCount, size_t pBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_417zgpsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_416zgpsvInterleavedBatch[] = "zgpsvInterleavedBatch(size_t handle, int algo, int m, size_t ds, size_t dl, size_t d, size_t du, size_t dw, size_t x, int batchCount, size_t pBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_417zgpsvInterleavedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_handle;
  int __pyx_v_algo;
  int __pyx_v_m;
  size_t __pyx_v_ds;
  size_t __pyx_v_dl;
  size_t __pyx_v_d;
  size_t __pyx_v_du;
  size_t __pyx_v_dw;
  size_t __pyx_v_x;
  int __pyx_v_batchCount;
  size_t __pyx_v_pBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zgpsvInterleavedBatch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_algo,&__pyx_n_s_m,&__pyx_n_s_ds,&__pyx_n_s_dl,&__pyx_n_s_d,&__pyx_n_s_du,&__pyx_n_s_dw,&__pyx_n_s_x,&__pyx_n_s_batchCount,&__pyx_n_s_pBuffer,0};
    PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_algo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch", 1, 11, 11, 1); __PYX_ERR(0, 3870, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch", 1, 11, 11, 2); __PYX_ERR(0, 3870, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ds)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch", 1, 11, 11, 3); __PYX_ERR(0, 3870, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch", 1, 11, 11, 4); __PYX_ERR(0, 3870, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch", 1, 11, 11, 5); __PYX_ERR(0, 3870, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_du)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch", 1, 11, 11, 6); __PYX_ERR(0, 3870, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dw)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch", 1, 11, 11, 7); __PYX_ERR(0, 3870, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch", 1, 11, 11, 8); __PYX_ERR(0, 3870, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch", 1, 11, 11, 9); __PYX_ERR(0, 3870, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch", 1, 11, 11, 10); __PYX_ERR(0, 3870, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zgpsvInterleavedBatch") < 0)) __PYX_ERR(0, 3870, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 11) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
    }
    __pyx_v_handle = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_handle == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3870, __pyx_L3_error)
    __pyx_v_algo = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_algo == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3870, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3870, __pyx_L3_error)
    __pyx_v_ds = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_ds == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3870, __pyx_L3_error)
    __pyx_v_dl = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_dl == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3871, __pyx_L3_error)
    __pyx_v_d = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_d == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3871, __pyx_L3_error)
    __pyx_v_du = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_du == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3871, __pyx_L3_error)
    __pyx_v_dw = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_dw == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3871, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_size_t(values[8]); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3872, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3872, __pyx_L3_error)
    __pyx_v_pBuffer = __Pyx_PyInt_As_size_t(values[10]); if (unlikely((__pyx_v_pBuffer == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3872, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zgpsvInterleavedBatch", 1, 11, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3870, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_416zgpsvInterleavedBatch(__pyx_self, __pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_ds, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_dw, __pyx_v_x, __pyx_v_batchCount, __pyx_v_pBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_416zgpsvInterleavedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_handle, int __pyx_v_algo, int __pyx_v_m, size_t __pyx_v_ds, size_t __pyx_v_dl, size_t __pyx_v_d, size_t __pyx_v_du, size_t __pyx_v_dw, size_t __pyx_v_x, int __pyx_v_batchCount, size_t __pyx_v_pBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zgpsvInterleavedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_zgpsvInterleavedBatch(__pyx_v_handle, __pyx_v_algo, __pyx_v_m, __pyx_v_ds, __pyx_v_dl, __pyx_v_d, __pyx_v_du, __pyx_v_dw, __pyx_v_x, __pyx_v_batchCount, __pyx_v_pBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.zgpsvInterleavedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3885
 * # Sparse Vector APIs
 * 
 * cpdef size_t createSpVec(int64_t size, int64_t nnz, intptr_t indices,             # <<<<<<<<<<<<<<
 *                          intptr_t values, IndexType idxType, IndexBase idxBase,
 *                          DataType valueType) except? 0:
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_419createSpVec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createSpVec(int64_t __pyx_v_size, int64_t __pyx_v_nnz, intptr_t __pyx_v_indices, intptr_t __pyx_v_values, cusparseIndexType_t __pyx_v_idxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseSpVecDescr_t __pyx_v_desc;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createSpVec", 0);

  /* "cupy/cuda/cusparse.pyx":3889
 *                          DataType valueType) except? 0:
 *     cdef SpVecDescr desc
 *     status = cusparseCreateSpVec(&desc, size, nnz, <void*>indices,             # <<<<<<<<<<<<<<
 *                                  <void*>values, idxType, idxBase, valueType)
 *     check_status(status)
 */
  __pyx_v_status = cusparseCreateSpVec((&__pyx_v_desc), __pyx_v_size, __pyx_v_nnz, ((void *)__pyx_v_indices), ((void *)__pyx_v_values), __pyx_v_idxType, __pyx_v_idxBase, __pyx_v_valueType);

  /* "cupy/cuda/cusparse.pyx":3891
 *     status = cusparseCreateSpVec(&desc, size, nnz, <void*>indices,
 *                                  <void*>values, idxType, idxBase, valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>desc
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3892
 *                                  <void*>values, idxType, idxBase, valueType)
 *     check_status(status)
 *     return <size_t>desc             # <<<<<<<<<<<<<<
 * 
 * cpdef destroySpVec(size_t desc):
 */
  __pyx_r = ((size_t)__pyx_v_desc);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3885
 * # Sparse Vector APIs
 * 
 * cpdef size_t createSpVec(int64_t size, int64_t nnz, intptr_t indices,             # <<<<<<<<<<<<<<
 *                          intptr_t values, IndexType idxType, IndexBase idxBase,
 *                          DataType valueType) except? 0:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.createSpVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_419createSpVec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_418createSpVec[] = "createSpVec(int64_t size, int64_t nnz, intptr_t indices, intptr_t values, IndexType idxType, IndexBase idxBase, DataType valueType) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_419createSpVec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_size;
  int64_t __pyx_v_nnz;
  intptr_t __pyx_v_indices;
  intptr_t __pyx_v_values;
  cusparseIndexType_t __pyx_v_idxType;
  cusparseIndexBase_t __pyx_v_idxBase;
  cudaDataType __pyx_v_valueType;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createSpVec (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_nnz,&__pyx_n_s_indices,&__pyx_n_s_values,&__pyx_n_s_idxType,&__pyx_n_s_idxBase,&__pyx_n_s_valueType,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createSpVec", 1, 7, 7, 1); __PYX_ERR(0, 3885, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createSpVec", 1, 7, 7, 2); __PYX_ERR(0, 3885, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createSpVec", 1, 7, 7, 3); __PYX_ERR(0, 3885, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createSpVec", 1, 7, 7, 4); __PYX_ERR(0, 3885, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createSpVec", 1, 7, 7, 5); __PYX_ERR(0, 3885, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_valueType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createSpVec", 1, 7, 7, 6); __PYX_ERR(0, 3885, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSpVec") < 0)) __PYX_ERR(0, 3885, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_size = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_size == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3885, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3885, __pyx_L3_error)
    __pyx_v_indices = PyInt_AsSsize_t(values[2]); if (unlikely((__pyx_v_indices == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3885, __pyx_L3_error)
    __pyx_v_values = PyInt_AsSsize_t(values[3]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3886, __pyx_L3_error)
    __pyx_v_idxType = __Pyx_PyInt_As_cusparseIndexType_t(values[4]); if (unlikely((__pyx_v_idxType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3886, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_cusparseIndexBase_t(values[5]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3886, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyInt_As_cudaDataType(values[6]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3887, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createSpVec", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3885, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.createSpVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_418createSpVec(__pyx_self, __pyx_v_size, __pyx_v_nnz, __pyx_v_indices, __pyx_v_values, __pyx_v_idxType, __pyx_v_idxBase, __pyx_v_valueType);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_418createSpVec(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_size, int64_t __pyx_v_nnz, intptr_t __pyx_v_indices, intptr_t __pyx_v_values, cusparseIndexType_t __pyx_v_idxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createSpVec", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_createSpVec(__pyx_v_size, __pyx_v_nnz, __pyx_v_indices, __pyx_v_values, __pyx_v_idxType, __pyx_v_idxBase, __pyx_v_valueType, 0); if (unlikely(__pyx_t_1 == ((size_t)0) && PyErr_Occurred())) __PYX_ERR(0, 3885, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy.cuda.cusparse.createSpVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3894
 *     return <size_t>desc
 * 
 * cpdef destroySpVec(size_t desc):             # <<<<<<<<<<<<<<
 *     status = cusparseDestroySpVec(<SpVecDescr>desc)
 *     check_status(status)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_421destroySpVec(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroySpVec(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroySpVec", 0);

  /* "cupy/cuda/cusparse.pyx":3895
 * 
 * cpdef destroySpVec(size_t desc):
 *     status = cusparseDestroySpVec(<SpVecDescr>desc)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
  __pyx_v_status = cusparseDestroySpVec(((cusparseSpVecDescr_t)__pyx_v_desc));

  /* "cupy/cuda/cusparse.pyx":3896
 * cpdef destroySpVec(size_t desc):
 *     status = cusparseDestroySpVec(<SpVecDescr>desc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef SpVecAttributes spVecGet(size_t desc):
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3894
 *     return <size_t>desc
 * 
 * cpdef destroySpVec(size_t desc):             # <<<<<<<<<<<<<<
 *     status = cusparseDestroySpVec(<SpVecDescr>desc)
 *     check_status(status)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroySpVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_421destroySpVec(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_420destroySpVec[] = "destroySpVec(size_t desc)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_421destroySpVec(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroySpVec (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3894, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroySpVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_420destroySpVec(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_420destroySpVec(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroySpVec", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_destroySpVec(__pyx_v_desc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroySpVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3898
 *     check_status(status)
 * 
 * cpdef SpVecAttributes spVecGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t size, nnz
 *     cdef intptr_t indices, values
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_423spVecGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_f_4cupy_4cuda_8cusparse_spVecGet(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int64_t __pyx_v_size;
  int64_t __pyx_v_nnz;
  intptr_t __pyx_v_indices;
  intptr_t __pyx_v_values;
  cusparseIndexType_t __pyx_v_idxType;
  cusparseIndexBase_t __pyx_v_idxBase;
  cudaDataType __pyx_v_valueType;
  cusparseStatus_t __pyx_v_status;
  struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spVecGet", 0);

  /* "cupy/cuda/cusparse.pyx":3904
 *     cdef IndexBase idxBase
 *     cdef DataType valueType
 *     status = cusparseSpVecGet(<SpVecDescr>desc, &size, &nnz,             # <<<<<<<<<<<<<<
 *                               <void**>&indices, <void**>&values,
 *                               &idxType, &idxBase, &valueType)
 */
  __pyx_v_status = cusparseSpVecGet(((cusparseSpVecDescr_t)__pyx_v_desc), (&__pyx_v_size), (&__pyx_v_nnz), ((void **)(&__pyx_v_indices)), ((void **)(&__pyx_v_values)), (&__pyx_v_idxType), (&__pyx_v_idxBase), (&__pyx_v_valueType));

  /* "cupy/cuda/cusparse.pyx":3907
 *                               <void**>&indices, <void**>&values,
 *                               &idxType, &idxBase, &valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return SpVecAttributes(size, nnz, indices, values, idxType, idxBase,
 *                            valueType)
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3908
 *                               &idxType, &idxBase, &valueType)
 *     check_status(status)
 *     return SpVecAttributes(size, nnz, indices, values, idxType, idxBase,             # <<<<<<<<<<<<<<
 *                            valueType)
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_nnz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_cusparseIndexType_t(__pyx_v_idxType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_From_cusparseIndexBase_t(__pyx_v_idxBase); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cupy/cuda/cusparse.pyx":3909
 *     check_status(status)
 *     return SpVecAttributes(size, nnz, indices, values, idxType, idxBase,
 *                            valueType)             # <<<<<<<<<<<<<<
 * 
 * cpdef int spVecGetIndexBase(size_t desc):
 */
  __pyx_t_7 = __Pyx_PyInt_From_cudaDataType(__pyx_v_valueType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "cupy/cuda/cusparse.pyx":3908
 *                               &idxType, &idxBase, &valueType)
 *     check_status(status)
 *     return SpVecAttributes(size, nnz, indices, values, idxType, idxBase,             # <<<<<<<<<<<<<<
 *                            valueType)
 * 
 */
  __pyx_t_8 = PyTuple_New(7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_7);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4cupy_4cuda_8cusparse_SpVecAttributes), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_r = ((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_t_7);
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3898
 *     check_status(status)
 * 
 * cpdef SpVecAttributes spVecGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t size, nnz
 *     cdef intptr_t indices, values
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spVecGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_423spVecGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_422spVecGet[] = "spVecGet(size_t desc) -> SpVecAttributes";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_423spVecGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spVecGet (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3898, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.spVecGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_422spVecGet(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_422spVecGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spVecGet", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4cupy_4cuda_8cusparse_spVecGet(__pyx_v_desc, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spVecGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3911
 *                            valueType)
 * 
 * cpdef int spVecGetIndexBase(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef IndexBase idxBase
 *     status = cusparseSpVecGetIndexBase(<SpVecDescr>desc, &idxBase)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_425spVecGetIndexBase(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_spVecGetIndexBase(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseIndexBase_t __pyx_v_idxBase;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spVecGetIndexBase", 0);

  /* "cupy/cuda/cusparse.pyx":3913
 * cpdef int spVecGetIndexBase(size_t desc):
 *     cdef IndexBase idxBase
 *     status = cusparseSpVecGetIndexBase(<SpVecDescr>desc, &idxBase)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <int>idxBase
 */
  __pyx_v_status = cusparseSpVecGetIndexBase(((cusparseSpVecDescr_t)__pyx_v_desc), (&__pyx_v_idxBase));

  /* "cupy/cuda/cusparse.pyx":3914
 *     cdef IndexBase idxBase
 *     status = cusparseSpVecGetIndexBase(<SpVecDescr>desc, &idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>idxBase
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3915
 *     status = cusparseSpVecGetIndexBase(<SpVecDescr>desc, &idxBase)
 *     check_status(status)
 *     return <int>idxBase             # <<<<<<<<<<<<<<
 * 
 * cpdef intptr_t spVecGetValues(size_t desc):
 */
  __pyx_r = ((int)__pyx_v_idxBase);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3911
 *                            valueType)
 * 
 * cpdef int spVecGetIndexBase(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef IndexBase idxBase
 *     status = cusparseSpVecGetIndexBase(<SpVecDescr>desc, &idxBase)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.spVecGetIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_425spVecGetIndexBase(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_424spVecGetIndexBase[] = "spVecGetIndexBase(size_t desc) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_425spVecGetIndexBase(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spVecGetIndexBase (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3911, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.spVecGetIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_424spVecGetIndexBase(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_424spVecGetIndexBase(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spVecGetIndexBase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_spVecGetIndexBase(__pyx_v_desc, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spVecGetIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3917
 *     return <int>idxBase
 * 
 * cpdef intptr_t spVecGetValues(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef intptr_t values
 *     status = cusparseSpVecGetValues(<SpVecDescr>desc, <void**>&values)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_427spVecGetValues(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static intptr_t __pyx_f_4cupy_4cuda_8cusparse_spVecGetValues(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  intptr_t __pyx_v_values;
  cusparseStatus_t __pyx_v_status;
  intptr_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spVecGetValues", 0);

  /* "cupy/cuda/cusparse.pyx":3919
 * cpdef intptr_t spVecGetValues(size_t desc):
 *     cdef intptr_t values
 *     status = cusparseSpVecGetValues(<SpVecDescr>desc, <void**>&values)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return values
 */
  __pyx_v_status = cusparseSpVecGetValues(((cusparseSpVecDescr_t)__pyx_v_desc), ((void **)(&__pyx_v_values)));

  /* "cupy/cuda/cusparse.pyx":3920
 *     cdef intptr_t values
 *     status = cusparseSpVecGetValues(<SpVecDescr>desc, <void**>&values)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return values
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3921
 *     status = cusparseSpVecGetValues(<SpVecDescr>desc, <void**>&values)
 *     check_status(status)
 *     return values             # <<<<<<<<<<<<<<
 * 
 * cpdef spVecSetValues(size_t desc, intptr_t values):
 */
  __pyx_r = __pyx_v_values;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3917
 *     return <int>idxBase
 * 
 * cpdef intptr_t spVecGetValues(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef intptr_t values
 *     status = cusparseSpVecGetValues(<SpVecDescr>desc, <void**>&values)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.spVecGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_427spVecGetValues(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_426spVecGetValues[] = "spVecGetValues(size_t desc) -> intptr_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_427spVecGetValues(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spVecGetValues (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3917, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.spVecGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_426spVecGetValues(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_426spVecGetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spVecGetValues", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_f_4cupy_4cuda_8cusparse_spVecGetValues(__pyx_v_desc, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spVecGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3923
 *     return values
 * 
 * cpdef spVecSetValues(size_t desc, intptr_t values):             # <<<<<<<<<<<<<<
 *     status = cusparseSpVecSetValues(<SpVecDescr>desc, <void*>values)
 *     check_status(status)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_429spVecSetValues(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_spVecSetValues(size_t __pyx_v_desc, intptr_t __pyx_v_values, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spVecSetValues", 0);

  /* "cupy/cuda/cusparse.pyx":3924
 * 
 * cpdef spVecSetValues(size_t desc, intptr_t values):
 *     status = cusparseSpVecSetValues(<SpVecDescr>desc, <void*>values)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
  __pyx_v_status = cusparseSpVecSetValues(((cusparseSpVecDescr_t)__pyx_v_desc), ((void *)__pyx_v_values));

  /* "cupy/cuda/cusparse.pyx":3925
 * cpdef spVecSetValues(size_t desc, intptr_t values):
 *     status = cusparseSpVecSetValues(<SpVecDescr>desc, <void*>values)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ############################################################
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3923
 *     return values
 * 
 * cpdef spVecSetValues(size_t desc, intptr_t values):             # <<<<<<<<<<<<<<
 *     status = cusparseSpVecSetValues(<SpVecDescr>desc, <void*>values)
 *     check_status(status)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spVecSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_429spVecSetValues(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_428spVecSetValues[] = "spVecSetValues(size_t desc, intptr_t values)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_429spVecSetValues(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_desc;
  intptr_t __pyx_v_values;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spVecSetValues (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_desc,&__pyx_n_s_values,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_desc)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spVecSetValues", 1, 2, 2, 1); __PYX_ERR(0, 3923, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "spVecSetValues") < 0)) __PYX_ERR(0, 3923, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_desc = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3923, __pyx_L3_error)
    __pyx_v_values = PyInt_AsSsize_t(values[1]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3923, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spVecSetValues", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3923, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.spVecSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_428spVecSetValues(__pyx_self, __pyx_v_desc, __pyx_v_values);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_428spVecSetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, intptr_t __pyx_v_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spVecSetValues", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_spVecSetValues(__pyx_v_desc, __pyx_v_values, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spVecSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3930
 * # Sparse Matrix APIs
 * 
 * cpdef size_t createCoo(int64_t rows, int64_t cols, int64_t nnz,             # <<<<<<<<<<<<<<
 *                        intptr_t cooRowInd, intptr_t cooColInd,
 *                        intptr_t cooValues, IndexType cooIdxType,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_431createCoo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createCoo(int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_cooRowInd, intptr_t __pyx_v_cooColInd, intptr_t __pyx_v_cooValues, cusparseIndexType_t __pyx_v_cooIdxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseSpMatDescr_t __pyx_v_desc;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createCoo", 0);

  /* "cupy/cuda/cusparse.pyx":3935
 *                        IndexBase idxBase, DataType valueType):
 *     cdef SpMatDescr desc
 *     status = cusparseCreateCoo(&desc, rows, cols, nnz, <void*>cooRowInd,             # <<<<<<<<<<<<<<
 *                                <void*>cooColInd, <void*>cooValues,
 *                                cooIdxType, idxBase, valueType)
 */
  __pyx_v_status = cusparseCreateCoo((&__pyx_v_desc), __pyx_v_rows, __pyx_v_cols, __pyx_v_nnz, ((void *)__pyx_v_cooRowInd), ((void *)__pyx_v_cooColInd), ((void *)__pyx_v_cooValues), __pyx_v_cooIdxType, __pyx_v_idxBase, __pyx_v_valueType);

  /* "cupy/cuda/cusparse.pyx":3938
 *                                <void*>cooColInd, <void*>cooValues,
 *                                cooIdxType, idxBase, valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>desc
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3939
 *                                cooIdxType, idxBase, valueType)
 *     check_status(status)
 *     return <size_t>desc             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t createCooAoS(int64_t rows, int64_t cols, int64_t nnz,
 */
  __pyx_r = ((size_t)__pyx_v_desc);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3930
 * # Sparse Matrix APIs
 * 
 * cpdef size_t createCoo(int64_t rows, int64_t cols, int64_t nnz,             # <<<<<<<<<<<<<<
 *                        intptr_t cooRowInd, intptr_t cooColInd,
 *                        intptr_t cooValues, IndexType cooIdxType,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.createCoo", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_431createCoo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_430createCoo[] = "createCoo(int64_t rows, int64_t cols, int64_t nnz, intptr_t cooRowInd, intptr_t cooColInd, intptr_t cooValues, IndexType cooIdxType, IndexBase idxBase, DataType valueType) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_431createCoo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_rows;
  int64_t __pyx_v_cols;
  int64_t __pyx_v_nnz;
  intptr_t __pyx_v_cooRowInd;
  intptr_t __pyx_v_cooColInd;
  intptr_t __pyx_v_cooValues;
  cusparseIndexType_t __pyx_v_cooIdxType;
  cusparseIndexBase_t __pyx_v_idxBase;
  cudaDataType __pyx_v_valueType;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createCoo (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_nnz,&__pyx_n_s_cooRowInd,&__pyx_n_s_cooColInd,&__pyx_n_s_cooValues,&__pyx_n_s_cooIdxType,&__pyx_n_s_idxBase,&__pyx_n_s_valueType,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCoo", 1, 9, 9, 1); __PYX_ERR(0, 3930, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCoo", 1, 9, 9, 2); __PYX_ERR(0, 3930, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cooRowInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCoo", 1, 9, 9, 3); __PYX_ERR(0, 3930, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cooColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCoo", 1, 9, 9, 4); __PYX_ERR(0, 3930, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cooValues)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCoo", 1, 9, 9, 5); __PYX_ERR(0, 3930, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cooIdxType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCoo", 1, 9, 9, 6); __PYX_ERR(0, 3930, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCoo", 1, 9, 9, 7); __PYX_ERR(0, 3930, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_valueType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCoo", 1, 9, 9, 8); __PYX_ERR(0, 3930, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createCoo") < 0)) __PYX_ERR(0, 3930, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_rows = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3930, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3930, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3930, __pyx_L3_error)
    __pyx_v_cooRowInd = PyInt_AsSsize_t(values[3]); if (unlikely((__pyx_v_cooRowInd == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3931, __pyx_L3_error)
    __pyx_v_cooColInd = PyInt_AsSsize_t(values[4]); if (unlikely((__pyx_v_cooColInd == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3931, __pyx_L3_error)
    __pyx_v_cooValues = PyInt_AsSsize_t(values[5]); if (unlikely((__pyx_v_cooValues == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3932, __pyx_L3_error)
    __pyx_v_cooIdxType = __Pyx_PyInt_As_cusparseIndexType_t(values[6]); if (unlikely((__pyx_v_cooIdxType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3932, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_cusparseIndexBase_t(values[7]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3933, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyInt_As_cudaDataType(values[8]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3933, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createCoo", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3930, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.createCoo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_430createCoo(__pyx_self, __pyx_v_rows, __pyx_v_cols, __pyx_v_nnz, __pyx_v_cooRowInd, __pyx_v_cooColInd, __pyx_v_cooValues, __pyx_v_cooIdxType, __pyx_v_idxBase, __pyx_v_valueType);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_430createCoo(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_cooRowInd, intptr_t __pyx_v_cooColInd, intptr_t __pyx_v_cooValues, cusparseIndexType_t __pyx_v_cooIdxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createCoo", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_createCoo(__pyx_v_rows, __pyx_v_cols, __pyx_v_nnz, __pyx_v_cooRowInd, __pyx_v_cooColInd, __pyx_v_cooValues, __pyx_v_cooIdxType, __pyx_v_idxBase, __pyx_v_valueType, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.createCoo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3941
 *     return <size_t>desc
 * 
 * cpdef size_t createCooAoS(int64_t rows, int64_t cols, int64_t nnz,             # <<<<<<<<<<<<<<
 *                           intptr_t cooInd, intptr_t cooValues,
 *                           IndexType cooIdxType, IndexBase idxBase,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_433createCooAoS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createCooAoS(int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_cooInd, intptr_t __pyx_v_cooValues, cusparseIndexType_t __pyx_v_cooIdxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseSpMatDescr_t __pyx_v_desc;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createCooAoS", 0);

  /* "cupy/cuda/cusparse.pyx":3946
 *                           DataType valueType):
 *     cdef SpMatDescr desc
 *     status = cusparseCreateCooAoS(&desc, rows, cols, nnz, <void*>cooInd,             # <<<<<<<<<<<<<<
 *                                   <void*>cooValues, cooIdxType, idxBase,
 *                                   valueType)
 */
  __pyx_v_status = cusparseCreateCooAoS((&__pyx_v_desc), __pyx_v_rows, __pyx_v_cols, __pyx_v_nnz, ((void *)__pyx_v_cooInd), ((void *)__pyx_v_cooValues), __pyx_v_cooIdxType, __pyx_v_idxBase, __pyx_v_valueType);

  /* "cupy/cuda/cusparse.pyx":3949
 *                                   <void*>cooValues, cooIdxType, idxBase,
 *                                   valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>desc
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3950
 *                                   valueType)
 *     check_status(status)
 *     return <size_t>desc             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t createCsr(int64_t rows, int64_t cols, int64_t nnz,
 */
  __pyx_r = ((size_t)__pyx_v_desc);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3941
 *     return <size_t>desc
 * 
 * cpdef size_t createCooAoS(int64_t rows, int64_t cols, int64_t nnz,             # <<<<<<<<<<<<<<
 *                           intptr_t cooInd, intptr_t cooValues,
 *                           IndexType cooIdxType, IndexBase idxBase,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.createCooAoS", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_433createCooAoS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_432createCooAoS[] = "createCooAoS(int64_t rows, int64_t cols, int64_t nnz, intptr_t cooInd, intptr_t cooValues, IndexType cooIdxType, IndexBase idxBase, DataType valueType) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_433createCooAoS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_rows;
  int64_t __pyx_v_cols;
  int64_t __pyx_v_nnz;
  intptr_t __pyx_v_cooInd;
  intptr_t __pyx_v_cooValues;
  cusparseIndexType_t __pyx_v_cooIdxType;
  cusparseIndexBase_t __pyx_v_idxBase;
  cudaDataType __pyx_v_valueType;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createCooAoS (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_nnz,&__pyx_n_s_cooInd,&__pyx_n_s_cooValues,&__pyx_n_s_cooIdxType,&__pyx_n_s_idxBase,&__pyx_n_s_valueType,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCooAoS", 1, 8, 8, 1); __PYX_ERR(0, 3941, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCooAoS", 1, 8, 8, 2); __PYX_ERR(0, 3941, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cooInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCooAoS", 1, 8, 8, 3); __PYX_ERR(0, 3941, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cooValues)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCooAoS", 1, 8, 8, 4); __PYX_ERR(0, 3941, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cooIdxType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCooAoS", 1, 8, 8, 5); __PYX_ERR(0, 3941, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCooAoS", 1, 8, 8, 6); __PYX_ERR(0, 3941, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_valueType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCooAoS", 1, 8, 8, 7); __PYX_ERR(0, 3941, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createCooAoS") < 0)) __PYX_ERR(0, 3941, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_rows = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3941, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3941, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3941, __pyx_L3_error)
    __pyx_v_cooInd = PyInt_AsSsize_t(values[3]); if (unlikely((__pyx_v_cooInd == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3942, __pyx_L3_error)
    __pyx_v_cooValues = PyInt_AsSsize_t(values[4]); if (unlikely((__pyx_v_cooValues == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3942, __pyx_L3_error)
    __pyx_v_cooIdxType = __Pyx_PyInt_As_cusparseIndexType_t(values[5]); if (unlikely((__pyx_v_cooIdxType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3943, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_cusparseIndexBase_t(values[6]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3943, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyInt_As_cudaDataType(values[7]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3944, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createCooAoS", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3941, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.createCooAoS", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_432createCooAoS(__pyx_self, __pyx_v_rows, __pyx_v_cols, __pyx_v_nnz, __pyx_v_cooInd, __pyx_v_cooValues, __pyx_v_cooIdxType, __pyx_v_idxBase, __pyx_v_valueType);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_432createCooAoS(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_cooInd, intptr_t __pyx_v_cooValues, cusparseIndexType_t __pyx_v_cooIdxType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createCooAoS", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_createCooAoS(__pyx_v_rows, __pyx_v_cols, __pyx_v_nnz, __pyx_v_cooInd, __pyx_v_cooValues, __pyx_v_cooIdxType, __pyx_v_idxBase, __pyx_v_valueType, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.createCooAoS", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3952
 *     return <size_t>desc
 * 
 * cpdef size_t createCsr(int64_t rows, int64_t cols, int64_t nnz,             # <<<<<<<<<<<<<<
 *                        intptr_t csrRowOffsets, intptr_t csrColind,
 *                        intptr_t csrValues, IndexType csrRowOffsetsType,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_435createCsr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createCsr(int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_csrRowOffsets, intptr_t __pyx_v_csrColind, intptr_t __pyx_v_csrValues, cusparseIndexType_t __pyx_v_csrRowOffsetsType, cusparseIndexType_t __pyx_v_csrColIndType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseSpMatDescr_t __pyx_v_desc;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createCsr", 0);

  /* "cupy/cuda/cusparse.pyx":3958
 *                        DataType valueType):
 *     cdef SpMatDescr desc
 *     status = cusparseCreateCsr(&desc, rows, cols, nnz,             # <<<<<<<<<<<<<<
 *                                <void*>csrRowOffsets, <void*>csrColind,
 *                                <void*>csrValues, csrRowOffsetsType,
 */
  __pyx_v_status = cusparseCreateCsr((&__pyx_v_desc), __pyx_v_rows, __pyx_v_cols, __pyx_v_nnz, ((void *)__pyx_v_csrRowOffsets), ((void *)__pyx_v_csrColind), ((void *)__pyx_v_csrValues), __pyx_v_csrRowOffsetsType, __pyx_v_csrColIndType, __pyx_v_idxBase, __pyx_v_valueType);

  /* "cupy/cuda/cusparse.pyx":3962
 *                                <void*>csrValues, csrRowOffsetsType,
 *                                csrColIndType, idxBase, valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>desc
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3963
 *                                csrColIndType, idxBase, valueType)
 *     check_status(status)
 *     return <size_t>desc             # <<<<<<<<<<<<<<
 * 
 * cpdef destroySpMat(size_t desc):
 */
  __pyx_r = ((size_t)__pyx_v_desc);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3952
 *     return <size_t>desc
 * 
 * cpdef size_t createCsr(int64_t rows, int64_t cols, int64_t nnz,             # <<<<<<<<<<<<<<
 *                        intptr_t csrRowOffsets, intptr_t csrColind,
 *                        intptr_t csrValues, IndexType csrRowOffsetsType,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.createCsr", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_435createCsr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_434createCsr[] = "createCsr(int64_t rows, int64_t cols, int64_t nnz, intptr_t csrRowOffsets, intptr_t csrColind, intptr_t csrValues, IndexType csrRowOffsetsType, IndexType csrColIndType, IndexBase idxBase, DataType valueType) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_435createCsr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_rows;
  int64_t __pyx_v_cols;
  int64_t __pyx_v_nnz;
  intptr_t __pyx_v_csrRowOffsets;
  intptr_t __pyx_v_csrColind;
  intptr_t __pyx_v_csrValues;
  cusparseIndexType_t __pyx_v_csrRowOffsetsType;
  cusparseIndexType_t __pyx_v_csrColIndType;
  cusparseIndexBase_t __pyx_v_idxBase;
  cudaDataType __pyx_v_valueType;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createCsr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_nnz,&__pyx_n_s_csrRowOffsets,&__pyx_n_s_csrColind,&__pyx_n_s_csrValues,&__pyx_n_s_csrRowOffsetsType,&__pyx_n_s_csrColIndType,&__pyx_n_s_idxBase,&__pyx_n_s_valueType,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCsr", 1, 10, 10, 1); __PYX_ERR(0, 3952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCsr", 1, 10, 10, 2); __PYX_ERR(0, 3952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowOffsets)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCsr", 1, 10, 10, 3); __PYX_ERR(0, 3952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColind)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCsr", 1, 10, 10, 4); __PYX_ERR(0, 3952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrValues)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCsr", 1, 10, 10, 5); __PYX_ERR(0, 3952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowOffsetsType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCsr", 1, 10, 10, 6); __PYX_ERR(0, 3952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColIndType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCsr", 1, 10, 10, 7); __PYX_ERR(0, 3952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCsr", 1, 10, 10, 8); __PYX_ERR(0, 3952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_valueType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createCsr", 1, 10, 10, 9); __PYX_ERR(0, 3952, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createCsr") < 0)) __PYX_ERR(0, 3952, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_rows = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3952, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3952, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nnz == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3952, __pyx_L3_error)
    __pyx_v_csrRowOffsets = PyInt_AsSsize_t(values[3]); if (unlikely((__pyx_v_csrRowOffsets == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3953, __pyx_L3_error)
    __pyx_v_csrColind = PyInt_AsSsize_t(values[4]); if (unlikely((__pyx_v_csrColind == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3953, __pyx_L3_error)
    __pyx_v_csrValues = PyInt_AsSsize_t(values[5]); if (unlikely((__pyx_v_csrValues == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3954, __pyx_L3_error)
    __pyx_v_csrRowOffsetsType = __Pyx_PyInt_As_cusparseIndexType_t(values[6]); if (unlikely((__pyx_v_csrRowOffsetsType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3954, __pyx_L3_error)
    __pyx_v_csrColIndType = __Pyx_PyInt_As_cusparseIndexType_t(values[7]); if (unlikely((__pyx_v_csrColIndType == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3955, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_cusparseIndexBase_t(values[8]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3955, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyInt_As_cudaDataType(values[9]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3956, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createCsr", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3952, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.createCsr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_434createCsr(__pyx_self, __pyx_v_rows, __pyx_v_cols, __pyx_v_nnz, __pyx_v_csrRowOffsets, __pyx_v_csrColind, __pyx_v_csrValues, __pyx_v_csrRowOffsetsType, __pyx_v_csrColIndType, __pyx_v_idxBase, __pyx_v_valueType);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_434createCsr(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_nnz, intptr_t __pyx_v_csrRowOffsets, intptr_t __pyx_v_csrColind, intptr_t __pyx_v_csrValues, cusparseIndexType_t __pyx_v_csrRowOffsetsType, cusparseIndexType_t __pyx_v_csrColIndType, cusparseIndexBase_t __pyx_v_idxBase, cudaDataType __pyx_v_valueType) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createCsr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_createCsr(__pyx_v_rows, __pyx_v_cols, __pyx_v_nnz, __pyx_v_csrRowOffsets, __pyx_v_csrColind, __pyx_v_csrValues, __pyx_v_csrRowOffsetsType, __pyx_v_csrColIndType, __pyx_v_idxBase, __pyx_v_valueType, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.createCsr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3965
 *     return <size_t>desc
 * 
 * cpdef destroySpMat(size_t desc):             # <<<<<<<<<<<<<<
 *     status = cusparseDestroySpMat(<SpMatDescr>desc)
 *     check_status(status)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_437destroySpMat(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroySpMat(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroySpMat", 0);

  /* "cupy/cuda/cusparse.pyx":3966
 * 
 * cpdef destroySpMat(size_t desc):
 *     status = cusparseDestroySpMat(<SpMatDescr>desc)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
  __pyx_v_status = cusparseDestroySpMat(((cusparseSpMatDescr_t)__pyx_v_desc));

  /* "cupy/cuda/cusparse.pyx":3967
 * cpdef destroySpMat(size_t desc):
 *     status = cusparseDestroySpMat(<SpMatDescr>desc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef cooGet(size_t desc):
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3965
 *     return <size_t>desc
 * 
 * cpdef destroySpMat(size_t desc):             # <<<<<<<<<<<<<<
 *     status = cusparseDestroySpMat(<SpMatDescr>desc)
 *     check_status(status)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroySpMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_437destroySpMat(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_436destroySpMat[] = "destroySpMat(size_t desc)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_437destroySpMat(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroySpMat (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3965, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroySpMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_436destroySpMat(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_436destroySpMat(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroySpMat", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_destroySpMat(__pyx_v_desc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroySpMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3969
 *     check_status(status)
 * 
 * cpdef cooGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t rows, cols, nnz
 *     cdef intptr_t rowInd, colInd, values,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_439cooGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cooGet(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int64_t __pyx_v_rows;
  int64_t __pyx_v_cols;
  int64_t __pyx_v_nnz;
  intptr_t __pyx_v_rowInd;
  intptr_t __pyx_v_colInd;
  intptr_t __pyx_v_values;
  cusparseIndexType_t __pyx_v_idxType;
  cusparseIndexBase_t __pyx_v_idxBase;
  cudaDataType __pyx_v_valueType;
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cooGet", 0);

  /* "cupy/cuda/cusparse.pyx":3975
 *     cdef IndexBase idxBase,
 *     cdef DataType valueType
 *     status = cusparseCooGet(<SpMatDescr>desc, &rows, &cols, &nnz,             # <<<<<<<<<<<<<<
 *                             <void**>&rowInd, <void**>&colInd, <void**>&values,
 *                             &idxType, &idxBase, &valueType)
 */
  __pyx_v_status = cusparseCooGet(((cusparseSpMatDescr_t)__pyx_v_desc), (&__pyx_v_rows), (&__pyx_v_cols), (&__pyx_v_nnz), ((void **)(&__pyx_v_rowInd)), ((void **)(&__pyx_v_colInd)), ((void **)(&__pyx_v_values)), (&__pyx_v_idxType), (&__pyx_v_idxBase), (&__pyx_v_valueType));

  /* "cupy/cuda/cusparse.pyx":3978
 *                             <void**>&rowInd, <void**>&colInd, <void**>&values,
 *                             &idxType, &idxBase, &valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return CooAttributes(rows, cols, nnz, rowInd, colInd, values,
 *                          idxType, idxBase, valueType)
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3979
 *                             &idxType, &idxBase, &valueType)
 *     check_status(status)
 *     return CooAttributes(rows, cols, nnz, rowInd, colInd, values,             # <<<<<<<<<<<<<<
 *                          idxType, idxBase, valueType)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_cols); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_nnz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_rowInd); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_colInd); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_values); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cupy/cuda/cusparse.pyx":3980
 *     check_status(status)
 *     return CooAttributes(rows, cols, nnz, rowInd, colInd, values,
 *                          idxType, idxBase, valueType)             # <<<<<<<<<<<<<<
 * 
 * cpdef cooAoSGet(size_t desc):
 */
  __pyx_t_7 = __Pyx_PyInt_From_cusparseIndexType_t(__pyx_v_idxType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyInt_From_cusparseIndexBase_t(__pyx_v_idxBase); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyInt_From_cudaDataType(__pyx_v_valueType); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "cupy/cuda/cusparse.pyx":3979
 *                             &idxType, &idxBase, &valueType)
 *     check_status(status)
 *     return CooAttributes(rows, cols, nnz, rowInd, colInd, values,             # <<<<<<<<<<<<<<
 *                          idxType, idxBase, valueType)
 * 
 */
  __pyx_t_10 = PyTuple_New(9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_t_9);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4cupy_4cuda_8cusparse_CooAttributes), __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3969
 *     check_status(status)
 * 
 * cpdef cooGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t rows, cols, nnz
 *     cdef intptr_t rowInd, colInd, values,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cooGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_439cooGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_438cooGet[] = "cooGet(size_t desc)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_439cooGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cooGet (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3969, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cooGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_438cooGet(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_438cooGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cooGet", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cooGet(__pyx_v_desc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cooGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3982
 *                          idxType, idxBase, valueType)
 * 
 * cpdef cooAoSGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t rows, cols, nnz
 *     cdef intptr_t ind, values,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_441cooAoSGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_cooAoSGet(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int64_t __pyx_v_rows;
  int64_t __pyx_v_cols;
  int64_t __pyx_v_nnz;
  intptr_t __pyx_v_ind;
  intptr_t __pyx_v_values;
  cusparseIndexType_t __pyx_v_idxType;
  cusparseIndexBase_t __pyx_v_idxBase;
  cudaDataType __pyx_v_valueType;
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cooAoSGet", 0);

  /* "cupy/cuda/cusparse.pyx":3988
 *     cdef IndexBase idxBase,
 *     cdef DataType valueType
 *     status = cusparseCooAoSGet(<SpMatDescr>desc, &rows, &cols, &nnz,             # <<<<<<<<<<<<<<
 *                                <void**>&ind, <void**>&values,
 *                                &idxType, &idxBase, &valueType)
 */
  __pyx_v_status = cusparseCooAoSGet(((cusparseSpMatDescr_t)__pyx_v_desc), (&__pyx_v_rows), (&__pyx_v_cols), (&__pyx_v_nnz), ((void **)(&__pyx_v_ind)), ((void **)(&__pyx_v_values)), (&__pyx_v_idxType), (&__pyx_v_idxBase), (&__pyx_v_valueType));

  /* "cupy/cuda/cusparse.pyx":3991
 *                                <void**>&ind, <void**>&values,
 *                                &idxType, &idxBase, &valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return CooAoSAttributes(rows, cols, nnz, ind, values,
 *                             idxType, idxBase, valueType)
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":3992
 *                                &idxType, &idxBase, &valueType)
 *     check_status(status)
 *     return CooAoSAttributes(rows, cols, nnz, ind, values,             # <<<<<<<<<<<<<<
 *                             idxType, idxBase, valueType)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_cols); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_nnz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "cupy/cuda/cusparse.pyx":3993
 *     check_status(status)
 *     return CooAoSAttributes(rows, cols, nnz, ind, values,
 *                             idxType, idxBase, valueType)             # <<<<<<<<<<<<<<
 * 
 * cpdef csrGet(size_t desc):
 */
  __pyx_t_6 = __Pyx_PyInt_From_cusparseIndexType_t(__pyx_v_idxType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_cusparseIndexBase_t(__pyx_v_idxBase); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyInt_From_cudaDataType(__pyx_v_valueType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "cupy/cuda/cusparse.pyx":3992
 *                                &idxType, &idxBase, &valueType)
 *     check_status(status)
 *     return CooAoSAttributes(rows, cols, nnz, ind, values,             # <<<<<<<<<<<<<<
 *                             idxType, idxBase, valueType)
 * 
 */
  __pyx_t_9 = PyTuple_New(8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_t_8);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4cupy_4cuda_8cusparse_CooAoSAttributes), __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3982
 *                          idxType, idxBase, valueType)
 * 
 * cpdef cooAoSGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t rows, cols, nnz
 *     cdef intptr_t ind, values,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cooAoSGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_441cooAoSGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_440cooAoSGet[] = "cooAoSGet(size_t desc)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_441cooAoSGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cooAoSGet (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3982, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.cooAoSGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_440cooAoSGet(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_440cooAoSGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cooAoSGet", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_cooAoSGet(__pyx_v_desc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.cooAoSGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":3995
 *                             idxType, idxBase, valueType)
 * 
 * cpdef csrGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t rows, cols, nnz
 *     cdef intptr_t rowOffsets, colInd, values,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_443csrGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_csrGet(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int64_t __pyx_v_rows;
  int64_t __pyx_v_cols;
  int64_t __pyx_v_nnz;
  intptr_t __pyx_v_rowOffsets;
  intptr_t __pyx_v_colInd;
  intptr_t __pyx_v_values;
  cusparseIndexType_t __pyx_v_rowOffsetsType;
  cusparseIndexType_t __pyx_v_colIndType;
  cusparseIndexBase_t __pyx_v_idxBase;
  cudaDataType __pyx_v_valueType;
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("csrGet", 0);

  /* "cupy/cuda/cusparse.pyx":4001
 *     cdef IndexBase idxBase
 *     cdef DataType valueType
 *     status = cusparseCsrGet(<SpMatDescr>desc, &rows, &cols, &nnz,             # <<<<<<<<<<<<<<
 *                             <void**>&rowOffsets, <void**>&colInd,
 *                             <void**>&values, &rowOffsetsType, &colIndType,
 */
  __pyx_v_status = cusparseCsrGet(((cusparseSpMatDescr_t)__pyx_v_desc), (&__pyx_v_rows), (&__pyx_v_cols), (&__pyx_v_nnz), ((void **)(&__pyx_v_rowOffsets)), ((void **)(&__pyx_v_colInd)), ((void **)(&__pyx_v_values)), (&__pyx_v_rowOffsetsType), (&__pyx_v_colIndType), (&__pyx_v_idxBase), (&__pyx_v_valueType));

  /* "cupy/cuda/cusparse.pyx":4005
 *                             <void**>&values, &rowOffsetsType, &colIndType,
 *                             &idxBase, &valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return CsrAttributes(rows, cols, nnz, rowOffsets, colInd, values,
 *                          rowOffsetsType, colIndType, idxBase, valueType)
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4006
 *                             &idxBase, &valueType)
 *     check_status(status)
 *     return CsrAttributes(rows, cols, nnz, rowOffsets, colInd, values,             # <<<<<<<<<<<<<<
 *                          rowOffsetsType, colIndType, idxBase, valueType)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_cols); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_nnz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_rowOffsets); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_colInd); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_values); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cupy/cuda/cusparse.pyx":4007
 *     check_status(status)
 *     return CsrAttributes(rows, cols, nnz, rowOffsets, colInd, values,
 *                          rowOffsetsType, colIndType, idxBase, valueType)             # <<<<<<<<<<<<<<
 * 
 * cpdef int spMatGetFormat(size_t desc):
 */
  __pyx_t_7 = __Pyx_PyInt_From_cusparseIndexType_t(__pyx_v_rowOffsetsType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyInt_From_cusparseIndexType_t(__pyx_v_colIndType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyInt_From_cusparseIndexBase_t(__pyx_v_idxBase); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyInt_From_cudaDataType(__pyx_v_valueType); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "cupy/cuda/cusparse.pyx":4006
 *                             &idxBase, &valueType)
 *     check_status(status)
 *     return CsrAttributes(rows, cols, nnz, rowOffsets, colInd, values,             # <<<<<<<<<<<<<<
 *                          rowOffsetsType, colIndType, idxBase, valueType)
 * 
 */
  __pyx_t_11 = PyTuple_New(10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_11, 8, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_11, 9, __pyx_t_10);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4cupy_4cuda_8cusparse_CsrAttributes), __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":3995
 *                             idxType, idxBase, valueType)
 * 
 * cpdef csrGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t rows, cols, nnz
 *     cdef intptr_t rowOffsets, colInd, values,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cupy.cuda.cusparse.csrGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_443csrGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_442csrGet[] = "csrGet(size_t desc)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_443csrGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("csrGet (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3995, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.csrGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_442csrGet(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_442csrGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("csrGet", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_csrGet(__pyx_v_desc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.csrGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4009
 *                          rowOffsetsType, colIndType, idxBase, valueType)
 * 
 * cpdef int spMatGetFormat(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef Format format
 *     status = cusparseSpMatGetFormat(<SpMatDescr>desc, &format)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_445spMatGetFormat(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_spMatGetFormat(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseFormat_t __pyx_v_format;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMatGetFormat", 0);

  /* "cupy/cuda/cusparse.pyx":4011
 * cpdef int spMatGetFormat(size_t desc):
 *     cdef Format format
 *     status = cusparseSpMatGetFormat(<SpMatDescr>desc, &format)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <int>format
 */
  __pyx_v_status = cusparseSpMatGetFormat(((cusparseSpMatDescr_t)__pyx_v_desc), (&__pyx_v_format));

  /* "cupy/cuda/cusparse.pyx":4012
 *     cdef Format format
 *     status = cusparseSpMatGetFormat(<SpMatDescr>desc, &format)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>format
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4013
 *     status = cusparseSpMatGetFormat(<SpMatDescr>desc, &format)
 *     check_status(status)
 *     return <int>format             # <<<<<<<<<<<<<<
 * 
 * cpdef int spMatGetIndexBase(size_t desc):
 */
  __pyx_r = ((int)__pyx_v_format);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":4009
 *                          rowOffsetsType, colIndType, idxBase, valueType)
 * 
 * cpdef int spMatGetFormat(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef Format format
 *     status = cusparseSpMatGetFormat(<SpMatDescr>desc, &format)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.spMatGetFormat", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_445spMatGetFormat(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_444spMatGetFormat[] = "spMatGetFormat(size_t desc) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_445spMatGetFormat(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMatGetFormat (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4009, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMatGetFormat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_444spMatGetFormat(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_444spMatGetFormat(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMatGetFormat", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_spMatGetFormat(__pyx_v_desc, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMatGetFormat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4015
 *     return <int>format
 * 
 * cpdef int spMatGetIndexBase(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef IndexBase idxBase
 *     status = cusparseSpMatGetIndexBase(<SpMatDescr>desc, &idxBase)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_447spMatGetIndexBase(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_spMatGetIndexBase(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseIndexBase_t __pyx_v_idxBase;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMatGetIndexBase", 0);

  /* "cupy/cuda/cusparse.pyx":4017
 * cpdef int spMatGetIndexBase(size_t desc):
 *     cdef IndexBase idxBase
 *     status = cusparseSpMatGetIndexBase(<SpMatDescr>desc, &idxBase)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <int>idxBase
 */
  __pyx_v_status = cusparseSpMatGetIndexBase(((cusparseSpMatDescr_t)__pyx_v_desc), (&__pyx_v_idxBase));

  /* "cupy/cuda/cusparse.pyx":4018
 *     cdef IndexBase idxBase
 *     status = cusparseSpMatGetIndexBase(<SpMatDescr>desc, &idxBase)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <int>idxBase
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4019
 *     status = cusparseSpMatGetIndexBase(<SpMatDescr>desc, &idxBase)
 *     check_status(status)
 *     return <int>idxBase             # <<<<<<<<<<<<<<
 * 
 * cpdef intptr_t spMatGetValues(size_t desc):
 */
  __pyx_r = ((int)__pyx_v_idxBase);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":4015
 *     return <int>format
 * 
 * cpdef int spMatGetIndexBase(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef IndexBase idxBase
 *     status = cusparseSpMatGetIndexBase(<SpMatDescr>desc, &idxBase)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.spMatGetIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_447spMatGetIndexBase(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_446spMatGetIndexBase[] = "spMatGetIndexBase(size_t desc) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_447spMatGetIndexBase(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMatGetIndexBase (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4015, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMatGetIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_446spMatGetIndexBase(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_446spMatGetIndexBase(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMatGetIndexBase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_spMatGetIndexBase(__pyx_v_desc, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMatGetIndexBase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4021
 *     return <int>idxBase
 * 
 * cpdef intptr_t spMatGetValues(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef intptr_t values
 *     status = cusparseSpMatGetValues(<SpMatDescr>desc, <void**>&values)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_449spMatGetValues(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static intptr_t __pyx_f_4cupy_4cuda_8cusparse_spMatGetValues(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  intptr_t __pyx_v_values;
  cusparseStatus_t __pyx_v_status;
  intptr_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMatGetValues", 0);

  /* "cupy/cuda/cusparse.pyx":4023
 * cpdef intptr_t spMatGetValues(size_t desc):
 *     cdef intptr_t values
 *     status = cusparseSpMatGetValues(<SpMatDescr>desc, <void**>&values)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return values
 */
  __pyx_v_status = cusparseSpMatGetValues(((cusparseSpMatDescr_t)__pyx_v_desc), ((void **)(&__pyx_v_values)));

  /* "cupy/cuda/cusparse.pyx":4024
 *     cdef intptr_t values
 *     status = cusparseSpMatGetValues(<SpMatDescr>desc, <void**>&values)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return values
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4025
 *     status = cusparseSpMatGetValues(<SpMatDescr>desc, <void**>&values)
 *     check_status(status)
 *     return values             # <<<<<<<<<<<<<<
 * 
 * cpdef spMatSetValues(size_t desc, intptr_t values):
 */
  __pyx_r = __pyx_v_values;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":4021
 *     return <int>idxBase
 * 
 * cpdef intptr_t spMatGetValues(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef intptr_t values
 *     status = cusparseSpMatGetValues(<SpMatDescr>desc, <void**>&values)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.spMatGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_449spMatGetValues(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_448spMatGetValues[] = "spMatGetValues(size_t desc) -> intptr_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_449spMatGetValues(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMatGetValues (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4021, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMatGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_448spMatGetValues(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_448spMatGetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMatGetValues", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_f_4cupy_4cuda_8cusparse_spMatGetValues(__pyx_v_desc, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMatGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4027
 *     return values
 * 
 * cpdef spMatSetValues(size_t desc, intptr_t values):             # <<<<<<<<<<<<<<
 *     status = cusparseSpMatSetValues(<SpMatDescr>desc, <void*>values)
 *     check_status(status)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_451spMatSetValues(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_spMatSetValues(size_t __pyx_v_desc, intptr_t __pyx_v_values, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMatSetValues", 0);

  /* "cupy/cuda/cusparse.pyx":4028
 * 
 * cpdef spMatSetValues(size_t desc, intptr_t values):
 *     status = cusparseSpMatSetValues(<SpMatDescr>desc, <void*>values)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
  __pyx_v_status = cusparseSpMatSetValues(((cusparseSpMatDescr_t)__pyx_v_desc), ((void *)__pyx_v_values));

  /* "cupy/cuda/cusparse.pyx":4029
 * cpdef spMatSetValues(size_t desc, intptr_t values):
 *     status = cusparseSpMatSetValues(<SpMatDescr>desc, <void*>values)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef int spMatGetStridedBatch(size_t desc):
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4027
 *     return values
 * 
 * cpdef spMatSetValues(size_t desc, intptr_t values):             # <<<<<<<<<<<<<<
 *     status = cusparseSpMatSetValues(<SpMatDescr>desc, <void*>values)
 *     check_status(status)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMatSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_451spMatSetValues(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_450spMatSetValues[] = "spMatSetValues(size_t desc, intptr_t values)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_451spMatSetValues(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_desc;
  intptr_t __pyx_v_values;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMatSetValues (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_desc,&__pyx_n_s_values,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_desc)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMatSetValues", 1, 2, 2, 1); __PYX_ERR(0, 4027, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "spMatSetValues") < 0)) __PYX_ERR(0, 4027, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_desc = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4027, __pyx_L3_error)
    __pyx_v_values = PyInt_AsSsize_t(values[1]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4027, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMatSetValues", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4027, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMatSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_450spMatSetValues(__pyx_self, __pyx_v_desc, __pyx_v_values);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_450spMatSetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, intptr_t __pyx_v_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMatSetValues", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_spMatSetValues(__pyx_v_desc, __pyx_v_values, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMatSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4031
 *     check_status(status)
 * 
 * cpdef int spMatGetStridedBatch(size_t desc):             # <<<<<<<<<<<<<<
 *     cpdef int batchCount
 *     status = cusparseSpMatGetStridedBatch(<SpMatDescr>desc, &batchCount)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_453spMatGetStridedBatch(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static int __pyx_f_4cupy_4cuda_8cusparse_spMatGetStridedBatch(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_batchCount;
  cusparseStatus_t __pyx_v_status;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMatGetStridedBatch", 0);

  /* "cupy/cuda/cusparse.pyx":4033
 * cpdef int spMatGetStridedBatch(size_t desc):
 *     cpdef int batchCount
 *     status = cusparseSpMatGetStridedBatch(<SpMatDescr>desc, &batchCount)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return batchCount
 */
  __pyx_v_status = cusparseSpMatGetStridedBatch(((cusparseSpMatDescr_t)__pyx_v_desc), (&__pyx_v_batchCount));

  /* "cupy/cuda/cusparse.pyx":4034
 *     cpdef int batchCount
 *     status = cusparseSpMatGetStridedBatch(<SpMatDescr>desc, &batchCount)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return batchCount
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4035
 *     status = cusparseSpMatGetStridedBatch(<SpMatDescr>desc, &batchCount)
 *     check_status(status)
 *     return batchCount             # <<<<<<<<<<<<<<
 * 
 * cpdef spMatSetStridedBatch(size_t desc, int batchCount):
 */
  __pyx_r = __pyx_v_batchCount;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":4031
 *     check_status(status)
 * 
 * cpdef int spMatGetStridedBatch(size_t desc):             # <<<<<<<<<<<<<<
 *     cpdef int batchCount
 *     status = cusparseSpMatGetStridedBatch(<SpMatDescr>desc, &batchCount)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.spMatGetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_453spMatGetStridedBatch(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_452spMatGetStridedBatch[] = "spMatGetStridedBatch(size_t desc) -> int";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_453spMatGetStridedBatch(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMatGetStridedBatch (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4031, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMatGetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_452spMatGetStridedBatch(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_452spMatGetStridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMatGetStridedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4cupy_4cuda_8cusparse_spMatGetStridedBatch(__pyx_v_desc, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMatGetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4037
 *     return batchCount
 * 
 * cpdef spMatSetStridedBatch(size_t desc, int batchCount):             # <<<<<<<<<<<<<<
 *     status = cusparseSpMatSetStridedBatch(<SpMatDescr>desc, batchCount)
 *     check_status(status)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_455spMatSetStridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_spMatSetStridedBatch(size_t __pyx_v_desc, int __pyx_v_batchCount, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMatSetStridedBatch", 0);

  /* "cupy/cuda/cusparse.pyx":4038
 * 
 * cpdef spMatSetStridedBatch(size_t desc, int batchCount):
 *     status = cusparseSpMatSetStridedBatch(<SpMatDescr>desc, batchCount)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
  __pyx_v_status = cusparseSpMatSetStridedBatch(((cusparseSpMatDescr_t)__pyx_v_desc), __pyx_v_batchCount);

  /* "cupy/cuda/cusparse.pyx":4039
 * cpdef spMatSetStridedBatch(size_t desc, int batchCount):
 *     status = cusparseSpMatSetStridedBatch(<SpMatDescr>desc, batchCount)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ############################################################
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4037
 *     return batchCount
 * 
 * cpdef spMatSetStridedBatch(size_t desc, int batchCount):             # <<<<<<<<<<<<<<
 *     status = cusparseSpMatSetStridedBatch(<SpMatDescr>desc, batchCount)
 *     check_status(status)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMatSetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_455spMatSetStridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_454spMatSetStridedBatch[] = "spMatSetStridedBatch(size_t desc, int batchCount)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_455spMatSetStridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_desc;
  int __pyx_v_batchCount;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMatSetStridedBatch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_desc,&__pyx_n_s_batchCount,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_desc)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMatSetStridedBatch", 1, 2, 2, 1); __PYX_ERR(0, 4037, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "spMatSetStridedBatch") < 0)) __PYX_ERR(0, 4037, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_desc = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4037, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4037, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMatSetStridedBatch", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4037, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMatSetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_454spMatSetStridedBatch(__pyx_self, __pyx_v_desc, __pyx_v_batchCount);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_454spMatSetStridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, int __pyx_v_batchCount) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMatSetStridedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_spMatSetStridedBatch(__pyx_v_desc, __pyx_v_batchCount, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMatSetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4044
 * # Dense Vector APIs
 * 
 * cpdef size_t createDnVec(int64_t size, intptr_t values,             # <<<<<<<<<<<<<<
 *                          DataType valueType) except? 0:
 *     cdef DnVecDescr desc
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_457createDnVec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createDnVec(int64_t __pyx_v_size, intptr_t __pyx_v_values, cudaDataType __pyx_v_valueType, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseDnVecDescr_t __pyx_v_desc;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createDnVec", 0);

  /* "cupy/cuda/cusparse.pyx":4047
 *                          DataType valueType) except? 0:
 *     cdef DnVecDescr desc
 *     status = cusparseCreateDnVec(&desc, size, <void*>values, valueType)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return <size_t>desc
 */
  __pyx_v_status = cusparseCreateDnVec((&__pyx_v_desc), __pyx_v_size, ((void *)__pyx_v_values), __pyx_v_valueType);

  /* "cupy/cuda/cusparse.pyx":4048
 *     cdef DnVecDescr desc
 *     status = cusparseCreateDnVec(&desc, size, <void*>values, valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>desc
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4049
 *     status = cusparseCreateDnVec(&desc, size, <void*>values, valueType)
 *     check_status(status)
 *     return <size_t>desc             # <<<<<<<<<<<<<<
 * 
 * cpdef destroyDnVec(size_t desc):
 */
  __pyx_r = ((size_t)__pyx_v_desc);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":4044
 * # Dense Vector APIs
 * 
 * cpdef size_t createDnVec(int64_t size, intptr_t values,             # <<<<<<<<<<<<<<
 *                          DataType valueType) except? 0:
 *     cdef DnVecDescr desc
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.createDnVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_457createDnVec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_456createDnVec[] = "createDnVec(int64_t size, intptr_t values, DataType valueType) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_457createDnVec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_size;
  intptr_t __pyx_v_values;
  cudaDataType __pyx_v_valueType;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createDnVec (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_values,&__pyx_n_s_valueType,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createDnVec", 1, 3, 3, 1); __PYX_ERR(0, 4044, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_valueType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createDnVec", 1, 3, 3, 2); __PYX_ERR(0, 4044, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createDnVec") < 0)) __PYX_ERR(0, 4044, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_size = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_size == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4044, __pyx_L3_error)
    __pyx_v_values = PyInt_AsSsize_t(values[1]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4044, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyInt_As_cudaDataType(values[2]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4045, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createDnVec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4044, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.createDnVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_456createDnVec(__pyx_self, __pyx_v_size, __pyx_v_values, __pyx_v_valueType);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_456createDnVec(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_size, intptr_t __pyx_v_values, cudaDataType __pyx_v_valueType) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createDnVec", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_createDnVec(__pyx_v_size, __pyx_v_values, __pyx_v_valueType, 0); if (unlikely(__pyx_t_1 == ((size_t)0) && PyErr_Occurred())) __PYX_ERR(0, 4044, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cupy.cuda.cusparse.createDnVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4051
 *     return <size_t>desc
 * 
 * cpdef destroyDnVec(size_t desc):             # <<<<<<<<<<<<<<
 *     status = cusparseDestroyDnVec(<DnVecDescr>desc)
 *     check_status(status)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_459destroyDnVec(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroyDnVec(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyDnVec", 0);

  /* "cupy/cuda/cusparse.pyx":4052
 * 
 * cpdef destroyDnVec(size_t desc):
 *     status = cusparseDestroyDnVec(<DnVecDescr>desc)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
  __pyx_v_status = cusparseDestroyDnVec(((cusparseDnVecDescr_t)__pyx_v_desc));

  /* "cupy/cuda/cusparse.pyx":4053
 * cpdef destroyDnVec(size_t desc):
 *     status = cusparseDestroyDnVec(<DnVecDescr>desc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef DnVecAttributes dnVecGet(size_t desc):
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4051
 *     return <size_t>desc
 * 
 * cpdef destroyDnVec(size_t desc):             # <<<<<<<<<<<<<<
 *     status = cusparseDestroyDnVec(<DnVecDescr>desc)
 *     check_status(status)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyDnVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_459destroyDnVec(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_458destroyDnVec[] = "destroyDnVec(size_t desc)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_459destroyDnVec(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyDnVec (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4051, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyDnVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_458destroyDnVec(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_458destroyDnVec(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyDnVec", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_destroyDnVec(__pyx_v_desc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyDnVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4055
 *     check_status(status)
 * 
 * cpdef DnVecAttributes dnVecGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t size
 *     cdef intptr_t indices, values
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_461dnVecGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_f_4cupy_4cuda_8cusparse_dnVecGet(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int64_t __pyx_v_size;
  intptr_t __pyx_v_values;
  cudaDataType __pyx_v_valueType;
  cusparseStatus_t __pyx_v_status;
  struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnVecGet", 0);

  /* "cupy/cuda/cusparse.pyx":4059
 *     cdef intptr_t indices, values
 *     cdef DataType valueType
 *     status = cusparseDnVecGet(<DnVecDescr>desc, &size, <void**>&values,             # <<<<<<<<<<<<<<
 *                               &valueType)
 *     check_status(status)
 */
  __pyx_v_status = cusparseDnVecGet(((cusparseDnVecDescr_t)__pyx_v_desc), (&__pyx_v_size), ((void **)(&__pyx_v_values)), (&__pyx_v_valueType));

  /* "cupy/cuda/cusparse.pyx":4061
 *     status = cusparseDnVecGet(<DnVecDescr>desc, &size, <void**>&values,
 *                               &valueType)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return DnVecAttributes(size, values, valueType)
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4062
 *                               &valueType)
 *     check_status(status)
 *     return DnVecAttributes(size, values, valueType)             # <<<<<<<<<<<<<<
 * 
 * cpdef intptr_t dnVecGetValues(size_t desc):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_cudaDataType(__pyx_v_valueType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4cupy_4cuda_8cusparse_DnVecAttributes), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = ((struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":4055
 *     check_status(status)
 * 
 * cpdef DnVecAttributes dnVecGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t size
 *     cdef intptr_t indices, values
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnVecGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_461dnVecGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_460dnVecGet[] = "dnVecGet(size_t desc) -> DnVecAttributes";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_461dnVecGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnVecGet (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4055, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnVecGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_460dnVecGet(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_460dnVecGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnVecGet", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4cupy_4cuda_8cusparse_dnVecGet(__pyx_v_desc, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnVecGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4064
 *     return DnVecAttributes(size, values, valueType)
 * 
 * cpdef intptr_t dnVecGetValues(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef intptr_t values
 *     status = cusparseDnVecGetValues(<DnVecDescr>desc, <void**>&values)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_463dnVecGetValues(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static intptr_t __pyx_f_4cupy_4cuda_8cusparse_dnVecGetValues(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  intptr_t __pyx_v_values;
  cusparseStatus_t __pyx_v_status;
  intptr_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnVecGetValues", 0);

  /* "cupy/cuda/cusparse.pyx":4066
 * cpdef intptr_t dnVecGetValues(size_t desc):
 *     cdef intptr_t values
 *     status = cusparseDnVecGetValues(<DnVecDescr>desc, <void**>&values)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return values
 */
  __pyx_v_status = cusparseDnVecGetValues(((cusparseDnVecDescr_t)__pyx_v_desc), ((void **)(&__pyx_v_values)));

  /* "cupy/cuda/cusparse.pyx":4067
 *     cdef intptr_t values
 *     status = cusparseDnVecGetValues(<DnVecDescr>desc, <void**>&values)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return values
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4068
 *     status = cusparseDnVecGetValues(<DnVecDescr>desc, <void**>&values)
 *     check_status(status)
 *     return values             # <<<<<<<<<<<<<<
 * 
 * cpdef dnVecSetValues(size_t desc, intptr_t values):
 */
  __pyx_r = __pyx_v_values;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":4064
 *     return DnVecAttributes(size, values, valueType)
 * 
 * cpdef intptr_t dnVecGetValues(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef intptr_t values
 *     status = cusparseDnVecGetValues(<DnVecDescr>desc, <void**>&values)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.dnVecGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_463dnVecGetValues(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_462dnVecGetValues[] = "dnVecGetValues(size_t desc) -> intptr_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_463dnVecGetValues(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnVecGetValues (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4064, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnVecGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_462dnVecGetValues(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_462dnVecGetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnVecGetValues", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_f_4cupy_4cuda_8cusparse_dnVecGetValues(__pyx_v_desc, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnVecGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4070
 *     return values
 * 
 * cpdef dnVecSetValues(size_t desc, intptr_t values):             # <<<<<<<<<<<<<<
 *     status = cusparseDnVecSetValues(<DnVecDescr>desc, <void*>values)
 *     check_status(status)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_465dnVecSetValues(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dnVecSetValues(size_t __pyx_v_desc, intptr_t __pyx_v_values, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnVecSetValues", 0);

  /* "cupy/cuda/cusparse.pyx":4071
 * 
 * cpdef dnVecSetValues(size_t desc, intptr_t values):
 *     status = cusparseDnVecSetValues(<DnVecDescr>desc, <void*>values)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
  __pyx_v_status = cusparseDnVecSetValues(((cusparseDnVecDescr_t)__pyx_v_desc), ((void *)__pyx_v_values));

  /* "cupy/cuda/cusparse.pyx":4072
 * cpdef dnVecSetValues(size_t desc, intptr_t values):
 *     status = cusparseDnVecSetValues(<DnVecDescr>desc, <void*>values)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ############################################################
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4070
 *     return values
 * 
 * cpdef dnVecSetValues(size_t desc, intptr_t values):             # <<<<<<<<<<<<<<
 *     status = cusparseDnVecSetValues(<DnVecDescr>desc, <void*>values)
 *     check_status(status)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnVecSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_465dnVecSetValues(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_464dnVecSetValues[] = "dnVecSetValues(size_t desc, intptr_t values)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_465dnVecSetValues(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_desc;
  intptr_t __pyx_v_values;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnVecSetValues (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_desc,&__pyx_n_s_values,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_desc)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnVecSetValues", 1, 2, 2, 1); __PYX_ERR(0, 4070, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dnVecSetValues") < 0)) __PYX_ERR(0, 4070, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_desc = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4070, __pyx_L3_error)
    __pyx_v_values = PyInt_AsSsize_t(values[1]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4070, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dnVecSetValues", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4070, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnVecSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_464dnVecSetValues(__pyx_self, __pyx_v_desc, __pyx_v_values);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_464dnVecSetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, intptr_t __pyx_v_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnVecSetValues", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dnVecSetValues(__pyx_v_desc, __pyx_v_values, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnVecSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4077
 * # Dense Matrix APIs
 * 
 * cpdef size_t createDnMat(int64_t rows, int64_t cols, int64_t ld,             # <<<<<<<<<<<<<<
 *                          intptr_t values, DataType valueType, Order order):
 *     cdef DnMatDescr desc
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_467createDnMat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_createDnMat(int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_ld, intptr_t __pyx_v_values, cudaDataType __pyx_v_valueType, cusparseOrder_t __pyx_v_order, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseDnMatDescr_t __pyx_v_desc;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createDnMat", 0);

  /* "cupy/cuda/cusparse.pyx":4080
 *                          intptr_t values, DataType valueType, Order order):
 *     cdef DnMatDescr desc
 *     status = cusparseCreateDnMat(&desc, rows, cols, ld, <void*>values,             # <<<<<<<<<<<<<<
 *                                  valueType, order)
 *     check_status(status)
 */
  __pyx_v_status = cusparseCreateDnMat((&__pyx_v_desc), __pyx_v_rows, __pyx_v_cols, __pyx_v_ld, ((void *)__pyx_v_values), __pyx_v_valueType, __pyx_v_order);

  /* "cupy/cuda/cusparse.pyx":4082
 *     status = cusparseCreateDnMat(&desc, rows, cols, ld, <void*>values,
 *                                  valueType, order)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return <size_t>desc
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4083
 *                                  valueType, order)
 *     check_status(status)
 *     return <size_t>desc             # <<<<<<<<<<<<<<
 * 
 * cpdef destroyDnMat(size_t desc):
 */
  __pyx_r = ((size_t)__pyx_v_desc);
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":4077
 * # Dense Matrix APIs
 * 
 * cpdef size_t createDnMat(int64_t rows, int64_t cols, int64_t ld,             # <<<<<<<<<<<<<<
 *                          intptr_t values, DataType valueType, Order order):
 *     cdef DnMatDescr desc
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.createDnMat", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_467createDnMat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_466createDnMat[] = "createDnMat(int64_t rows, int64_t cols, int64_t ld, intptr_t values, DataType valueType, Order order) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_467createDnMat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_rows;
  int64_t __pyx_v_cols;
  int64_t __pyx_v_ld;
  intptr_t __pyx_v_values;
  cudaDataType __pyx_v_valueType;
  cusparseOrder_t __pyx_v_order;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createDnMat (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_ld,&__pyx_n_s_values,&__pyx_n_s_valueType,&__pyx_n_s_order,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createDnMat", 1, 6, 6, 1); __PYX_ERR(0, 4077, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ld)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createDnMat", 1, 6, 6, 2); __PYX_ERR(0, 4077, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createDnMat", 1, 6, 6, 3); __PYX_ERR(0, 4077, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_valueType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createDnMat", 1, 6, 6, 4); __PYX_ERR(0, 4077, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_order)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createDnMat", 1, 6, 6, 5); __PYX_ERR(0, 4077, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createDnMat") < 0)) __PYX_ERR(0, 4077, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_rows = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_rows == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4077, __pyx_L3_error)
    __pyx_v_cols = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_cols == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4077, __pyx_L3_error)
    __pyx_v_ld = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_ld == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4077, __pyx_L3_error)
    __pyx_v_values = PyInt_AsSsize_t(values[3]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4078, __pyx_L3_error)
    __pyx_v_valueType = __Pyx_PyInt_As_cudaDataType(values[4]); if (unlikely((__pyx_v_valueType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4078, __pyx_L3_error)
    __pyx_v_order = __Pyx_PyInt_As_cusparseOrder_t(values[5]); if (unlikely((__pyx_v_order == ((cusparseOrder_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4078, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createDnMat", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4077, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.createDnMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_466createDnMat(__pyx_self, __pyx_v_rows, __pyx_v_cols, __pyx_v_ld, __pyx_v_values, __pyx_v_valueType, __pyx_v_order);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_466createDnMat(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_rows, int64_t __pyx_v_cols, int64_t __pyx_v_ld, intptr_t __pyx_v_values, cudaDataType __pyx_v_valueType, cusparseOrder_t __pyx_v_order) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createDnMat", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_createDnMat(__pyx_v_rows, __pyx_v_cols, __pyx_v_ld, __pyx_v_values, __pyx_v_valueType, __pyx_v_order, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.createDnMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4085
 *     return <size_t>desc
 * 
 * cpdef destroyDnMat(size_t desc):             # <<<<<<<<<<<<<<
 *     status = cusparseDestroyDnMat(<DnMatDescr>desc)
 *     check_status(status)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_469destroyDnMat(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_destroyDnMat(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyDnMat", 0);

  /* "cupy/cuda/cusparse.pyx":4086
 * 
 * cpdef destroyDnMat(size_t desc):
 *     status = cusparseDestroyDnMat(<DnMatDescr>desc)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
  __pyx_v_status = cusparseDestroyDnMat(((cusparseDnMatDescr_t)__pyx_v_desc));

  /* "cupy/cuda/cusparse.pyx":4087
 * cpdef destroyDnMat(size_t desc):
 *     status = cusparseDestroyDnMat(<DnMatDescr>desc)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef dnMatGet(size_t desc):
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4085
 *     return <size_t>desc
 * 
 * cpdef destroyDnMat(size_t desc):             # <<<<<<<<<<<<<<
 *     status = cusparseDestroyDnMat(<DnMatDescr>desc)
 *     check_status(status)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyDnMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_469destroyDnMat(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_468destroyDnMat[] = "destroyDnMat(size_t desc)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_469destroyDnMat(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyDnMat (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4085, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyDnMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_468destroyDnMat(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_468destroyDnMat(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroyDnMat", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_destroyDnMat(__pyx_v_desc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.destroyDnMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4089
 *     check_status(status)
 * 
 * cpdef dnMatGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t rows, cols, ld
 *     cdef intptr_t values,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_471dnMatGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dnMatGet(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int64_t __pyx_v_rows;
  int64_t __pyx_v_cols;
  int64_t __pyx_v_ld;
  intptr_t __pyx_v_values;
  cudaDataType __pyx_v_valueType;
  cusparseOrder_t __pyx_v_order;
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnMatGet", 0);

  /* "cupy/cuda/cusparse.pyx":4094
 *     cdef DataType valueType
 *     cdef Order order
 *     status = cusparseDnMatGet(<DnMatDescr>desc, &rows, &cols, &ld,             # <<<<<<<<<<<<<<
 *                               <void**>&values, &valueType, &order)
 *     check_status(status)
 */
  __pyx_v_status = cusparseDnMatGet(((cusparseDnMatDescr_t)__pyx_v_desc), (&__pyx_v_rows), (&__pyx_v_cols), (&__pyx_v_ld), ((void **)(&__pyx_v_values)), (&__pyx_v_valueType), (&__pyx_v_order));

  /* "cupy/cuda/cusparse.pyx":4096
 *     status = cusparseDnMatGet(<DnMatDescr>desc, &rows, &cols, &ld,
 *                               <void**>&values, &valueType, &order)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return DnMatAttributes(rows, cols, ld, values, valueType, order)
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4097
 *                               <void**>&values, &valueType, &order)
 *     check_status(status)
 *     return DnMatAttributes(rows, cols, ld, values, valueType, order)             # <<<<<<<<<<<<<<
 * 
 * cpdef intptr_t dnMatGetValues(size_t desc):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_cols); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_ld); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_cudaDataType(__pyx_v_valueType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_From_cusparseOrder_t(__pyx_v_order); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_6);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4cupy_4cuda_8cusparse_DnMatAttributes), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":4089
 *     check_status(status)
 * 
 * cpdef dnMatGet(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef int64_t rows, cols, ld
 *     cdef intptr_t values,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnMatGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_471dnMatGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_470dnMatGet[] = "dnMatGet(size_t desc)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_471dnMatGet(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnMatGet (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4089, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnMatGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_470dnMatGet(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_470dnMatGet(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnMatGet", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dnMatGet(__pyx_v_desc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnMatGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4099
 *     return DnMatAttributes(rows, cols, ld, values, valueType, order)
 * 
 * cpdef intptr_t dnMatGetValues(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef intptr_t values
 *     status = cusparseDnMatGetValues(<DnMatDescr>desc, <void**>&values)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_473dnMatGetValues(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static intptr_t __pyx_f_4cupy_4cuda_8cusparse_dnMatGetValues(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  intptr_t __pyx_v_values;
  cusparseStatus_t __pyx_v_status;
  intptr_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnMatGetValues", 0);

  /* "cupy/cuda/cusparse.pyx":4101
 * cpdef intptr_t dnMatGetValues(size_t desc):
 *     cdef intptr_t values
 *     status = cusparseDnMatGetValues(<DnMatDescr>desc, <void**>&values)             # <<<<<<<<<<<<<<
 *     check_status(status)
 *     return values
 */
  __pyx_v_status = cusparseDnMatGetValues(((cusparseDnMatDescr_t)__pyx_v_desc), ((void **)(&__pyx_v_values)));

  /* "cupy/cuda/cusparse.pyx":4102
 *     cdef intptr_t values
 *     status = cusparseDnMatGetValues(<DnMatDescr>desc, <void**>&values)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return values
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4103
 *     status = cusparseDnMatGetValues(<DnMatDescr>desc, <void**>&values)
 *     check_status(status)
 *     return values             # <<<<<<<<<<<<<<
 * 
 * cpdef dnMatSetValues(size_t desc, intptr_t values):
 */
  __pyx_r = __pyx_v_values;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":4099
 *     return DnMatAttributes(rows, cols, ld, values, valueType, order)
 * 
 * cpdef intptr_t dnMatGetValues(size_t desc):             # <<<<<<<<<<<<<<
 *     cdef intptr_t values
 *     status = cusparseDnMatGetValues(<DnMatDescr>desc, <void**>&values)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.dnMatGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_473dnMatGetValues(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_472dnMatGetValues[] = "dnMatGetValues(size_t desc) -> intptr_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_473dnMatGetValues(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnMatGetValues (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4099, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnMatGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_472dnMatGetValues(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_472dnMatGetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnMatGetValues", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_f_4cupy_4cuda_8cusparse_dnMatGetValues(__pyx_v_desc, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnMatGetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4105
 *     return values
 * 
 * cpdef dnMatSetValues(size_t desc, intptr_t values):             # <<<<<<<<<<<<<<
 *     status = cusparseDnMatSetValues(<DnMatDescr>desc, <void*>values)
 *     check_status(status)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_475dnMatSetValues(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dnMatSetValues(size_t __pyx_v_desc, intptr_t __pyx_v_values, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnMatSetValues", 0);

  /* "cupy/cuda/cusparse.pyx":4106
 * 
 * cpdef dnMatSetValues(size_t desc, intptr_t values):
 *     status = cusparseDnMatSetValues(<DnMatDescr>desc, <void*>values)             # <<<<<<<<<<<<<<
 *     check_status(status)
 * 
 */
  __pyx_v_status = cusparseDnMatSetValues(((cusparseDnMatDescr_t)__pyx_v_desc), ((void *)__pyx_v_values));

  /* "cupy/cuda/cusparse.pyx":4107
 * cpdef dnMatSetValues(size_t desc, intptr_t values):
 *     status = cusparseDnMatSetValues(<DnMatDescr>desc, <void*>values)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef DnMatBatchAttributes dnMatGetStridedBatch(size_t desc):
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4105
 *     return values
 * 
 * cpdef dnMatSetValues(size_t desc, intptr_t values):             # <<<<<<<<<<<<<<
 *     status = cusparseDnMatSetValues(<DnMatDescr>desc, <void*>values)
 *     check_status(status)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnMatSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_475dnMatSetValues(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_474dnMatSetValues[] = "dnMatSetValues(size_t desc, intptr_t values)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_475dnMatSetValues(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_desc;
  intptr_t __pyx_v_values;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnMatSetValues (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_desc,&__pyx_n_s_values,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_desc)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnMatSetValues", 1, 2, 2, 1); __PYX_ERR(0, 4105, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dnMatSetValues") < 0)) __PYX_ERR(0, 4105, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_desc = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4105, __pyx_L3_error)
    __pyx_v_values = PyInt_AsSsize_t(values[1]); if (unlikely((__pyx_v_values == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4105, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dnMatSetValues", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4105, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnMatSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_474dnMatSetValues(__pyx_self, __pyx_v_desc, __pyx_v_values);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_474dnMatSetValues(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, intptr_t __pyx_v_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnMatSetValues", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dnMatSetValues(__pyx_v_desc, __pyx_v_values, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnMatSetValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4109
 *     check_status(status)
 * 
 * cpdef DnMatBatchAttributes dnMatGetStridedBatch(size_t desc):             # <<<<<<<<<<<<<<
 *     cpdef int batchCount
 *     cpdef int64_t batchStride
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_477dnMatGetStridedBatch(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_f_4cupy_4cuda_8cusparse_dnMatGetStridedBatch(size_t __pyx_v_desc, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_batchCount;
  int64_t __pyx_v_batchStride;
  cusparseStatus_t __pyx_v_status;
  struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnMatGetStridedBatch", 0);

  /* "cupy/cuda/cusparse.pyx":4112
 *     cpdef int batchCount
 *     cpdef int64_t batchStride
 *     status = cusparseDnMatGetStridedBatch(<DnMatDescr>desc, &batchCount,             # <<<<<<<<<<<<<<
 *                                           &batchStride)
 *     check_status(status)
 */
  __pyx_v_status = cusparseDnMatGetStridedBatch(((cusparseDnMatDescr_t)__pyx_v_desc), (&__pyx_v_batchCount), (&__pyx_v_batchStride));

  /* "cupy/cuda/cusparse.pyx":4114
 *     status = cusparseDnMatGetStridedBatch(<DnMatDescr>desc, &batchCount,
 *                                           &batchStride)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return DnMatBatchAttributes(batchCount, batchStride)
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4115
 *                                           &batchStride)
 *     check_status(status)
 *     return DnMatBatchAttributes(batchCount, batchStride)             # <<<<<<<<<<<<<<
 * 
 * cpdef dnMatSetStridedBatch(size_t desc, int batchCount, int64_t batchStride):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_batchCount); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_batchStride); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4cupy_4cuda_8cusparse_DnMatBatchAttributes), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = ((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":4109
 *     check_status(status)
 * 
 * cpdef DnMatBatchAttributes dnMatGetStridedBatch(size_t desc):             # <<<<<<<<<<<<<<
 *     cpdef int batchCount
 *     cpdef int64_t batchStride
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnMatGetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_477dnMatGetStridedBatch(PyObject *__pyx_self, PyObject *__pyx_arg_desc); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_476dnMatGetStridedBatch[] = "dnMatGetStridedBatch(size_t desc) -> DnMatBatchAttributes";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_477dnMatGetStridedBatch(PyObject *__pyx_self, PyObject *__pyx_arg_desc) {
  size_t __pyx_v_desc;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnMatGetStridedBatch (wrapper)", 0);
  assert(__pyx_arg_desc); {
    __pyx_v_desc = __Pyx_PyInt_As_size_t(__pyx_arg_desc); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4109, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnMatGetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_476dnMatGetStridedBatch(__pyx_self, ((size_t)__pyx_v_desc));

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_476dnMatGetStridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnMatGetStridedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4cupy_4cuda_8cusparse_dnMatGetStridedBatch(__pyx_v_desc, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnMatGetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4117
 *     return DnMatBatchAttributes(batchCount, batchStride)
 * 
 * cpdef dnMatSetStridedBatch(size_t desc, int batchCount, int64_t batchStride):             # <<<<<<<<<<<<<<
 *     status = cusparseDnMatSetStridedBatch(<DnMatDescr>desc, batchCount,
 *                                           batchStride)
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_479dnMatSetStridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_dnMatSetStridedBatch(size_t __pyx_v_desc, int __pyx_v_batchCount, int64_t __pyx_v_batchStride, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnMatSetStridedBatch", 0);

  /* "cupy/cuda/cusparse.pyx":4118
 * 
 * cpdef dnMatSetStridedBatch(size_t desc, int batchCount, int64_t batchStride):
 *     status = cusparseDnMatSetStridedBatch(<DnMatDescr>desc, batchCount,             # <<<<<<<<<<<<<<
 *                                           batchStride)
 *     check_status(status)
 */
  __pyx_v_status = cusparseDnMatSetStridedBatch(((cusparseDnMatDescr_t)__pyx_v_desc), __pyx_v_batchCount, __pyx_v_batchStride);

  /* "cupy/cuda/cusparse.pyx":4120
 *     status = cusparseDnMatSetStridedBatch(<DnMatDescr>desc, batchCount,
 *                                           batchStride)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * ############################################################
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4117
 *     return DnMatBatchAttributes(batchCount, batchStride)
 * 
 * cpdef dnMatSetStridedBatch(size_t desc, int batchCount, int64_t batchStride):             # <<<<<<<<<<<<<<
 *     status = cusparseDnMatSetStridedBatch(<DnMatDescr>desc, batchCount,
 *                                           batchStride)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnMatSetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_479dnMatSetStridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_478dnMatSetStridedBatch[] = "dnMatSetStridedBatch(size_t desc, int batchCount, int64_t batchStride)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_479dnMatSetStridedBatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  size_t __pyx_v_desc;
  int __pyx_v_batchCount;
  int64_t __pyx_v_batchStride;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dnMatSetStridedBatch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_desc,&__pyx_n_s_batchCount,&__pyx_n_s_batchStride,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_desc)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchCount)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnMatSetStridedBatch", 1, 3, 3, 1); __PYX_ERR(0, 4117, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchStride)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dnMatSetStridedBatch", 1, 3, 3, 2); __PYX_ERR(0, 4117, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dnMatSetStridedBatch") < 0)) __PYX_ERR(0, 4117, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_desc = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_desc == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4117, __pyx_L3_error)
    __pyx_v_batchCount = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_batchCount == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4117, __pyx_L3_error)
    __pyx_v_batchStride = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_batchStride == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4117, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dnMatSetStridedBatch", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4117, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnMatSetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_478dnMatSetStridedBatch(__pyx_self, __pyx_v_desc, __pyx_v_batchCount, __pyx_v_batchStride);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_478dnMatSetStridedBatch(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_desc, int __pyx_v_batchCount, int64_t __pyx_v_batchStride) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dnMatSetStridedBatch", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_dnMatSetStridedBatch(__pyx_v_desc, __pyx_v_batchCount, __pyx_v_batchStride, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.dnMatSetStridedBatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4125
 * # Generic API Functions
 * 
 * cpdef size_t spVV_bufferSize(intptr_t handle, Operation opX,             # <<<<<<<<<<<<<<
 *                              size_t vecX, size_t vecY,
 *                              intptr_t result, DataType computeType):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_481spVV_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_spVV_bufferSize(intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opX, size_t __pyx_v_vecX, size_t __pyx_v_vecY, intptr_t __pyx_v_result, cudaDataType __pyx_v_computeType, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSize;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spVV_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":4129
 *                              intptr_t result, DataType computeType):
 *     cpdef size_t bufferSize
 *     status = cusparseSpVV_bufferSize(<Handle>handle, opX,             # <<<<<<<<<<<<<<
 *                                      <SpVecDescr>vecX, <DnVecDescr>vecY,
 *                                      <void*>result, computeType, &bufferSize)
 */
  __pyx_v_status = cusparseSpVV_bufferSize(((cusparseHandle_t)__pyx_v_handle), __pyx_v_opX, ((cusparseSpVecDescr_t)__pyx_v_vecX), ((cusparseDnVecDescr_t)__pyx_v_vecY), ((void *)__pyx_v_result), __pyx_v_computeType, (&__pyx_v_bufferSize));

  /* "cupy/cuda/cusparse.pyx":4132
 *                                      <SpVecDescr>vecX, <DnVecDescr>vecY,
 *                                      <void*>result, computeType, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4133
 *                                      <void*>result, computeType, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef spVV(intptr_t handle, Operation opX, size_t vecX, size_t vecY,
 */
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":4125
 * # Generic API Functions
 * 
 * cpdef size_t spVV_bufferSize(intptr_t handle, Operation opX,             # <<<<<<<<<<<<<<
 *                              size_t vecX, size_t vecY,
 *                              intptr_t result, DataType computeType):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.spVV_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_481spVV_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_480spVV_bufferSize[] = "spVV_bufferSize(intptr_t handle, Operation opX, size_t vecX, size_t vecY, intptr_t result, DataType computeType) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_481spVV_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  intptr_t __pyx_v_handle;
  cusparseOperation_t __pyx_v_opX;
  size_t __pyx_v_vecX;
  size_t __pyx_v_vecY;
  intptr_t __pyx_v_result;
  cudaDataType __pyx_v_computeType;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spVV_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_opX,&__pyx_n_s_vecX,&__pyx_n_s_vecY,&__pyx_n_s_result,&__pyx_n_s_computeType,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opX)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spVV_bufferSize", 1, 6, 6, 1); __PYX_ERR(0, 4125, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecX)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spVV_bufferSize", 1, 6, 6, 2); __PYX_ERR(0, 4125, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecY)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spVV_bufferSize", 1, 6, 6, 3); __PYX_ERR(0, 4125, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spVV_bufferSize", 1, 6, 6, 4); __PYX_ERR(0, 4125, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_computeType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spVV_bufferSize", 1, 6, 6, 5); __PYX_ERR(0, 4125, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "spVV_bufferSize") < 0)) __PYX_ERR(0, 4125, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_handle = PyInt_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4125, __pyx_L3_error)
    __pyx_v_opX = __Pyx_PyInt_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opX == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4125, __pyx_L3_error)
    __pyx_v_vecX = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_vecX == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4126, __pyx_L3_error)
    __pyx_v_vecY = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_vecY == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4126, __pyx_L3_error)
    __pyx_v_result = PyInt_AsSsize_t(values[4]); if (unlikely((__pyx_v_result == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4127, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyInt_As_cudaDataType(values[5]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4127, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spVV_bufferSize", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4125, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.spVV_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_480spVV_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_opX, __pyx_v_vecX, __pyx_v_vecY, __pyx_v_result, __pyx_v_computeType);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_480spVV_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opX, size_t __pyx_v_vecX, size_t __pyx_v_vecY, intptr_t __pyx_v_result, cudaDataType __pyx_v_computeType) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spVV_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_spVV_bufferSize(__pyx_v_handle, __pyx_v_opX, __pyx_v_vecX, __pyx_v_vecY, __pyx_v_result, __pyx_v_computeType, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spVV_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4135
 *     return bufferSize
 * 
 * cpdef spVV(intptr_t handle, Operation opX, size_t vecX, size_t vecY,             # <<<<<<<<<<<<<<
 *            intptr_t result, DataType computeType, intptr_t externalBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_483spVV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_spVV(intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opX, size_t __pyx_v_vecX, size_t __pyx_v_vecY, intptr_t __pyx_v_result, cudaDataType __pyx_v_computeType, intptr_t __pyx_v_externalBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spVV", 0);

  /* "cupy/cuda/cusparse.pyx":4137
 * cpdef spVV(intptr_t handle, Operation opX, size_t vecX, size_t vecY,
 *            intptr_t result, DataType computeType, intptr_t externalBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseSpVV(<Handle>handle, opX, <SpVecDescr>vecX,
 *                           <DnVecDescr>vecY, <void*>result, computeType,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4138
 *            intptr_t result, DataType computeType, intptr_t externalBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseSpVV(<Handle>handle, opX, <SpVecDescr>vecX,             # <<<<<<<<<<<<<<
 *                           <DnVecDescr>vecY, <void*>result, computeType,
 *                           <void*>externalBuffer)
 */
  __pyx_v_status = cusparseSpVV(((cusparseHandle_t)__pyx_v_handle), __pyx_v_opX, ((cusparseSpVecDescr_t)__pyx_v_vecX), ((cusparseDnVecDescr_t)__pyx_v_vecY), ((void *)__pyx_v_result), __pyx_v_computeType, ((void *)__pyx_v_externalBuffer));

  /* "cupy/cuda/cusparse.pyx":4141
 *                           <DnVecDescr>vecY, <void*>result, computeType,
 *                           <void*>externalBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t spMV_bufferSize(intptr_t handle, Operation opA, intptr_t alpha,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4135
 *     return bufferSize
 * 
 * cpdef spVV(intptr_t handle, Operation opX, size_t vecX, size_t vecY,             # <<<<<<<<<<<<<<
 *            intptr_t result, DataType computeType, intptr_t externalBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spVV", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_483spVV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_482spVV[] = "spVV(intptr_t handle, Operation opX, size_t vecX, size_t vecY, intptr_t result, DataType computeType, intptr_t externalBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_483spVV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  intptr_t __pyx_v_handle;
  cusparseOperation_t __pyx_v_opX;
  size_t __pyx_v_vecX;
  size_t __pyx_v_vecY;
  intptr_t __pyx_v_result;
  cudaDataType __pyx_v_computeType;
  intptr_t __pyx_v_externalBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spVV (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_opX,&__pyx_n_s_vecX,&__pyx_n_s_vecY,&__pyx_n_s_result,&__pyx_n_s_computeType,&__pyx_n_s_externalBuffer,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opX)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spVV", 1, 7, 7, 1); __PYX_ERR(0, 4135, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecX)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spVV", 1, 7, 7, 2); __PYX_ERR(0, 4135, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecY)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spVV", 1, 7, 7, 3); __PYX_ERR(0, 4135, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spVV", 1, 7, 7, 4); __PYX_ERR(0, 4135, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_computeType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spVV", 1, 7, 7, 5); __PYX_ERR(0, 4135, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_externalBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spVV", 1, 7, 7, 6); __PYX_ERR(0, 4135, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "spVV") < 0)) __PYX_ERR(0, 4135, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_handle = PyInt_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4135, __pyx_L3_error)
    __pyx_v_opX = __Pyx_PyInt_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opX == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4135, __pyx_L3_error)
    __pyx_v_vecX = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_vecX == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4135, __pyx_L3_error)
    __pyx_v_vecY = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_vecY == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4135, __pyx_L3_error)
    __pyx_v_result = PyInt_AsSsize_t(values[4]); if (unlikely((__pyx_v_result == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4136, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyInt_As_cudaDataType(values[5]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4136, __pyx_L3_error)
    __pyx_v_externalBuffer = PyInt_AsSsize_t(values[6]); if (unlikely((__pyx_v_externalBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4136, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spVV", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4135, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.spVV", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_482spVV(__pyx_self, __pyx_v_handle, __pyx_v_opX, __pyx_v_vecX, __pyx_v_vecY, __pyx_v_result, __pyx_v_computeType, __pyx_v_externalBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_482spVV(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opX, size_t __pyx_v_vecX, size_t __pyx_v_vecY, intptr_t __pyx_v_result, cudaDataType __pyx_v_computeType, intptr_t __pyx_v_externalBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spVV", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_spVV(__pyx_v_handle, __pyx_v_opX, __pyx_v_vecX, __pyx_v_vecY, __pyx_v_result, __pyx_v_computeType, __pyx_v_externalBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spVV", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4143
 *     check_status(status)
 * 
 * cpdef size_t spMV_bufferSize(intptr_t handle, Operation opA, intptr_t alpha,             # <<<<<<<<<<<<<<
 *                              size_t matA, size_t vecX, intptr_t beta,
 *                              size_t vecY, DataType computeType, SpMVAlg alg):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_485spMV_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_spMV_bufferSize(intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_vecX, intptr_t __pyx_v_beta, size_t __pyx_v_vecY, cudaDataType __pyx_v_computeType, cusparseSpMVAlg_t __pyx_v_alg, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSize;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMV_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":4147
 *                              size_t vecY, DataType computeType, SpMVAlg alg):
 *     cpdef size_t bufferSize
 *     status = cusparseSpMV_bufferSize(<Handle>handle, opA, <void*>alpha,             # <<<<<<<<<<<<<<
 *                                      <SpMatDescr>matA, <DnVecDescr>vecX,
 *                                      <void*>beta, <DnVecDescr>vecY,
 */
  __pyx_v_status = cusparseSpMV_bufferSize(((cusparseHandle_t)__pyx_v_handle), __pyx_v_opA, ((void *)__pyx_v_alpha), ((cusparseSpMatDescr_t)__pyx_v_matA), ((cusparseDnVecDescr_t)__pyx_v_vecX), ((void *)__pyx_v_beta), ((cusparseDnVecDescr_t)__pyx_v_vecY), __pyx_v_computeType, __pyx_v_alg, (&__pyx_v_bufferSize));

  /* "cupy/cuda/cusparse.pyx":4151
 *                                      <void*>beta, <DnVecDescr>vecY,
 *                                      computeType, alg, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4152
 *                                      computeType, alg, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef spMV(intptr_t handle, Operation opA, intptr_t alpha, size_t matA,
 */
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":4143
 *     check_status(status)
 * 
 * cpdef size_t spMV_bufferSize(intptr_t handle, Operation opA, intptr_t alpha,             # <<<<<<<<<<<<<<
 *                              size_t matA, size_t vecX, intptr_t beta,
 *                              size_t vecY, DataType computeType, SpMVAlg alg):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.spMV_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_485spMV_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_484spMV_bufferSize[] = "spMV_bufferSize(intptr_t handle, Operation opA, intptr_t alpha, size_t matA, size_t vecX, intptr_t beta, size_t vecY, DataType computeType, SpMVAlg alg) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_485spMV_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  intptr_t __pyx_v_handle;
  cusparseOperation_t __pyx_v_opA;
  intptr_t __pyx_v_alpha;
  size_t __pyx_v_matA;
  size_t __pyx_v_vecX;
  intptr_t __pyx_v_beta;
  size_t __pyx_v_vecY;
  cudaDataType __pyx_v_computeType;
  cusparseSpMVAlg_t __pyx_v_alg;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMV_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_opA,&__pyx_n_s_alpha,&__pyx_n_s_matA,&__pyx_n_s_vecX,&__pyx_n_s_beta,&__pyx_n_s_vecY,&__pyx_n_s_computeType,&__pyx_n_s_alg,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV_bufferSize", 1, 9, 9, 1); __PYX_ERR(0, 4143, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV_bufferSize", 1, 9, 9, 2); __PYX_ERR(0, 4143, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV_bufferSize", 1, 9, 9, 3); __PYX_ERR(0, 4143, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecX)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV_bufferSize", 1, 9, 9, 4); __PYX_ERR(0, 4143, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV_bufferSize", 1, 9, 9, 5); __PYX_ERR(0, 4143, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecY)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV_bufferSize", 1, 9, 9, 6); __PYX_ERR(0, 4143, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_computeType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV_bufferSize", 1, 9, 9, 7); __PYX_ERR(0, 4143, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV_bufferSize", 1, 9, 9, 8); __PYX_ERR(0, 4143, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "spMV_bufferSize") < 0)) __PYX_ERR(0, 4143, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = PyInt_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4143, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyInt_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4143, __pyx_L3_error)
    __pyx_v_alpha = PyInt_AsSsize_t(values[2]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4143, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4144, __pyx_L3_error)
    __pyx_v_vecX = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_vecX == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4144, __pyx_L3_error)
    __pyx_v_beta = PyInt_AsSsize_t(values[5]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4144, __pyx_L3_error)
    __pyx_v_vecY = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_vecY == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4145, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyInt_As_cudaDataType(values[7]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4145, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyInt_As_cusparseSpMVAlg_t(values[8]); if (unlikely((__pyx_v_alg == ((cusparseSpMVAlg_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4145, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMV_bufferSize", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4143, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMV_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_484spMV_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_opA, __pyx_v_alpha, __pyx_v_matA, __pyx_v_vecX, __pyx_v_beta, __pyx_v_vecY, __pyx_v_computeType, __pyx_v_alg);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_484spMV_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_vecX, intptr_t __pyx_v_beta, size_t __pyx_v_vecY, cudaDataType __pyx_v_computeType, cusparseSpMVAlg_t __pyx_v_alg) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMV_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_spMV_bufferSize(__pyx_v_handle, __pyx_v_opA, __pyx_v_alpha, __pyx_v_matA, __pyx_v_vecX, __pyx_v_beta, __pyx_v_vecY, __pyx_v_computeType, __pyx_v_alg, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMV_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4154
 *     return bufferSize
 * 
 * cpdef spMV(intptr_t handle, Operation opA, intptr_t alpha, size_t matA,             # <<<<<<<<<<<<<<
 *            size_t vecX, intptr_t beta, size_t vecY, DataType computeType,
 *            SpMVAlg alg, intptr_t externalBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_487spMV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_spMV(intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_vecX, intptr_t __pyx_v_beta, size_t __pyx_v_vecY, cudaDataType __pyx_v_computeType, cusparseSpMVAlg_t __pyx_v_alg, intptr_t __pyx_v_externalBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMV", 0);

  /* "cupy/cuda/cusparse.pyx":4157
 *            size_t vecX, intptr_t beta, size_t vecY, DataType computeType,
 *            SpMVAlg alg, intptr_t externalBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseSpMV(<Handle>handle, opA, <void*>alpha, <SpMatDescr>matA,
 *                           <DnVecDescr>vecX, <void*>beta, <DnVecDescr>vecY,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4158
 *            SpMVAlg alg, intptr_t externalBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseSpMV(<Handle>handle, opA, <void*>alpha, <SpMatDescr>matA,             # <<<<<<<<<<<<<<
 *                           <DnVecDescr>vecX, <void*>beta, <DnVecDescr>vecY,
 *                           computeType, alg, <void*>externalBuffer)
 */
  __pyx_v_status = cusparseSpMV(((cusparseHandle_t)__pyx_v_handle), __pyx_v_opA, ((void *)__pyx_v_alpha), ((cusparseSpMatDescr_t)__pyx_v_matA), ((cusparseDnVecDescr_t)__pyx_v_vecX), ((void *)__pyx_v_beta), ((cusparseDnVecDescr_t)__pyx_v_vecY), __pyx_v_computeType, __pyx_v_alg, ((void *)__pyx_v_externalBuffer));

  /* "cupy/cuda/cusparse.pyx":4161
 *                           <DnVecDescr>vecX, <void*>beta, <DnVecDescr>vecY,
 *                           computeType, alg, <void*>externalBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t spMM_bufferSize(intptr_t handle, Operation opA, Operation opB,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4154
 *     return bufferSize
 * 
 * cpdef spMV(intptr_t handle, Operation opA, intptr_t alpha, size_t matA,             # <<<<<<<<<<<<<<
 *            size_t vecX, intptr_t beta, size_t vecY, DataType computeType,
 *            SpMVAlg alg, intptr_t externalBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMV", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_487spMV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_486spMV[] = "spMV(intptr_t handle, Operation opA, intptr_t alpha, size_t matA, size_t vecX, intptr_t beta, size_t vecY, DataType computeType, SpMVAlg alg, intptr_t externalBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_487spMV(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  intptr_t __pyx_v_handle;
  cusparseOperation_t __pyx_v_opA;
  intptr_t __pyx_v_alpha;
  size_t __pyx_v_matA;
  size_t __pyx_v_vecX;
  intptr_t __pyx_v_beta;
  size_t __pyx_v_vecY;
  cudaDataType __pyx_v_computeType;
  cusparseSpMVAlg_t __pyx_v_alg;
  intptr_t __pyx_v_externalBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMV (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_opA,&__pyx_n_s_alpha,&__pyx_n_s_matA,&__pyx_n_s_vecX,&__pyx_n_s_beta,&__pyx_n_s_vecY,&__pyx_n_s_computeType,&__pyx_n_s_alg,&__pyx_n_s_externalBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV", 1, 10, 10, 1); __PYX_ERR(0, 4154, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV", 1, 10, 10, 2); __PYX_ERR(0, 4154, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV", 1, 10, 10, 3); __PYX_ERR(0, 4154, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecX)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV", 1, 10, 10, 4); __PYX_ERR(0, 4154, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV", 1, 10, 10, 5); __PYX_ERR(0, 4154, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecY)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV", 1, 10, 10, 6); __PYX_ERR(0, 4154, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_computeType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV", 1, 10, 10, 7); __PYX_ERR(0, 4154, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV", 1, 10, 10, 8); __PYX_ERR(0, 4154, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_externalBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMV", 1, 10, 10, 9); __PYX_ERR(0, 4154, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "spMV") < 0)) __PYX_ERR(0, 4154, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = PyInt_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4154, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyInt_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4154, __pyx_L3_error)
    __pyx_v_alpha = PyInt_AsSsize_t(values[2]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4154, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyInt_As_size_t(values[3]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4154, __pyx_L3_error)
    __pyx_v_vecX = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_vecX == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4155, __pyx_L3_error)
    __pyx_v_beta = PyInt_AsSsize_t(values[5]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4155, __pyx_L3_error)
    __pyx_v_vecY = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_vecY == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4155, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyInt_As_cudaDataType(values[7]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4155, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyInt_As_cusparseSpMVAlg_t(values[8]); if (unlikely((__pyx_v_alg == ((cusparseSpMVAlg_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4156, __pyx_L3_error)
    __pyx_v_externalBuffer = PyInt_AsSsize_t(values[9]); if (unlikely((__pyx_v_externalBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4156, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMV", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4154, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMV", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_486spMV(__pyx_self, __pyx_v_handle, __pyx_v_opA, __pyx_v_alpha, __pyx_v_matA, __pyx_v_vecX, __pyx_v_beta, __pyx_v_vecY, __pyx_v_computeType, __pyx_v_alg, __pyx_v_externalBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_486spMV(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_vecX, intptr_t __pyx_v_beta, size_t __pyx_v_vecY, cudaDataType __pyx_v_computeType, cusparseSpMVAlg_t __pyx_v_alg, intptr_t __pyx_v_externalBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMV", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_spMV(__pyx_v_handle, __pyx_v_opA, __pyx_v_alpha, __pyx_v_matA, __pyx_v_vecX, __pyx_v_beta, __pyx_v_vecY, __pyx_v_computeType, __pyx_v_alg, __pyx_v_externalBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMV", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4163
 *     check_status(status)
 * 
 * cpdef size_t spMM_bufferSize(intptr_t handle, Operation opA, Operation opB,             # <<<<<<<<<<<<<<
 *                              intptr_t alpha, size_t matA, size_t matB,
 *                              intptr_t beta, size_t matC, DataType computeType,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_489spMM_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_spMM_bufferSize(intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, cusparseOperation_t __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_matB, intptr_t __pyx_v_beta, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, cusparseSpMMAlg_t __pyx_v_alg, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSize;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMM_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":4168
 *                              SpMMAlg alg):
 *     cpdef size_t bufferSize
 *     status = cusparseSpMM_bufferSize(<Handle>handle, opA, opB, <void*>alpha,             # <<<<<<<<<<<<<<
 *                                      <SpMatDescr>matA, <DnMatDescr>matB,
 *                                      <void*>beta, <DnMatDescr>matC,
 */
  __pyx_v_status = cusparseSpMM_bufferSize(((cusparseHandle_t)__pyx_v_handle), __pyx_v_opA, __pyx_v_opB, ((void *)__pyx_v_alpha), ((cusparseSpMatDescr_t)__pyx_v_matA), ((cusparseDnMatDescr_t)__pyx_v_matB), ((void *)__pyx_v_beta), ((cusparseDnMatDescr_t)__pyx_v_matC), __pyx_v_computeType, __pyx_v_alg, (&__pyx_v_bufferSize));

  /* "cupy/cuda/cusparse.pyx":4172
 *                                      <void*>beta, <DnMatDescr>matC,
 *                                      computeType, alg, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4173
 *                                      computeType, alg, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef spMM(intptr_t handle, Operation opA, Operation opB, intptr_t alpha,
 */
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":4163
 *     check_status(status)
 * 
 * cpdef size_t spMM_bufferSize(intptr_t handle, Operation opA, Operation opB,             # <<<<<<<<<<<<<<
 *                              intptr_t alpha, size_t matA, size_t matB,
 *                              intptr_t beta, size_t matC, DataType computeType,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.spMM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_489spMM_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_488spMM_bufferSize[] = "spMM_bufferSize(intptr_t handle, Operation opA, Operation opB, intptr_t alpha, size_t matA, size_t matB, intptr_t beta, size_t matC, DataType computeType, SpMMAlg alg) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_489spMM_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  intptr_t __pyx_v_handle;
  cusparseOperation_t __pyx_v_opA;
  cusparseOperation_t __pyx_v_opB;
  intptr_t __pyx_v_alpha;
  size_t __pyx_v_matA;
  size_t __pyx_v_matB;
  intptr_t __pyx_v_beta;
  size_t __pyx_v_matC;
  cudaDataType __pyx_v_computeType;
  cusparseSpMMAlg_t __pyx_v_alg;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMM_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_opA,&__pyx_n_s_opB,&__pyx_n_s_alpha,&__pyx_n_s_matA,&__pyx_n_s_matB,&__pyx_n_s_beta,&__pyx_n_s_matC,&__pyx_n_s_computeType,&__pyx_n_s_alg,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM_bufferSize", 1, 10, 10, 1); __PYX_ERR(0, 4163, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM_bufferSize", 1, 10, 10, 2); __PYX_ERR(0, 4163, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM_bufferSize", 1, 10, 10, 3); __PYX_ERR(0, 4163, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM_bufferSize", 1, 10, 10, 4); __PYX_ERR(0, 4163, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM_bufferSize", 1, 10, 10, 5); __PYX_ERR(0, 4163, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM_bufferSize", 1, 10, 10, 6); __PYX_ERR(0, 4163, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM_bufferSize", 1, 10, 10, 7); __PYX_ERR(0, 4163, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_computeType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM_bufferSize", 1, 10, 10, 8); __PYX_ERR(0, 4163, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM_bufferSize", 1, 10, 10, 9); __PYX_ERR(0, 4163, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "spMM_bufferSize") < 0)) __PYX_ERR(0, 4163, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = PyInt_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4163, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyInt_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4163, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyInt_As_cusparseOperation_t(values[2]); if (unlikely((__pyx_v_opB == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4163, __pyx_L3_error)
    __pyx_v_alpha = PyInt_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4164, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4164, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4164, __pyx_L3_error)
    __pyx_v_beta = PyInt_AsSsize_t(values[6]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4165, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4165, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyInt_As_cudaDataType(values[8]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4165, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyInt_As_cusparseSpMMAlg_t(values[9]); if (unlikely((__pyx_v_alg == ((cusparseSpMMAlg_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4166, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMM_bufferSize", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4163, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_488spMM_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_matB, __pyx_v_beta, __pyx_v_matC, __pyx_v_computeType, __pyx_v_alg);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_488spMM_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, cusparseOperation_t __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_matB, intptr_t __pyx_v_beta, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, cusparseSpMMAlg_t __pyx_v_alg) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMM_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_spMM_bufferSize(__pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_matB, __pyx_v_beta, __pyx_v_matC, __pyx_v_computeType, __pyx_v_alg, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4175
 *     return bufferSize
 * 
 * cpdef spMM(intptr_t handle, Operation opA, Operation opB, intptr_t alpha,             # <<<<<<<<<<<<<<
 *            size_t matA, size_t matB, intptr_t beta, size_t matC,
 *            DataType computeType, SpMMAlg alg, intptr_t externalBuffer):
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_491spMM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_spMM(intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, cusparseOperation_t __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_matB, intptr_t __pyx_v_beta, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, cusparseSpMMAlg_t __pyx_v_alg, intptr_t __pyx_v_externalBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMM", 0);

  /* "cupy/cuda/cusparse.pyx":4178
 *            size_t matA, size_t matB, intptr_t beta, size_t matC,
 *            DataType computeType, SpMMAlg alg, intptr_t externalBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseSpMM(<Handle>handle, opA, opB, <void*>alpha,
 *                           <SpMatDescr>matA, <DnMatDescr>matB, <void*>beta,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4179
 *            DataType computeType, SpMMAlg alg, intptr_t externalBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseSpMM(<Handle>handle, opA, opB, <void*>alpha,             # <<<<<<<<<<<<<<
 *                           <SpMatDescr>matA, <DnMatDescr>matB, <void*>beta,
 *                           <DnMatDescr>matC, computeType, alg,
 */
  __pyx_v_status = cusparseSpMM(((cusparseHandle_t)__pyx_v_handle), __pyx_v_opA, __pyx_v_opB, ((void *)__pyx_v_alpha), ((cusparseSpMatDescr_t)__pyx_v_matA), ((cusparseDnMatDescr_t)__pyx_v_matB), ((void *)__pyx_v_beta), ((cusparseDnMatDescr_t)__pyx_v_matC), __pyx_v_computeType, __pyx_v_alg, ((void *)__pyx_v_externalBuffer));

  /* "cupy/cuda/cusparse.pyx":4183
 *                           <DnMatDescr>matC, computeType, alg,
 *                           <void*>externalBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * cpdef size_t constrainedGeMM_bufferSize(intptr_t handle, Operation opA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4175
 *     return bufferSize
 * 
 * cpdef spMM(intptr_t handle, Operation opA, Operation opB, intptr_t alpha,             # <<<<<<<<<<<<<<
 *            size_t matA, size_t matB, intptr_t beta, size_t matC,
 *            DataType computeType, SpMMAlg alg, intptr_t externalBuffer):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_491spMM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_490spMM[] = "spMM(intptr_t handle, Operation opA, Operation opB, intptr_t alpha, size_t matA, size_t matB, intptr_t beta, size_t matC, DataType computeType, SpMMAlg alg, intptr_t externalBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_491spMM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  intptr_t __pyx_v_handle;
  cusparseOperation_t __pyx_v_opA;
  cusparseOperation_t __pyx_v_opB;
  intptr_t __pyx_v_alpha;
  size_t __pyx_v_matA;
  size_t __pyx_v_matB;
  intptr_t __pyx_v_beta;
  size_t __pyx_v_matC;
  cudaDataType __pyx_v_computeType;
  cusparseSpMMAlg_t __pyx_v_alg;
  intptr_t __pyx_v_externalBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("spMM (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_opA,&__pyx_n_s_opB,&__pyx_n_s_alpha,&__pyx_n_s_matA,&__pyx_n_s_matB,&__pyx_n_s_beta,&__pyx_n_s_matC,&__pyx_n_s_computeType,&__pyx_n_s_alg,&__pyx_n_s_externalBuffer,0};
    PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM", 1, 11, 11, 1); __PYX_ERR(0, 4175, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM", 1, 11, 11, 2); __PYX_ERR(0, 4175, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM", 1, 11, 11, 3); __PYX_ERR(0, 4175, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM", 1, 11, 11, 4); __PYX_ERR(0, 4175, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM", 1, 11, 11, 5); __PYX_ERR(0, 4175, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM", 1, 11, 11, 6); __PYX_ERR(0, 4175, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM", 1, 11, 11, 7); __PYX_ERR(0, 4175, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_computeType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM", 1, 11, 11, 8); __PYX_ERR(0, 4175, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM", 1, 11, 11, 9); __PYX_ERR(0, 4175, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_externalBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("spMM", 1, 11, 11, 10); __PYX_ERR(0, 4175, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "spMM") < 0)) __PYX_ERR(0, 4175, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 11) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
    }
    __pyx_v_handle = PyInt_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4175, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyInt_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4175, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyInt_As_cusparseOperation_t(values[2]); if (unlikely((__pyx_v_opB == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4175, __pyx_L3_error)
    __pyx_v_alpha = PyInt_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4175, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4176, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4176, __pyx_L3_error)
    __pyx_v_beta = PyInt_AsSsize_t(values[6]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4176, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4176, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyInt_As_cudaDataType(values[8]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4177, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyInt_As_cusparseSpMMAlg_t(values[9]); if (unlikely((__pyx_v_alg == ((cusparseSpMMAlg_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4177, __pyx_L3_error)
    __pyx_v_externalBuffer = PyInt_AsSsize_t(values[10]); if (unlikely((__pyx_v_externalBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4177, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("spMM", 1, 11, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4175, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_490spMM(__pyx_self, __pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_matB, __pyx_v_beta, __pyx_v_matC, __pyx_v_computeType, __pyx_v_alg, __pyx_v_externalBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_490spMM(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, cusparseOperation_t __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_matB, intptr_t __pyx_v_beta, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, cusparseSpMMAlg_t __pyx_v_alg, intptr_t __pyx_v_externalBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("spMM", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_spMM(__pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_matB, __pyx_v_beta, __pyx_v_matC, __pyx_v_computeType, __pyx_v_alg, __pyx_v_externalBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.spMM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4185
 *     check_status(status)
 * 
 * cpdef size_t constrainedGeMM_bufferSize(intptr_t handle, Operation opA,             # <<<<<<<<<<<<<<
 *                                         Operation opB, intptr_t alpha,
 *                                         size_t matA, size_t matB,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_493constrainedGeMM_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_constrainedGeMM_bufferSize(intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, cusparseOperation_t __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_matB, intptr_t __pyx_v_beta, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSize;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("constrainedGeMM_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":4191
 *                                         DataType computeType):
 *     cpdef size_t bufferSize
 *     status = cusparseConstrainedGeMM_bufferSize(             # <<<<<<<<<<<<<<
 *         <Handle>handle, opA, opB, <void*>alpha, <DnMatDescr>matA,
 *         <DnMatDescr>matB, <void*>beta, <SpMatDescr>matC, computeType,
 */
  __pyx_v_status = cusparseConstrainedGeMM_bufferSize(((cusparseHandle_t)__pyx_v_handle), __pyx_v_opA, __pyx_v_opB, ((void *)__pyx_v_alpha), ((cusparseDnMatDescr_t)__pyx_v_matA), ((cusparseDnMatDescr_t)__pyx_v_matB), ((void *)__pyx_v_beta), ((cusparseSpMatDescr_t)__pyx_v_matC), __pyx_v_computeType, (&__pyx_v_bufferSize));

  /* "cupy/cuda/cusparse.pyx":4195
 *         <DnMatDescr>matB, <void*>beta, <SpMatDescr>matC, computeType,
 *         &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4196
 *         &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef constrainedGeMM(intptr_t handle, Operation opA, Operation opB,
 */
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":4185
 *     check_status(status)
 * 
 * cpdef size_t constrainedGeMM_bufferSize(intptr_t handle, Operation opA,             # <<<<<<<<<<<<<<
 *                                         Operation opB, intptr_t alpha,
 *                                         size_t matA, size_t matB,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.constrainedGeMM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_493constrainedGeMM_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_492constrainedGeMM_bufferSize[] = "constrainedGeMM_bufferSize(intptr_t handle, Operation opA, Operation opB, intptr_t alpha, size_t matA, size_t matB, intptr_t beta, size_t matC, DataType computeType) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_493constrainedGeMM_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  intptr_t __pyx_v_handle;
  cusparseOperation_t __pyx_v_opA;
  cusparseOperation_t __pyx_v_opB;
  intptr_t __pyx_v_alpha;
  size_t __pyx_v_matA;
  size_t __pyx_v_matB;
  intptr_t __pyx_v_beta;
  size_t __pyx_v_matC;
  cudaDataType __pyx_v_computeType;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("constrainedGeMM_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_opA,&__pyx_n_s_opB,&__pyx_n_s_alpha,&__pyx_n_s_matA,&__pyx_n_s_matB,&__pyx_n_s_beta,&__pyx_n_s_matC,&__pyx_n_s_computeType,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM_bufferSize", 1, 9, 9, 1); __PYX_ERR(0, 4185, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM_bufferSize", 1, 9, 9, 2); __PYX_ERR(0, 4185, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM_bufferSize", 1, 9, 9, 3); __PYX_ERR(0, 4185, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM_bufferSize", 1, 9, 9, 4); __PYX_ERR(0, 4185, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM_bufferSize", 1, 9, 9, 5); __PYX_ERR(0, 4185, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM_bufferSize", 1, 9, 9, 6); __PYX_ERR(0, 4185, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM_bufferSize", 1, 9, 9, 7); __PYX_ERR(0, 4185, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_computeType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM_bufferSize", 1, 9, 9, 8); __PYX_ERR(0, 4185, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "constrainedGeMM_bufferSize") < 0)) __PYX_ERR(0, 4185, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_handle = PyInt_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4185, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyInt_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4185, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyInt_As_cusparseOperation_t(values[2]); if (unlikely((__pyx_v_opB == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4186, __pyx_L3_error)
    __pyx_v_alpha = PyInt_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4186, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4187, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4187, __pyx_L3_error)
    __pyx_v_beta = PyInt_AsSsize_t(values[6]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4188, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4188, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyInt_As_cudaDataType(values[8]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4189, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("constrainedGeMM_bufferSize", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4185, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.constrainedGeMM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_492constrainedGeMM_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_matB, __pyx_v_beta, __pyx_v_matC, __pyx_v_computeType);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_492constrainedGeMM_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, cusparseOperation_t __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_matB, intptr_t __pyx_v_beta, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("constrainedGeMM_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_constrainedGeMM_bufferSize(__pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_matB, __pyx_v_beta, __pyx_v_matC, __pyx_v_computeType, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.constrainedGeMM_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4198
 *     return bufferSize
 * 
 * cpdef constrainedGeMM(intptr_t handle, Operation opA, Operation opB,             # <<<<<<<<<<<<<<
 *                       intptr_t alpha, size_t matA, size_t matB, intptr_t beta,
 *                       size_t matC, DataType computeType,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_495constrainedGeMM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_constrainedGeMM(intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, cusparseOperation_t __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_matB, intptr_t __pyx_v_beta, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, intptr_t __pyx_v_externalBuffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("constrainedGeMM", 0);

  /* "cupy/cuda/cusparse.pyx":4202
 *                       size_t matC, DataType computeType,
 *                       intptr_t externalBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseConstrainedGeMM(
 *         <Handle>handle, opA, opB, <void*>alpha, <DnMatDescr>matA,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4203
 *                       intptr_t externalBuffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseConstrainedGeMM(             # <<<<<<<<<<<<<<
 *         <Handle>handle, opA, opB, <void*>alpha, <DnMatDescr>matA,
 *         <DnMatDescr>matB, <void*>beta, <SpMatDescr>matC, computeType,
 */
  __pyx_v_status = cusparseConstrainedGeMM(((cusparseHandle_t)__pyx_v_handle), __pyx_v_opA, __pyx_v_opB, ((void *)__pyx_v_alpha), ((cusparseDnMatDescr_t)__pyx_v_matA), ((cusparseDnMatDescr_t)__pyx_v_matB), ((void *)__pyx_v_beta), ((cusparseSpMatDescr_t)__pyx_v_matC), __pyx_v_computeType, ((void *)__pyx_v_externalBuffer));

  /* "cupy/cuda/cusparse.pyx":4207
 *         <DnMatDescr>matB, <void*>beta, <SpMatDescr>matC, computeType,
 *         <void*>externalBuffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 * 
 * # CSR2CSC
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4198
 *     return bufferSize
 * 
 * cpdef constrainedGeMM(intptr_t handle, Operation opA, Operation opB,             # <<<<<<<<<<<<<<
 *                       intptr_t alpha, size_t matA, size_t matB, intptr_t beta,
 *                       size_t matC, DataType computeType,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.constrainedGeMM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_495constrainedGeMM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_494constrainedGeMM[] = "constrainedGeMM(intptr_t handle, Operation opA, Operation opB, intptr_t alpha, size_t matA, size_t matB, intptr_t beta, size_t matC, DataType computeType, intptr_t externalBuffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_495constrainedGeMM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  intptr_t __pyx_v_handle;
  cusparseOperation_t __pyx_v_opA;
  cusparseOperation_t __pyx_v_opB;
  intptr_t __pyx_v_alpha;
  size_t __pyx_v_matA;
  size_t __pyx_v_matB;
  intptr_t __pyx_v_beta;
  size_t __pyx_v_matC;
  cudaDataType __pyx_v_computeType;
  intptr_t __pyx_v_externalBuffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("constrainedGeMM (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_opA,&__pyx_n_s_opB,&__pyx_n_s_alpha,&__pyx_n_s_matA,&__pyx_n_s_matB,&__pyx_n_s_beta,&__pyx_n_s_matC,&__pyx_n_s_computeType,&__pyx_n_s_externalBuffer,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM", 1, 10, 10, 1); __PYX_ERR(0, 4198, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM", 1, 10, 10, 2); __PYX_ERR(0, 4198, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM", 1, 10, 10, 3); __PYX_ERR(0, 4198, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matA)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM", 1, 10, 10, 4); __PYX_ERR(0, 4198, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matB)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM", 1, 10, 10, 5); __PYX_ERR(0, 4198, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM", 1, 10, 10, 6); __PYX_ERR(0, 4198, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matC)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM", 1, 10, 10, 7); __PYX_ERR(0, 4198, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_computeType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM", 1, 10, 10, 8); __PYX_ERR(0, 4198, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_externalBuffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("constrainedGeMM", 1, 10, 10, 9); __PYX_ERR(0, 4198, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "constrainedGeMM") < 0)) __PYX_ERR(0, 4198, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_handle = PyInt_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4198, __pyx_L3_error)
    __pyx_v_opA = __Pyx_PyInt_As_cusparseOperation_t(values[1]); if (unlikely((__pyx_v_opA == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4198, __pyx_L3_error)
    __pyx_v_opB = __Pyx_PyInt_As_cusparseOperation_t(values[2]); if (unlikely((__pyx_v_opB == ((cusparseOperation_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4198, __pyx_L3_error)
    __pyx_v_alpha = PyInt_AsSsize_t(values[3]); if (unlikely((__pyx_v_alpha == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4199, __pyx_L3_error)
    __pyx_v_matA = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_matA == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4199, __pyx_L3_error)
    __pyx_v_matB = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_matB == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4199, __pyx_L3_error)
    __pyx_v_beta = PyInt_AsSsize_t(values[6]); if (unlikely((__pyx_v_beta == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4199, __pyx_L3_error)
    __pyx_v_matC = __Pyx_PyInt_As_size_t(values[7]); if (unlikely((__pyx_v_matC == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4200, __pyx_L3_error)
    __pyx_v_computeType = __Pyx_PyInt_As_cudaDataType(values[8]); if (unlikely((__pyx_v_computeType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4200, __pyx_L3_error)
    __pyx_v_externalBuffer = PyInt_AsSsize_t(values[9]); if (unlikely((__pyx_v_externalBuffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4201, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("constrainedGeMM", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4198, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.constrainedGeMM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_494constrainedGeMM(__pyx_self, __pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_matB, __pyx_v_beta, __pyx_v_matC, __pyx_v_computeType, __pyx_v_externalBuffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_494constrainedGeMM(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, cusparseOperation_t __pyx_v_opA, cusparseOperation_t __pyx_v_opB, intptr_t __pyx_v_alpha, size_t __pyx_v_matA, size_t __pyx_v_matB, intptr_t __pyx_v_beta, size_t __pyx_v_matC, cudaDataType __pyx_v_computeType, intptr_t __pyx_v_externalBuffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("constrainedGeMM", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_constrainedGeMM(__pyx_v_handle, __pyx_v_opA, __pyx_v_opB, __pyx_v_alpha, __pyx_v_matA, __pyx_v_matB, __pyx_v_beta, __pyx_v_matC, __pyx_v_computeType, __pyx_v_externalBuffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.constrainedGeMM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4210
 * 
 * # CSR2CSC
 * cpdef size_t csr2cscEx2_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, intptr_t csrVal,
 *         intptr_t csrRowPtr, intptr_t csrColInd, intptr_t cscVal,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_497csr2cscEx2_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static size_t __pyx_f_4cupy_4cuda_8cusparse_csr2cscEx2_bufferSize(intptr_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, intptr_t __pyx_v_csrVal, intptr_t __pyx_v_csrRowPtr, intptr_t __pyx_v_csrColInd, intptr_t __pyx_v_cscVal, intptr_t __pyx_v_cscColPtr, intptr_t __pyx_v_cscRowInd, cudaDataType __pyx_v_valType, cusparseAction_t __pyx_v_copyValues, cusparseIndexBase_t __pyx_v_idxBase, cusparseCsr2CscAlg_t __pyx_v_alg, CYTHON_UNUSED int __pyx_skip_dispatch) {
  size_t __pyx_v_bufferSize;
  cusparseStatus_t __pyx_v_status;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("csr2cscEx2_bufferSize", 0);

  /* "cupy/cuda/cusparse.pyx":4216
 *         Action copyValues, IndexBase idxBase, Csr2CscAlg alg):
 *     cpdef size_t bufferSize
 *     status = cusparseCsr2cscEx2_bufferSize(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, nnz, <const void*>csrVal, <const int*>csrRowPtr,
 *         <const int*>csrColInd, <void*>cscVal, <int*>cscColPtr, <int*>cscRowInd,
 */
  __pyx_v_status = cusparseCsr2cscEx2_bufferSize(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((void const *)__pyx_v_csrVal), ((int const *)__pyx_v_csrRowPtr), ((int const *)__pyx_v_csrColInd), ((void *)__pyx_v_cscVal), ((int *)__pyx_v_cscColPtr), ((int *)__pyx_v_cscRowInd), __pyx_v_valType, __pyx_v_copyValues, __pyx_v_idxBase, __pyx_v_alg, (&__pyx_v_bufferSize));

  /* "cupy/cuda/cusparse.pyx":4220
 *         <const int*>csrColInd, <void*>cscVal, <int*>cscColPtr, <int*>cscRowInd,
 *         valType, copyValues, idxBase, alg, &bufferSize)
 *     check_status(status)             # <<<<<<<<<<<<<<
 *     return bufferSize
 * 
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4221
 *         valType, copyValues, idxBase, alg, &bufferSize)
 *     check_status(status)
 *     return bufferSize             # <<<<<<<<<<<<<<
 * 
 * cpdef csr2cscEx2(
 */
  __pyx_r = __pyx_v_bufferSize;
  goto __pyx_L0;

  /* "cupy/cuda/cusparse.pyx":4210
 * 
 * # CSR2CSC
 * cpdef size_t csr2cscEx2_bufferSize(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, intptr_t csrVal,
 *         intptr_t csrRowPtr, intptr_t csrColInd, intptr_t cscVal,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cupy.cuda.cusparse.csr2cscEx2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_497csr2cscEx2_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_496csr2cscEx2_bufferSize[] = "csr2cscEx2_bufferSize(intptr_t handle, int m, int n, int nnz, intptr_t csrVal, intptr_t csrRowPtr, intptr_t csrColInd, intptr_t cscVal, intptr_t cscColPtr, intptr_t cscRowInd, DataType valType, Action copyValues, IndexBase idxBase, Csr2CscAlg alg) -> size_t";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_497csr2cscEx2_bufferSize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  intptr_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  intptr_t __pyx_v_csrVal;
  intptr_t __pyx_v_csrRowPtr;
  intptr_t __pyx_v_csrColInd;
  intptr_t __pyx_v_cscVal;
  intptr_t __pyx_v_cscColPtr;
  intptr_t __pyx_v_cscRowInd;
  cudaDataType __pyx_v_valType;
  cusparseAction_t __pyx_v_copyValues;
  cusparseIndexBase_t __pyx_v_idxBase;
  cusparseCsr2CscAlg_t __pyx_v_alg;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("csr2cscEx2_bufferSize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_csrVal,&__pyx_n_s_csrRowPtr,&__pyx_n_s_csrColInd,&__pyx_n_s_cscVal,&__pyx_n_s_cscColPtr,&__pyx_n_s_cscRowInd,&__pyx_n_s_valType,&__pyx_n_s_copyValues,&__pyx_n_s_idxBase,&__pyx_n_s_alg,0};
    PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2_bufferSize", 1, 14, 14, 1); __PYX_ERR(0, 4210, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2_bufferSize", 1, 14, 14, 2); __PYX_ERR(0, 4210, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2_bufferSize", 1, 14, 14, 3); __PYX_ERR(0, 4210, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2_bufferSize", 1, 14, 14, 4); __PYX_ERR(0, 4210, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2_bufferSize", 1, 14, 14, 5); __PYX_ERR(0, 4210, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2_bufferSize", 1, 14, 14, 6); __PYX_ERR(0, 4210, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2_bufferSize", 1, 14, 14, 7); __PYX_ERR(0, 4210, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscColPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2_bufferSize", 1, 14, 14, 8); __PYX_ERR(0, 4210, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscRowInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2_bufferSize", 1, 14, 14, 9); __PYX_ERR(0, 4210, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_valType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2_bufferSize", 1, 14, 14, 10); __PYX_ERR(0, 4210, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_copyValues)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2_bufferSize", 1, 14, 14, 11); __PYX_ERR(0, 4210, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2_bufferSize", 1, 14, 14, 12); __PYX_ERR(0, 4210, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2_bufferSize", 1, 14, 14, 13); __PYX_ERR(0, 4210, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "csr2cscEx2_bufferSize") < 0)) __PYX_ERR(0, 4210, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 14) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
    }
    __pyx_v_handle = PyInt_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4211, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4211, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4211, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4211, __pyx_L3_error)
    __pyx_v_csrVal = PyInt_AsSsize_t(values[4]); if (unlikely((__pyx_v_csrVal == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4211, __pyx_L3_error)
    __pyx_v_csrRowPtr = PyInt_AsSsize_t(values[5]); if (unlikely((__pyx_v_csrRowPtr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4212, __pyx_L3_error)
    __pyx_v_csrColInd = PyInt_AsSsize_t(values[6]); if (unlikely((__pyx_v_csrColInd == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4212, __pyx_L3_error)
    __pyx_v_cscVal = PyInt_AsSsize_t(values[7]); if (unlikely((__pyx_v_cscVal == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4212, __pyx_L3_error)
    __pyx_v_cscColPtr = PyInt_AsSsize_t(values[8]); if (unlikely((__pyx_v_cscColPtr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4213, __pyx_L3_error)
    __pyx_v_cscRowInd = PyInt_AsSsize_t(values[9]); if (unlikely((__pyx_v_cscRowInd == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4213, __pyx_L3_error)
    __pyx_v_valType = __Pyx_PyInt_As_cudaDataType(values[10]); if (unlikely((__pyx_v_valType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4213, __pyx_L3_error)
    __pyx_v_copyValues = __Pyx_PyInt_As_cusparseAction_t(values[11]); if (unlikely((__pyx_v_copyValues == ((cusparseAction_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4214, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_cusparseIndexBase_t(values[12]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4214, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyInt_As_cusparseCsr2CscAlg_t(values[13]); if (unlikely((__pyx_v_alg == ((cusparseCsr2CscAlg_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4214, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("csr2cscEx2_bufferSize", 1, 14, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4210, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.csr2cscEx2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_496csr2cscEx2_bufferSize(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_csrVal, __pyx_v_csrRowPtr, __pyx_v_csrColInd, __pyx_v_cscVal, __pyx_v_cscColPtr, __pyx_v_cscRowInd, __pyx_v_valType, __pyx_v_copyValues, __pyx_v_idxBase, __pyx_v_alg);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_496csr2cscEx2_bufferSize(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, intptr_t __pyx_v_csrVal, intptr_t __pyx_v_csrRowPtr, intptr_t __pyx_v_csrColInd, intptr_t __pyx_v_cscVal, intptr_t __pyx_v_cscColPtr, intptr_t __pyx_v_cscRowInd, cudaDataType __pyx_v_valType, cusparseAction_t __pyx_v_copyValues, cusparseIndexBase_t __pyx_v_idxBase, cusparseCsr2CscAlg_t __pyx_v_alg) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("csr2cscEx2_bufferSize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4cupy_4cuda_8cusparse_csr2cscEx2_bufferSize(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_csrVal, __pyx_v_csrRowPtr, __pyx_v_csrColInd, __pyx_v_cscVal, __pyx_v_cscColPtr, __pyx_v_cscRowInd, __pyx_v_valType, __pyx_v_copyValues, __pyx_v_idxBase, __pyx_v_alg, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.csr2cscEx2_bufferSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cupy/cuda/cusparse.pyx":4223
 *     return bufferSize
 * 
 * cpdef csr2cscEx2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, intptr_t csrVal,
 *         intptr_t csrRowPtr, intptr_t csrColInd, intptr_t cscVal,
 */

static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_499csr2cscEx2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4cupy_4cuda_8cusparse_csr2cscEx2(intptr_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, intptr_t __pyx_v_csrVal, intptr_t __pyx_v_csrRowPtr, intptr_t __pyx_v_csrColInd, intptr_t __pyx_v_cscVal, intptr_t __pyx_v_cscColPtr, intptr_t __pyx_v_cscRowInd, cudaDataType __pyx_v_valType, cusparseAction_t __pyx_v_copyValues, cusparseIndexBase_t __pyx_v_idxBase, cusparseCsr2CscAlg_t __pyx_v_alg, intptr_t __pyx_v_buffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
  cusparseStatus_t __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("csr2cscEx2", 0);

  /* "cupy/cuda/cusparse.pyx":4228
 *         intptr_t cscColPtr, intptr_t cscRowInd, DataType valType,
 *         Action copyValues, IndexBase idxBase, Csr2CscAlg alg, intptr_t buffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())             # <<<<<<<<<<<<<<
 *     status = cusparseCsr2cscEx2(
 *         <Handle>handle, m, n, nnz, <const void*>csrVal, <const int*>csrRowPtr,
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_setStream(__pyx_v_handle, __pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4229
 *         Action copyValues, IndexBase idxBase, Csr2CscAlg alg, intptr_t buffer):
 *     setStream(handle, stream_module.get_current_stream_ptr())
 *     status = cusparseCsr2cscEx2(             # <<<<<<<<<<<<<<
 *         <Handle>handle, m, n, nnz, <const void*>csrVal, <const int*>csrRowPtr,
 *         <const int*>csrColInd, <void*>cscVal, <int*>cscColPtr, <int*>cscRowInd,
 */
  __pyx_v_status = cusparseCsr2cscEx2(((cusparseHandle_t)__pyx_v_handle), __pyx_v_m, __pyx_v_n, __pyx_v_nnz, ((void const *)__pyx_v_csrVal), ((int const *)__pyx_v_csrRowPtr), ((int const *)__pyx_v_csrColInd), ((void *)__pyx_v_cscVal), ((int *)__pyx_v_cscColPtr), ((int *)__pyx_v_cscRowInd), __pyx_v_valType, __pyx_v_copyValues, __pyx_v_idxBase, __pyx_v_alg, ((void *)__pyx_v_buffer));

  /* "cupy/cuda/cusparse.pyx":4233
 *         <const int*>csrColInd, <void*>cscVal, <int*>cscColPtr, <int*>cscRowInd,
 *         valType, copyValues, idxBase, alg, <void*>buffer)
 *     check_status(status)             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_check_status(__pyx_v_status, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":4223
 *     return bufferSize
 * 
 * cpdef csr2cscEx2(             # <<<<<<<<<<<<<<
 *         intptr_t handle, int m, int n, int nnz, intptr_t csrVal,
 *         intptr_t csrRowPtr, intptr_t csrColInd, intptr_t cscVal,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.csr2cscEx2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_499csr2cscEx2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_498csr2cscEx2[] = "csr2cscEx2(intptr_t handle, int m, int n, int nnz, intptr_t csrVal, intptr_t csrRowPtr, intptr_t csrColInd, intptr_t cscVal, intptr_t cscColPtr, intptr_t cscRowInd, DataType valType, Action copyValues, IndexBase idxBase, Csr2CscAlg alg, intptr_t buffer)";
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_499csr2cscEx2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  intptr_t __pyx_v_handle;
  int __pyx_v_m;
  int __pyx_v_n;
  int __pyx_v_nnz;
  intptr_t __pyx_v_csrVal;
  intptr_t __pyx_v_csrRowPtr;
  intptr_t __pyx_v_csrColInd;
  intptr_t __pyx_v_cscVal;
  intptr_t __pyx_v_cscColPtr;
  intptr_t __pyx_v_cscRowInd;
  cudaDataType __pyx_v_valType;
  cusparseAction_t __pyx_v_copyValues;
  cusparseIndexBase_t __pyx_v_idxBase;
  cusparseCsr2CscAlg_t __pyx_v_alg;
  intptr_t __pyx_v_buffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("csr2cscEx2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_nnz,&__pyx_n_s_csrVal,&__pyx_n_s_csrRowPtr,&__pyx_n_s_csrColInd,&__pyx_n_s_cscVal,&__pyx_n_s_cscColPtr,&__pyx_n_s_cscRowInd,&__pyx_n_s_valType,&__pyx_n_s_copyValues,&__pyx_n_s_idxBase,&__pyx_n_s_alg,&__pyx_n_s_buffer,0};
    PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, 1); __PYX_ERR(0, 4223, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, 2); __PYX_ERR(0, 4223, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, 3); __PYX_ERR(0, 4223, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, 4); __PYX_ERR(0, 4223, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, 5); __PYX_ERR(0, 4223, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, 6); __PYX_ERR(0, 4223, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscVal)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, 7); __PYX_ERR(0, 4223, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscColPtr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, 8); __PYX_ERR(0, 4223, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cscRowInd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, 9); __PYX_ERR(0, 4223, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_valType)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, 10); __PYX_ERR(0, 4223, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_copyValues)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, 11); __PYX_ERR(0, 4223, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxBase)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, 12); __PYX_ERR(0, 4223, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, 13); __PYX_ERR(0, 4223, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, 14); __PYX_ERR(0, 4223, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "csr2cscEx2") < 0)) __PYX_ERR(0, 4223, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 15) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
      values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
      values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
      values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
      values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
      values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
    }
    __pyx_v_handle = PyInt_AsSsize_t(values[0]); if (unlikely((__pyx_v_handle == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4224, __pyx_L3_error)
    __pyx_v_m = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4224, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4224, __pyx_L3_error)
    __pyx_v_nnz = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4224, __pyx_L3_error)
    __pyx_v_csrVal = PyInt_AsSsize_t(values[4]); if (unlikely((__pyx_v_csrVal == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4224, __pyx_L3_error)
    __pyx_v_csrRowPtr = PyInt_AsSsize_t(values[5]); if (unlikely((__pyx_v_csrRowPtr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4225, __pyx_L3_error)
    __pyx_v_csrColInd = PyInt_AsSsize_t(values[6]); if (unlikely((__pyx_v_csrColInd == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4225, __pyx_L3_error)
    __pyx_v_cscVal = PyInt_AsSsize_t(values[7]); if (unlikely((__pyx_v_cscVal == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4225, __pyx_L3_error)
    __pyx_v_cscColPtr = PyInt_AsSsize_t(values[8]); if (unlikely((__pyx_v_cscColPtr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4226, __pyx_L3_error)
    __pyx_v_cscRowInd = PyInt_AsSsize_t(values[9]); if (unlikely((__pyx_v_cscRowInd == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4226, __pyx_L3_error)
    __pyx_v_valType = __Pyx_PyInt_As_cudaDataType(values[10]); if (unlikely((__pyx_v_valType == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4226, __pyx_L3_error)
    __pyx_v_copyValues = __Pyx_PyInt_As_cusparseAction_t(values[11]); if (unlikely((__pyx_v_copyValues == ((cusparseAction_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4227, __pyx_L3_error)
    __pyx_v_idxBase = __Pyx_PyInt_As_cusparseIndexBase_t(values[12]); if (unlikely((__pyx_v_idxBase == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4227, __pyx_L3_error)
    __pyx_v_alg = __Pyx_PyInt_As_cusparseCsr2CscAlg_t(values[13]); if (unlikely((__pyx_v_alg == ((cusparseCsr2CscAlg_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4227, __pyx_L3_error)
    __pyx_v_buffer = PyInt_AsSsize_t(values[14]); if (unlikely((__pyx_v_buffer == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4227, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("csr2cscEx2", 1, 15, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4223, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.csr2cscEx2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_498csr2cscEx2(__pyx_self, __pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_csrVal, __pyx_v_csrRowPtr, __pyx_v_csrColInd, __pyx_v_cscVal, __pyx_v_cscColPtr, __pyx_v_cscRowInd, __pyx_v_valType, __pyx_v_copyValues, __pyx_v_idxBase, __pyx_v_alg, __pyx_v_buffer);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_498csr2cscEx2(CYTHON_UNUSED PyObject *__pyx_self, intptr_t __pyx_v_handle, int __pyx_v_m, int __pyx_v_n, int __pyx_v_nnz, intptr_t __pyx_v_csrVal, intptr_t __pyx_v_csrRowPtr, intptr_t __pyx_v_csrColInd, intptr_t __pyx_v_cscVal, intptr_t __pyx_v_cscColPtr, intptr_t __pyx_v_cscRowInd, cudaDataType __pyx_v_valType, cusparseAction_t __pyx_v_copyValues, cusparseIndexBase_t __pyx_v_idxBase, cusparseCsr2CscAlg_t __pyx_v_alg, intptr_t __pyx_v_buffer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("csr2cscEx2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4cupy_4cuda_8cusparse_csr2cscEx2(__pyx_v_handle, __pyx_v_m, __pyx_v_n, __pyx_v_nnz, __pyx_v_csrVal, __pyx_v_csrRowPtr, __pyx_v_csrColInd, __pyx_v_cscVal, __pyx_v_cscColPtr, __pyx_v_cscRowInd, __pyx_v_valType, __pyx_v_copyValues, __pyx_v_idxBase, __pyx_v_alg, __pyx_v_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cupy.cuda.cusparse.csr2cscEx2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_SpVecAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_501__pyx_unpickle_SpVecAttributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_500__pyx_unpickle_SpVecAttributes[] = "__pyx_unpickle_SpVecAttributes(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_4cupy_4cuda_8cusparse_501__pyx_unpickle_SpVecAttributes = {"__pyx_unpickle_SpVecAttributes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_501__pyx_unpickle_SpVecAttributes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_500__pyx_unpickle_SpVecAttributes};
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_501__pyx_unpickle_SpVecAttributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_SpVecAttributes (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SpVecAttributes", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SpVecAttributes", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_SpVecAttributes") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SpVecAttributes", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_SpVecAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_500__pyx_unpickle_SpVecAttributes(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_500__pyx_unpickle_SpVecAttributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SpVecAttributes", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x7f92e3a:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x7f92e3a = (idx, idxBase, idxType, nnz, size, valueType, values))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x7f92e3a) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x7f92e3a:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x7f92e3a = (idx, idxBase, idxType, nnz, size, valueType, values))" % __pyx_checksum)
 *     __pyx_result = SpVecAttributes.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x7f92e3a:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x7f92e3a = (idx, idxBase, idxType, nnz, size, valueType, values))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = SpVecAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x7f, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x7f92e3a:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x7f92e3a = (idx, idxBase, idxType, nnz, size, valueType, values))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x7f92e3a = (idx, idxBase, idxType, nnz, size, valueType, values))" % __pyx_checksum)
 *     __pyx_result = SpVecAttributes.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SpVecAttributes__set_state(<SpVecAttributes> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4cupy_4cuda_8cusparse_SpVecAttributes), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x7f92e3a = (idx, idxBase, idxType, nnz, size, valueType, values))" % __pyx_checksum)
 *     __pyx_result = SpVecAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_SpVecAttributes__set_state(<SpVecAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = SpVecAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SpVecAttributes__set_state(<SpVecAttributes> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_SpVecAttributes__set_state(SpVecAttributes __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_SpVecAttributes__set_state(((struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x7f92e3a = (idx, idxBase, idxType, nnz, size, valueType, values))" % __pyx_checksum)
 *     __pyx_result = SpVecAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_SpVecAttributes__set_state(<SpVecAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SpVecAttributes__set_state(<SpVecAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_SpVecAttributes__set_state(SpVecAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.idx = __pyx_state[0]; __pyx_result.idxBase = __pyx_state[1]; __pyx_result.idxType = __pyx_state[2]; __pyx_result.nnz = __pyx_state[3]; __pyx_result.size = __pyx_state[4]; __pyx_result.valueType = __pyx_state[5]; __pyx_result.values = __pyx_state[6]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_SpVecAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_SpVecAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_SpVecAttributes__set_state(<SpVecAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SpVecAttributes__set_state(SpVecAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.idx = __pyx_state[0]; __pyx_result.idxBase = __pyx_state[1]; __pyx_result.idxType = __pyx_state[2]; __pyx_result.nnz = __pyx_state[3]; __pyx_result.size = __pyx_state[4]; __pyx_result.valueType = __pyx_state[5]; __pyx_result.values = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_SpVecAttributes__set_state(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  intptr_t __pyx_t_2;
  cusparseIndexBase_t __pyx_t_3;
  cusparseIndexType_t __pyx_t_4;
  int64_t __pyx_t_5;
  cudaDataType __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SpVecAttributes__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_SpVecAttributes__set_state(SpVecAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.idx = __pyx_state[0]; __pyx_result.idxBase = __pyx_state[1]; __pyx_result.idxType = __pyx_state[2]; __pyx_result.nnz = __pyx_state[3]; __pyx_result.size = __pyx_state[4]; __pyx_result.valueType = __pyx_state[5]; __pyx_result.values = __pyx_state[6]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[7])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->idx = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_cusparseIndexBase_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->idxBase = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_cusparseIndexType_t(__pyx_t_1); if (unlikely((__pyx_t_4 == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->idxType = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->nnz = __pyx_t_5;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->size = __pyx_t_5;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyInt_As_cudaDataType(__pyx_t_1); if (unlikely((__pyx_t_6 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->valueType = __pyx_t_6;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->values = __pyx_t_2;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_SpVecAttributes__set_state(SpVecAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.idx = __pyx_state[0]; __pyx_result.idxBase = __pyx_state[1]; __pyx_result.idxType = __pyx_state[2]; __pyx_result.nnz = __pyx_state[3]; __pyx_result.size = __pyx_state[4]; __pyx_result.valueType = __pyx_state[5]; __pyx_result.values = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[7])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_8 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_9 = ((__pyx_t_8 > 7) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_9 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_9 != 0);
  __pyx_t_7 = __pyx_t_10;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_7) {

    /* "(tree fragment)":14
 *     __pyx_result.idx = __pyx_state[0]; __pyx_result.idxBase = __pyx_state[1]; __pyx_result.idxType = __pyx_state[2]; __pyx_result.nnz = __pyx_state[3]; __pyx_result.size = __pyx_state[4]; __pyx_result.valueType = __pyx_state[5]; __pyx_result.values = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[7])             # <<<<<<<<<<<<<<
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_update); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_11 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_13 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    __pyx_t_1 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_SpVecAttributes__set_state(SpVecAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.idx = __pyx_state[0]; __pyx_result.idxBase = __pyx_state[1]; __pyx_result.idxType = __pyx_state[2]; __pyx_result.nnz = __pyx_state[3]; __pyx_result.size = __pyx_state[4]; __pyx_result.valueType = __pyx_state[5]; __pyx_result.values = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[7])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_SpVecAttributes__set_state(<SpVecAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SpVecAttributes__set_state(SpVecAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.idx = __pyx_state[0]; __pyx_result.idxBase = __pyx_state[1]; __pyx_result.idxType = __pyx_state[2]; __pyx_result.nnz = __pyx_state[3]; __pyx_result.size = __pyx_state[4]; __pyx_result.valueType = __pyx_state[5]; __pyx_result.values = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_SpVecAttributes__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_CooAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_503__pyx_unpickle_CooAttributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_502__pyx_unpickle_CooAttributes[] = "__pyx_unpickle_CooAttributes(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_4cupy_4cuda_8cusparse_503__pyx_unpickle_CooAttributes = {"__pyx_unpickle_CooAttributes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_503__pyx_unpickle_CooAttributes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_502__pyx_unpickle_CooAttributes};
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_503__pyx_unpickle_CooAttributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_CooAttributes (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CooAttributes", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CooAttributes", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_CooAttributes") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CooAttributes", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_CooAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_502__pyx_unpickle_CooAttributes(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_502__pyx_unpickle_CooAttributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CooAttributes", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x41fb826:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x41fb826 = (colIdx, cols, idxBase, idxType, nnz, rowIdx, rows, valueType, values))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x41fb826) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x41fb826:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x41fb826 = (colIdx, cols, idxBase, idxType, nnz, rowIdx, rows, valueType, values))" % __pyx_checksum)
 *     __pyx_result = CooAttributes.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x41fb826:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x41fb826 = (colIdx, cols, idxBase, idxType, nnz, rowIdx, rows, valueType, values))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = CooAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x41, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x41fb826:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x41fb826 = (colIdx, cols, idxBase, idxType, nnz, rowIdx, rows, valueType, values))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x41fb826 = (colIdx, cols, idxBase, idxType, nnz, rowIdx, rows, valueType, values))" % __pyx_checksum)
 *     __pyx_result = CooAttributes.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CooAttributes__set_state(<CooAttributes> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4cupy_4cuda_8cusparse_CooAttributes), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x41fb826 = (colIdx, cols, idxBase, idxType, nnz, rowIdx, rows, valueType, values))" % __pyx_checksum)
 *     __pyx_result = CooAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_CooAttributes__set_state(<CooAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = CooAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CooAttributes__set_state(<CooAttributes> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_CooAttributes__set_state(CooAttributes __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_CooAttributes__set_state(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x41fb826 = (colIdx, cols, idxBase, idxType, nnz, rowIdx, rows, valueType, values))" % __pyx_checksum)
 *     __pyx_result = CooAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_CooAttributes__set_state(<CooAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CooAttributes__set_state(<CooAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_CooAttributes__set_state(CooAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.colIdx = __pyx_state[0]; __pyx_result.cols = __pyx_state[1]; __pyx_result.idxBase = __pyx_state[2]; __pyx_result.idxType = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rowIdx = __pyx_state[5]; __pyx_result.rows = __pyx_state[6]; __pyx_result.valueType = __pyx_state[7]; __pyx_result.values = __pyx_state[8]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_CooAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_CooAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_CooAttributes__set_state(<CooAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_CooAttributes__set_state(CooAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.colIdx = __pyx_state[0]; __pyx_result.cols = __pyx_state[1]; __pyx_result.idxBase = __pyx_state[2]; __pyx_result.idxType = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rowIdx = __pyx_state[5]; __pyx_result.rows = __pyx_state[6]; __pyx_result.valueType = __pyx_state[7]; __pyx_result.values = __pyx_state[8]
 *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_CooAttributes__set_state(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  intptr_t __pyx_t_2;
  int64_t __pyx_t_3;
  cusparseIndexBase_t __pyx_t_4;
  cusparseIndexType_t __pyx_t_5;
  cudaDataType __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CooAttributes__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_CooAttributes__set_state(CooAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.colIdx = __pyx_state[0]; __pyx_result.cols = __pyx_state[1]; __pyx_result.idxBase = __pyx_state[2]; __pyx_result.idxType = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rowIdx = __pyx_state[5]; __pyx_result.rows = __pyx_state[6]; __pyx_result.valueType = __pyx_state[7]; __pyx_result.values = __pyx_state[8]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[9])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->colIdx = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->cols = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_cusparseIndexBase_t(__pyx_t_1); if (unlikely((__pyx_t_4 == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->idxBase = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_As_cusparseIndexType_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->idxType = __pyx_t_5;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->nnz = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->rowIdx = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->rows = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyInt_As_cudaDataType(__pyx_t_1); if (unlikely((__pyx_t_6 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->valueType = __pyx_t_6;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->values = __pyx_t_2;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_CooAttributes__set_state(CooAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.colIdx = __pyx_state[0]; __pyx_result.cols = __pyx_state[1]; __pyx_result.idxBase = __pyx_state[2]; __pyx_result.idxType = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rowIdx = __pyx_state[5]; __pyx_result.rows = __pyx_state[6]; __pyx_result.valueType = __pyx_state[7]; __pyx_result.values = __pyx_state[8]
 *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[9])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_8 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_9 = ((__pyx_t_8 > 9) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_9 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_9 != 0);
  __pyx_t_7 = __pyx_t_10;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_7) {

    /* "(tree fragment)":14
 *     __pyx_result.colIdx = __pyx_state[0]; __pyx_result.cols = __pyx_state[1]; __pyx_result.idxBase = __pyx_state[2]; __pyx_result.idxType = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rowIdx = __pyx_state[5]; __pyx_result.rows = __pyx_state[6]; __pyx_result.valueType = __pyx_state[7]; __pyx_result.values = __pyx_state[8]
 *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[9])             # <<<<<<<<<<<<<<
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_update); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_11 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_13 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    __pyx_t_1 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_CooAttributes__set_state(CooAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.colIdx = __pyx_state[0]; __pyx_result.cols = __pyx_state[1]; __pyx_result.idxBase = __pyx_state[2]; __pyx_result.idxType = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rowIdx = __pyx_state[5]; __pyx_result.rows = __pyx_state[6]; __pyx_result.valueType = __pyx_state[7]; __pyx_result.values = __pyx_state[8]
 *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[9])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_CooAttributes__set_state(<CooAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_CooAttributes__set_state(CooAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.colIdx = __pyx_state[0]; __pyx_result.cols = __pyx_state[1]; __pyx_result.idxBase = __pyx_state[2]; __pyx_result.idxType = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rowIdx = __pyx_state[5]; __pyx_result.rows = __pyx_state[6]; __pyx_result.valueType = __pyx_state[7]; __pyx_result.values = __pyx_state[8]
 *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_CooAttributes__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_CooAoSAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_505__pyx_unpickle_CooAoSAttributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_504__pyx_unpickle_CooAoSAttributes[] = "__pyx_unpickle_CooAoSAttributes(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_4cupy_4cuda_8cusparse_505__pyx_unpickle_CooAoSAttributes = {"__pyx_unpickle_CooAoSAttributes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_505__pyx_unpickle_CooAoSAttributes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_504__pyx_unpickle_CooAoSAttributes};
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_505__pyx_unpickle_CooAoSAttributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_CooAoSAttributes (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CooAoSAttributes", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CooAoSAttributes", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_CooAoSAttributes") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CooAoSAttributes", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_CooAoSAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_504__pyx_unpickle_CooAoSAttributes(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_504__pyx_unpickle_CooAoSAttributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CooAoSAttributes", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xd3613df:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd3613df = (cols, idxBase, idxType, ind, nnz, rows, valueType, values))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xd3613df) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xd3613df:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd3613df = (cols, idxBase, idxType, ind, nnz, rows, valueType, values))" % __pyx_checksum)
 *     __pyx_result = CooAoSAttributes.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0xd3613df:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd3613df = (cols, idxBase, idxType, ind, nnz, rows, valueType, values))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = CooAoSAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xd3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xd3613df:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd3613df = (cols, idxBase, idxType, ind, nnz, rows, valueType, values))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd3613df = (cols, idxBase, idxType, ind, nnz, rows, valueType, values))" % __pyx_checksum)
 *     __pyx_result = CooAoSAttributes.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CooAoSAttributes__set_state(<CooAoSAttributes> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4cupy_4cuda_8cusparse_CooAoSAttributes), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd3613df = (cols, idxBase, idxType, ind, nnz, rows, valueType, values))" % __pyx_checksum)
 *     __pyx_result = CooAoSAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_CooAoSAttributes__set_state(<CooAoSAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = CooAoSAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CooAoSAttributes__set_state(<CooAoSAttributes> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_CooAoSAttributes__set_state(CooAoSAttributes __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_CooAoSAttributes__set_state(((struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd3613df = (cols, idxBase, idxType, ind, nnz, rows, valueType, values))" % __pyx_checksum)
 *     __pyx_result = CooAoSAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_CooAoSAttributes__set_state(<CooAoSAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CooAoSAttributes__set_state(<CooAoSAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_CooAoSAttributes__set_state(CooAoSAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.cols = __pyx_state[0]; __pyx_result.idxBase = __pyx_state[1]; __pyx_result.idxType = __pyx_state[2]; __pyx_result.ind = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rows = __pyx_state[5]; __pyx_result.valueType = __pyx_state[6]; __pyx_result.values = __pyx_state[7]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_CooAoSAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_CooAoSAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_CooAoSAttributes__set_state(<CooAoSAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_CooAoSAttributes__set_state(CooAoSAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.cols = __pyx_state[0]; __pyx_result.idxBase = __pyx_state[1]; __pyx_result.idxType = __pyx_state[2]; __pyx_result.ind = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rows = __pyx_state[5]; __pyx_result.valueType = __pyx_state[6]; __pyx_result.values = __pyx_state[7]
 *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_CooAoSAttributes__set_state(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int64_t __pyx_t_2;
  cusparseIndexBase_t __pyx_t_3;
  cusparseIndexType_t __pyx_t_4;
  intptr_t __pyx_t_5;
  cudaDataType __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CooAoSAttributes__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_CooAoSAttributes__set_state(CooAoSAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.cols = __pyx_state[0]; __pyx_result.idxBase = __pyx_state[1]; __pyx_result.idxType = __pyx_state[2]; __pyx_result.ind = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rows = __pyx_state[5]; __pyx_result.valueType = __pyx_state[6]; __pyx_result.values = __pyx_state[7]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[8])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->cols = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_cusparseIndexBase_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->idxBase = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_cusparseIndexType_t(__pyx_t_1); if (unlikely((__pyx_t_4 == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->idxType = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyInt_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->ind = __pyx_t_5;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->nnz = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->rows = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyInt_As_cudaDataType(__pyx_t_1); if (unlikely((__pyx_t_6 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->valueType = __pyx_t_6;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyInt_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->values = __pyx_t_5;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_CooAoSAttributes__set_state(CooAoSAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.cols = __pyx_state[0]; __pyx_result.idxBase = __pyx_state[1]; __pyx_result.idxType = __pyx_state[2]; __pyx_result.ind = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rows = __pyx_state[5]; __pyx_result.valueType = __pyx_state[6]; __pyx_result.values = __pyx_state[7]
 *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[8])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_8 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_9 = ((__pyx_t_8 > 8) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_9 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_9 != 0);
  __pyx_t_7 = __pyx_t_10;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_7) {

    /* "(tree fragment)":14
 *     __pyx_result.cols = __pyx_state[0]; __pyx_result.idxBase = __pyx_state[1]; __pyx_result.idxType = __pyx_state[2]; __pyx_result.ind = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rows = __pyx_state[5]; __pyx_result.valueType = __pyx_state[6]; __pyx_result.values = __pyx_state[7]
 *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[8])             # <<<<<<<<<<<<<<
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_update); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_11 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_13 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    __pyx_t_1 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_CooAoSAttributes__set_state(CooAoSAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.cols = __pyx_state[0]; __pyx_result.idxBase = __pyx_state[1]; __pyx_result.idxType = __pyx_state[2]; __pyx_result.ind = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rows = __pyx_state[5]; __pyx_result.valueType = __pyx_state[6]; __pyx_result.values = __pyx_state[7]
 *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[8])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_CooAoSAttributes__set_state(<CooAoSAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_CooAoSAttributes__set_state(CooAoSAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.cols = __pyx_state[0]; __pyx_result.idxBase = __pyx_state[1]; __pyx_result.idxType = __pyx_state[2]; __pyx_result.ind = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rows = __pyx_state[5]; __pyx_result.valueType = __pyx_state[6]; __pyx_result.values = __pyx_state[7]
 *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_CooAoSAttributes__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_CsrAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_507__pyx_unpickle_CsrAttributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_506__pyx_unpickle_CsrAttributes[] = "__pyx_unpickle_CsrAttributes(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_4cupy_4cuda_8cusparse_507__pyx_unpickle_CsrAttributes = {"__pyx_unpickle_CsrAttributes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_507__pyx_unpickle_CsrAttributes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_506__pyx_unpickle_CsrAttributes};
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_507__pyx_unpickle_CsrAttributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_CsrAttributes (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CsrAttributes", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CsrAttributes", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_CsrAttributes") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CsrAttributes", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_CsrAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_506__pyx_unpickle_CsrAttributes(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_506__pyx_unpickle_CsrAttributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CsrAttributes", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x09bcd38:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x09bcd38 = (colIdx, colIdxType, cols, idxBase, nnz, rowOffsetType, rowOffsets, rows, valueType, values))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x09bcd38) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x09bcd38:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x09bcd38 = (colIdx, colIdxType, cols, idxBase, nnz, rowOffsetType, rowOffsets, rows, valueType, values))" % __pyx_checksum)
 *     __pyx_result = CsrAttributes.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x09bcd38:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x09bcd38 = (colIdx, colIdxType, cols, idxBase, nnz, rowOffsetType, rowOffsets, rows, valueType, values))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = CsrAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x09, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x09bcd38:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x09bcd38 = (colIdx, colIdxType, cols, idxBase, nnz, rowOffsetType, rowOffsets, rows, valueType, values))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x09bcd38 = (colIdx, colIdxType, cols, idxBase, nnz, rowOffsetType, rowOffsets, rows, valueType, values))" % __pyx_checksum)
 *     __pyx_result = CsrAttributes.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CsrAttributes__set_state(<CsrAttributes> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4cupy_4cuda_8cusparse_CsrAttributes), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x09bcd38 = (colIdx, colIdxType, cols, idxBase, nnz, rowOffsetType, rowOffsets, rows, valueType, values))" % __pyx_checksum)
 *     __pyx_result = CsrAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_CsrAttributes__set_state(<CsrAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = CsrAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CsrAttributes__set_state(<CsrAttributes> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_CsrAttributes__set_state(CsrAttributes __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_CsrAttributes__set_state(((struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x09bcd38 = (colIdx, colIdxType, cols, idxBase, nnz, rowOffsetType, rowOffsets, rows, valueType, values))" % __pyx_checksum)
 *     __pyx_result = CsrAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_CsrAttributes__set_state(<CsrAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CsrAttributes__set_state(<CsrAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_CsrAttributes__set_state(CsrAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.colIdx = __pyx_state[0]; __pyx_result.colIdxType = __pyx_state[1]; __pyx_result.cols = __pyx_state[2]; __pyx_result.idxBase = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rowOffsetType = __pyx_state[5]; __pyx_result.rowOffsets = __pyx_state[6]; __pyx_result.rows = __pyx_state[7]; __pyx_result.valueType = __pyx_state[8]; __pyx_result.values = __pyx_state[9]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_CsrAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_CsrAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_CsrAttributes__set_state(<CsrAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_CsrAttributes__set_state(CsrAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.colIdx = __pyx_state[0]; __pyx_result.colIdxType = __pyx_state[1]; __pyx_result.cols = __pyx_state[2]; __pyx_result.idxBase = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rowOffsetType = __pyx_state[5]; __pyx_result.rowOffsets = __pyx_state[6]; __pyx_result.rows = __pyx_state[7]; __pyx_result.valueType = __pyx_state[8]; __pyx_result.values = __pyx_state[9]
 *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_CsrAttributes__set_state(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  intptr_t __pyx_t_2;
  cusparseIndexType_t __pyx_t_3;
  int64_t __pyx_t_4;
  cusparseIndexBase_t __pyx_t_5;
  cudaDataType __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CsrAttributes__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_CsrAttributes__set_state(CsrAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.colIdx = __pyx_state[0]; __pyx_result.colIdxType = __pyx_state[1]; __pyx_result.cols = __pyx_state[2]; __pyx_result.idxBase = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rowOffsetType = __pyx_state[5]; __pyx_result.rowOffsets = __pyx_state[6]; __pyx_result.rows = __pyx_state[7]; __pyx_result.valueType = __pyx_state[8]; __pyx_result.values = __pyx_state[9]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[10])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->colIdx = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_cusparseIndexType_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->colIdxType = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->cols = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_As_cusparseIndexBase_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((cusparseIndexBase_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->idxBase = __pyx_t_5;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->nnz = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_cusparseIndexType_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((cusparseIndexType_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->rowOffsetType = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->rowOffsets = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->rows = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyInt_As_cudaDataType(__pyx_t_1); if (unlikely((__pyx_t_6 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->valueType = __pyx_t_6;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->values = __pyx_t_2;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_CsrAttributes__set_state(CsrAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.colIdx = __pyx_state[0]; __pyx_result.colIdxType = __pyx_state[1]; __pyx_result.cols = __pyx_state[2]; __pyx_result.idxBase = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rowOffsetType = __pyx_state[5]; __pyx_result.rowOffsets = __pyx_state[6]; __pyx_result.rows = __pyx_state[7]; __pyx_result.valueType = __pyx_state[8]; __pyx_result.values = __pyx_state[9]
 *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[10])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_8 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_9 = ((__pyx_t_8 > 10) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_9 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_9 != 0);
  __pyx_t_7 = __pyx_t_10;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_7) {

    /* "(tree fragment)":14
 *     __pyx_result.colIdx = __pyx_state[0]; __pyx_result.colIdxType = __pyx_state[1]; __pyx_result.cols = __pyx_state[2]; __pyx_result.idxBase = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rowOffsetType = __pyx_state[5]; __pyx_result.rowOffsets = __pyx_state[6]; __pyx_result.rows = __pyx_state[7]; __pyx_result.valueType = __pyx_state[8]; __pyx_result.values = __pyx_state[9]
 *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[10])             # <<<<<<<<<<<<<<
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_update); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_11 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_13 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    __pyx_t_1 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_CsrAttributes__set_state(CsrAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.colIdx = __pyx_state[0]; __pyx_result.colIdxType = __pyx_state[1]; __pyx_result.cols = __pyx_state[2]; __pyx_result.idxBase = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rowOffsetType = __pyx_state[5]; __pyx_result.rowOffsets = __pyx_state[6]; __pyx_result.rows = __pyx_state[7]; __pyx_result.valueType = __pyx_state[8]; __pyx_result.values = __pyx_state[9]
 *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[10])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_CsrAttributes__set_state(<CsrAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_CsrAttributes__set_state(CsrAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.colIdx = __pyx_state[0]; __pyx_result.colIdxType = __pyx_state[1]; __pyx_result.cols = __pyx_state[2]; __pyx_result.idxBase = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rowOffsetType = __pyx_state[5]; __pyx_result.rowOffsets = __pyx_state[6]; __pyx_result.rows = __pyx_state[7]; __pyx_result.valueType = __pyx_state[8]; __pyx_result.values = __pyx_state[9]
 *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_CsrAttributes__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_DnVecAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_509__pyx_unpickle_DnVecAttributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_508__pyx_unpickle_DnVecAttributes[] = "__pyx_unpickle_DnVecAttributes(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_4cupy_4cuda_8cusparse_509__pyx_unpickle_DnVecAttributes = {"__pyx_unpickle_DnVecAttributes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_509__pyx_unpickle_DnVecAttributes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_508__pyx_unpickle_DnVecAttributes};
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_509__pyx_unpickle_DnVecAttributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_DnVecAttributes (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DnVecAttributes", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DnVecAttributes", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_DnVecAttributes") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DnVecAttributes", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_DnVecAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_508__pyx_unpickle_DnVecAttributes(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_508__pyx_unpickle_DnVecAttributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_DnVecAttributes", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xcbbe7db:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcbbe7db = (size, valueType, values))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xcbbe7db) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xcbbe7db:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcbbe7db = (size, valueType, values))" % __pyx_checksum)
 *     __pyx_result = DnVecAttributes.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0xcbbe7db:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcbbe7db = (size, valueType, values))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = DnVecAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xcb, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xcbbe7db:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcbbe7db = (size, valueType, values))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcbbe7db = (size, valueType, values))" % __pyx_checksum)
 *     __pyx_result = DnVecAttributes.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_DnVecAttributes__set_state(<DnVecAttributes> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4cupy_4cuda_8cusparse_DnVecAttributes), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcbbe7db = (size, valueType, values))" % __pyx_checksum)
 *     __pyx_result = DnVecAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_DnVecAttributes__set_state(<DnVecAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = DnVecAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_DnVecAttributes__set_state(<DnVecAttributes> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_DnVecAttributes__set_state(DnVecAttributes __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_DnVecAttributes__set_state(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcbbe7db = (size, valueType, values))" % __pyx_checksum)
 *     __pyx_result = DnVecAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_DnVecAttributes__set_state(<DnVecAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_DnVecAttributes__set_state(<DnVecAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_DnVecAttributes__set_state(DnVecAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.size = __pyx_state[0]; __pyx_result.valueType = __pyx_state[1]; __pyx_result.values = __pyx_state[2]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_DnVecAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_DnVecAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_DnVecAttributes__set_state(<DnVecAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_DnVecAttributes__set_state(DnVecAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.size = __pyx_state[0]; __pyx_result.valueType = __pyx_state[1]; __pyx_result.values = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_DnVecAttributes__set_state(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int64_t __pyx_t_2;
  cudaDataType __pyx_t_3;
  intptr_t __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_DnVecAttributes__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_DnVecAttributes__set_state(DnVecAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.size = __pyx_state[0]; __pyx_result.valueType = __pyx_state[1]; __pyx_result.values = __pyx_state[2]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[3])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->size = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_cudaDataType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->valueType = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyInt_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->values = __pyx_t_4;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_DnVecAttributes__set_state(DnVecAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.size = __pyx_state[0]; __pyx_result.valueType = __pyx_state[1]; __pyx_result.values = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[3])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_7 = ((__pyx_t_6 > 3) != 0);
  if (__pyx_t_7) {
  } else {
    __pyx_t_5 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  __pyx_t_5 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_5) {

    /* "(tree fragment)":14
 *     __pyx_result.size = __pyx_state[0]; __pyx_result.valueType = __pyx_state[1]; __pyx_result.values = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[3])             # <<<<<<<<<<<<<<
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_update); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_DnVecAttributes__set_state(DnVecAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.size = __pyx_state[0]; __pyx_result.valueType = __pyx_state[1]; __pyx_result.values = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[3])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_DnVecAttributes__set_state(<DnVecAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_DnVecAttributes__set_state(DnVecAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.size = __pyx_state[0]; __pyx_result.valueType = __pyx_state[1]; __pyx_result.values = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_DnVecAttributes__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_DnMatAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_511__pyx_unpickle_DnMatAttributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_510__pyx_unpickle_DnMatAttributes[] = "__pyx_unpickle_DnMatAttributes(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_4cupy_4cuda_8cusparse_511__pyx_unpickle_DnMatAttributes = {"__pyx_unpickle_DnMatAttributes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_511__pyx_unpickle_DnMatAttributes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_510__pyx_unpickle_DnMatAttributes};
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_511__pyx_unpickle_DnMatAttributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_DnMatAttributes (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DnMatAttributes", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DnMatAttributes", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_DnMatAttributes") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DnMatAttributes", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_DnMatAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_510__pyx_unpickle_DnMatAttributes(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_510__pyx_unpickle_DnMatAttributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_DnMatAttributes", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x9d3053a:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9d3053a = (cols, ld, order, rows, valueType, values))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x9d3053a) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x9d3053a:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9d3053a = (cols, ld, order, rows, valueType, values))" % __pyx_checksum)
 *     __pyx_result = DnMatAttributes.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x9d3053a:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9d3053a = (cols, ld, order, rows, valueType, values))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = DnMatAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x9d, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x9d3053a:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9d3053a = (cols, ld, order, rows, valueType, values))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9d3053a = (cols, ld, order, rows, valueType, values))" % __pyx_checksum)
 *     __pyx_result = DnMatAttributes.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_DnMatAttributes__set_state(<DnMatAttributes> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4cupy_4cuda_8cusparse_DnMatAttributes), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9d3053a = (cols, ld, order, rows, valueType, values))" % __pyx_checksum)
 *     __pyx_result = DnMatAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_DnMatAttributes__set_state(<DnMatAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = DnMatAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_DnMatAttributes__set_state(<DnMatAttributes> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_DnMatAttributes__set_state(DnMatAttributes __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_DnMatAttributes__set_state(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9d3053a = (cols, ld, order, rows, valueType, values))" % __pyx_checksum)
 *     __pyx_result = DnMatAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_DnMatAttributes__set_state(<DnMatAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_DnMatAttributes__set_state(<DnMatAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_DnMatAttributes__set_state(DnMatAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.cols = __pyx_state[0]; __pyx_result.ld = __pyx_state[1]; __pyx_result.order = __pyx_state[2]; __pyx_result.rows = __pyx_state[3]; __pyx_result.valueType = __pyx_state[4]; __pyx_result.values = __pyx_state[5]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_DnMatAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_DnMatAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_DnMatAttributes__set_state(<DnMatAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_DnMatAttributes__set_state(DnMatAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.cols = __pyx_state[0]; __pyx_result.ld = __pyx_state[1]; __pyx_result.order = __pyx_state[2]; __pyx_result.rows = __pyx_state[3]; __pyx_result.valueType = __pyx_state[4]; __pyx_result.values = __pyx_state[5]
 *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_DnMatAttributes__set_state(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int64_t __pyx_t_2;
  cusparseOrder_t __pyx_t_3;
  cudaDataType __pyx_t_4;
  intptr_t __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_DnMatAttributes__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_DnMatAttributes__set_state(DnMatAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.cols = __pyx_state[0]; __pyx_result.ld = __pyx_state[1]; __pyx_result.order = __pyx_state[2]; __pyx_result.rows = __pyx_state[3]; __pyx_result.valueType = __pyx_state[4]; __pyx_result.values = __pyx_state[5]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[6])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->cols = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->ld = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_cusparseOrder_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((cusparseOrder_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->order = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->rows = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_cudaDataType(__pyx_t_1); if (unlikely((__pyx_t_4 == ((cudaDataType)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->valueType = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyInt_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->values = __pyx_t_5;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_DnMatAttributes__set_state(DnMatAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.cols = __pyx_state[0]; __pyx_result.ld = __pyx_state[1]; __pyx_result.order = __pyx_state[2]; __pyx_result.rows = __pyx_state[3]; __pyx_result.valueType = __pyx_state[4]; __pyx_result.values = __pyx_state[5]
 *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[6])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_7 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_8 = ((__pyx_t_7 > 6) != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_6 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_8 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_9 = (__pyx_t_8 != 0);
  __pyx_t_6 = __pyx_t_9;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_6) {

    /* "(tree fragment)":14
 *     __pyx_result.cols = __pyx_state[0]; __pyx_result.ld = __pyx_state[1]; __pyx_result.order = __pyx_state[2]; __pyx_result.rows = __pyx_state[3]; __pyx_result.valueType = __pyx_state[4]; __pyx_result.values = __pyx_state[5]
 *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[6])             # <<<<<<<<<<<<<<
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_update); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_10 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_12 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
      }
    }
    __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_DnMatAttributes__set_state(DnMatAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.cols = __pyx_state[0]; __pyx_result.ld = __pyx_state[1]; __pyx_result.order = __pyx_state[2]; __pyx_result.rows = __pyx_state[3]; __pyx_result.valueType = __pyx_state[4]; __pyx_result.values = __pyx_state[5]
 *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[6])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_DnMatAttributes__set_state(<DnMatAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_DnMatAttributes__set_state(DnMatAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.cols = __pyx_state[0]; __pyx_result.ld = __pyx_state[1]; __pyx_result.order = __pyx_state[2]; __pyx_result.rows = __pyx_state[3]; __pyx_result.valueType = __pyx_state[4]; __pyx_result.values = __pyx_state[5]
 *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_DnMatAttributes__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_DnMatBatchAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_513__pyx_unpickle_DnMatBatchAttributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4cupy_4cuda_8cusparse_512__pyx_unpickle_DnMatBatchAttributes[] = "__pyx_unpickle_DnMatBatchAttributes(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_4cupy_4cuda_8cusparse_513__pyx_unpickle_DnMatBatchAttributes = {"__pyx_unpickle_DnMatBatchAttributes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_513__pyx_unpickle_DnMatBatchAttributes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_512__pyx_unpickle_DnMatBatchAttributes};
static PyObject *__pyx_pw_4cupy_4cuda_8cusparse_513__pyx_unpickle_DnMatBatchAttributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_DnMatBatchAttributes (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DnMatBatchAttributes", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DnMatBatchAttributes", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_DnMatBatchAttributes") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DnMatBatchAttributes", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_DnMatBatchAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4cupy_4cuda_8cusparse_512__pyx_unpickle_DnMatBatchAttributes(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_4cupy_4cuda_8cusparse_512__pyx_unpickle_DnMatBatchAttributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_DnMatBatchAttributes", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xb66dd58:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb66dd58 = (count, stride))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb66dd58) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xb66dd58:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb66dd58 = (count, stride))" % __pyx_checksum)
 *     __pyx_result = DnMatBatchAttributes.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0xb66dd58:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb66dd58 = (count, stride))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = DnMatBatchAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb6, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xb66dd58:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb66dd58 = (count, stride))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb66dd58 = (count, stride))" % __pyx_checksum)
 *     __pyx_result = DnMatBatchAttributes.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_DnMatBatchAttributes__set_state(<DnMatBatchAttributes> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4cupy_4cuda_8cusparse_DnMatBatchAttributes), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb66dd58 = (count, stride))" % __pyx_checksum)
 *     __pyx_result = DnMatBatchAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_DnMatBatchAttributes__set_state(<DnMatBatchAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = DnMatBatchAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_DnMatBatchAttributes__set_state(<DnMatBatchAttributes> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_DnMatBatchAttributes__set_state(DnMatBatchAttributes __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_DnMatBatchAttributes__set_state(((struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb66dd58 = (count, stride))" % __pyx_checksum)
 *     __pyx_result = DnMatBatchAttributes.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_DnMatBatchAttributes__set_state(<DnMatBatchAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_DnMatBatchAttributes__set_state(<DnMatBatchAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_DnMatBatchAttributes__set_state(DnMatBatchAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.count = __pyx_state[0]; __pyx_result.stride = __pyx_state[1]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_DnMatBatchAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_DnMatBatchAttributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_DnMatBatchAttributes__set_state(<DnMatBatchAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_DnMatBatchAttributes__set_state(DnMatBatchAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.count = __pyx_state[0]; __pyx_result.stride = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_4cupy_4cuda_8cusparse___pyx_unpickle_DnMatBatchAttributes__set_state(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int64_t __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_DnMatBatchAttributes__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_DnMatBatchAttributes__set_state(DnMatBatchAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.count = __pyx_state[0]; __pyx_result.stride = __pyx_state[1]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[2])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->count = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->stride = __pyx_t_3;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_DnMatBatchAttributes__set_state(DnMatBatchAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.count = __pyx_state[0]; __pyx_result.stride = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[2])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_6 = ((__pyx_t_5 > 2) != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "(tree fragment)":14
 *     __pyx_result.count = __pyx_state[0]; __pyx_result.stride = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[2])             # <<<<<<<<<<<<<<
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_DnMatBatchAttributes__set_state(DnMatBatchAttributes __pyx_result, tuple __pyx_state):
 *     __pyx_result.count = __pyx_state[0]; __pyx_result.stride = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[2])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_DnMatBatchAttributes__set_state(<DnMatBatchAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_DnMatBatchAttributes__set_state(DnMatBatchAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.count = __pyx_state[0]; __pyx_result.stride = __pyx_state[1]
 *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cupy.cuda.cusparse.__pyx_unpickle_DnMatBatchAttributes__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_4cupy_4cuda_8cusparse_SpVecAttributes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  return o;
}

static void __pyx_tp_dealloc_4cupy_4cuda_8cusparse_SpVecAttributes(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
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_15SpVecAttributes_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_4size_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_15SpVecAttributes_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_4size_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_15SpVecAttributes_nnz(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_3nnz_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_15SpVecAttributes_nnz(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_3nnz_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_15SpVecAttributes_idx(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_3idx_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_15SpVecAttributes_idx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_3idx_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_15SpVecAttributes_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_6values_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_15SpVecAttributes_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_6values_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_15SpVecAttributes_idxType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxType_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_15SpVecAttributes_idxType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_15SpVecAttributes_idxBase(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxBase_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_15SpVecAttributes_idxBase(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_7idxBase_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_15SpVecAttributes_valueType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_9valueType_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_15SpVecAttributes_valueType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_9valueType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_4cupy_4cuda_8cusparse_SpVecAttributes[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_3__reduce_cython__, METH_NOARGS, __pyx_doc_4cupy_4cuda_8cusparse_15SpVecAttributes_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_5__setstate_cython__, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_15SpVecAttributes_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4cupy_4cuda_8cusparse_SpVecAttributes[] = {
  {(char *)"size", __pyx_getprop_4cupy_4cuda_8cusparse_15SpVecAttributes_size, __pyx_setprop_4cupy_4cuda_8cusparse_15SpVecAttributes_size, (char *)"size: 'int64_t'", 0},
  {(char *)"nnz", __pyx_getprop_4cupy_4cuda_8cusparse_15SpVecAttributes_nnz, __pyx_setprop_4cupy_4cuda_8cusparse_15SpVecAttributes_nnz, (char *)"nnz: 'int64_t'", 0},
  {(char *)"idx", __pyx_getprop_4cupy_4cuda_8cusparse_15SpVecAttributes_idx, __pyx_setprop_4cupy_4cuda_8cusparse_15SpVecAttributes_idx, (char *)"idx: 'intptr_t'", 0},
  {(char *)"values", __pyx_getprop_4cupy_4cuda_8cusparse_15SpVecAttributes_values, __pyx_setprop_4cupy_4cuda_8cusparse_15SpVecAttributes_values, (char *)"values: 'intptr_t'", 0},
  {(char *)"idxType", __pyx_getprop_4cupy_4cuda_8cusparse_15SpVecAttributes_idxType, __pyx_setprop_4cupy_4cuda_8cusparse_15SpVecAttributes_idxType, (char *)"idxType: 'IndexType'", 0},
  {(char *)"idxBase", __pyx_getprop_4cupy_4cuda_8cusparse_15SpVecAttributes_idxBase, __pyx_setprop_4cupy_4cuda_8cusparse_15SpVecAttributes_idxBase, (char *)"idxBase: 'IndexBase'", 0},
  {(char *)"valueType", __pyx_getprop_4cupy_4cuda_8cusparse_15SpVecAttributes_valueType, __pyx_setprop_4cupy_4cuda_8cusparse_15SpVecAttributes_valueType, (char *)"valueType: 'DataType'", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4cupy_4cuda_8cusparse_SpVecAttributes = {
  PyVarObject_HEAD_INIT(0, 0)
  "cupy.cuda.cusparse.SpVecAttributes", /*tp_name*/
  sizeof(struct __pyx_obj_4cupy_4cuda_8cusparse_SpVecAttributes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4cupy_4cuda_8cusparse_SpVecAttributes, /*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*/
  "SpVecAttributes(int64_t size, int64_t nnz, intptr_t idx, intptr_t values, IndexType idxType, IndexBase idxBase, DataType valueType)", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4cupy_4cuda_8cusparse_SpVecAttributes, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4cupy_4cuda_8cusparse_SpVecAttributes, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4cupy_4cuda_8cusparse_15SpVecAttributes_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4cupy_4cuda_8cusparse_SpVecAttributes, /*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
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_4cupy_4cuda_8cusparse_CooAttributes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  return o;
}

static void __pyx_tp_dealloc_4cupy_4cuda_8cusparse_CooAttributes(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
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_4rows_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_rows(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_4rows_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_cols(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_4cols_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_cols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_4cols_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_nnz(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_3nnz_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_nnz(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_3nnz_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_rowIdx(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6rowIdx_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_rowIdx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6rowIdx_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_colIdx(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6colIdx_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_colIdx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6colIdx_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6values_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_6values_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_idxType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_7idxType_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_idxType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_7idxType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_idxBase(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_7idxBase_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_idxBase(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_7idxBase_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_valueType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_9valueType_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_valueType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_9valueType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_4cupy_4cuda_8cusparse_CooAttributes[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_3__reduce_cython__, METH_NOARGS, __pyx_doc_4cupy_4cuda_8cusparse_13CooAttributes_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_5__setstate_cython__, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_13CooAttributes_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4cupy_4cuda_8cusparse_CooAttributes[] = {
  {(char *)"rows", __pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_rows, __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_rows, (char *)"rows: 'int64_t'", 0},
  {(char *)"cols", __pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_cols, __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_cols, (char *)"cols: 'int64_t'", 0},
  {(char *)"nnz", __pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_nnz, __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_nnz, (char *)"nnz: 'int64_t'", 0},
  {(char *)"rowIdx", __pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_rowIdx, __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_rowIdx, (char *)"rowIdx: 'intptr_t'", 0},
  {(char *)"colIdx", __pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_colIdx, __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_colIdx, (char *)"colIdx: 'intptr_t'", 0},
  {(char *)"values", __pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_values, __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_values, (char *)"values: 'intptr_t'", 0},
  {(char *)"idxType", __pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_idxType, __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_idxType, (char *)"idxType: 'IndexType'", 0},
  {(char *)"idxBase", __pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_idxBase, __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_idxBase, (char *)"idxBase: 'IndexBase'", 0},
  {(char *)"valueType", __pyx_getprop_4cupy_4cuda_8cusparse_13CooAttributes_valueType, __pyx_setprop_4cupy_4cuda_8cusparse_13CooAttributes_valueType, (char *)"valueType: 'DataType'", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4cupy_4cuda_8cusparse_CooAttributes = {
  PyVarObject_HEAD_INIT(0, 0)
  "cupy.cuda.cusparse.CooAttributes", /*tp_name*/
  sizeof(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAttributes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4cupy_4cuda_8cusparse_CooAttributes, /*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*/
  "CooAttributes(int64_t rows, int64_t cols, int64_t nnz, intptr_t rowIdx, intptr_t colIdx, intptr_t values, IndexType idxType, IndexBase idxBase, DataType valueType)", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4cupy_4cuda_8cusparse_CooAttributes, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4cupy_4cuda_8cusparse_CooAttributes, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4cupy_4cuda_8cusparse_13CooAttributes_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4cupy_4cuda_8cusparse_CooAttributes, /*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
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_4cupy_4cuda_8cusparse_CooAoSAttributes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  return o;
}

static void __pyx_tp_dealloc_4cupy_4cuda_8cusparse_CooAoSAttributes(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
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_4rows_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_rows(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_4rows_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_cols(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_4cols_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_cols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_4cols_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_nnz(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_3nnz_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_nnz(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_3nnz_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_ind(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_3ind_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_ind(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_3ind_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_6values_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_6values_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_idxType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxType_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_idxType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_idxBase(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxBase_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_idxBase(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_7idxBase_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_valueType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_9valueType_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_valueType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_9valueType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_4cupy_4cuda_8cusparse_CooAoSAttributes[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_3__reduce_cython__, METH_NOARGS, __pyx_doc_4cupy_4cuda_8cusparse_16CooAoSAttributes_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_5__setstate_cython__, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_16CooAoSAttributes_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4cupy_4cuda_8cusparse_CooAoSAttributes[] = {
  {(char *)"rows", __pyx_getprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_rows, __pyx_setprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_rows, (char *)"rows: 'int64_t'", 0},
  {(char *)"cols", __pyx_getprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_cols, __pyx_setprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_cols, (char *)"cols: 'int64_t'", 0},
  {(char *)"nnz", __pyx_getprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_nnz, __pyx_setprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_nnz, (char *)"nnz: 'int64_t'", 0},
  {(char *)"ind", __pyx_getprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_ind, __pyx_setprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_ind, (char *)"ind: 'intptr_t'", 0},
  {(char *)"values", __pyx_getprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_values, __pyx_setprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_values, (char *)"values: 'intptr_t'", 0},
  {(char *)"idxType", __pyx_getprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_idxType, __pyx_setprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_idxType, (char *)"idxType: 'IndexType'", 0},
  {(char *)"idxBase", __pyx_getprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_idxBase, __pyx_setprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_idxBase, (char *)"idxBase: 'IndexBase'", 0},
  {(char *)"valueType", __pyx_getprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_valueType, __pyx_setprop_4cupy_4cuda_8cusparse_16CooAoSAttributes_valueType, (char *)"valueType: 'DataType'", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4cupy_4cuda_8cusparse_CooAoSAttributes = {
  PyVarObject_HEAD_INIT(0, 0)
  "cupy.cuda.cusparse.CooAoSAttributes", /*tp_name*/
  sizeof(struct __pyx_obj_4cupy_4cuda_8cusparse_CooAoSAttributes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4cupy_4cuda_8cusparse_CooAoSAttributes, /*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*/
  "CooAoSAttributes(int64_t rows, int64_t cols, int64_t nnz, intptr_t ind, intptr_t values, IndexType idxType, IndexBase idxBase, DataType valueType)", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4cupy_4cuda_8cusparse_CooAoSAttributes, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4cupy_4cuda_8cusparse_CooAoSAttributes, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4cupy_4cuda_8cusparse_16CooAoSAttributes_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4cupy_4cuda_8cusparse_CooAoSAttributes, /*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
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_4cupy_4cuda_8cusparse_CsrAttributes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  return o;
}

static void __pyx_tp_dealloc_4cupy_4cuda_8cusparse_CsrAttributes(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
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_4rows_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_rows(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_4rows_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_cols(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_4cols_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_cols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_4cols_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_nnz(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_3nnz_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_nnz(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_3nnz_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_rowOffsets(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_10rowOffsets_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_rowOffsets(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_10rowOffsets_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_colIdx(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_6colIdx_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_colIdx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_6colIdx_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_6values_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_6values_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_rowOffsetType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_13rowOffsetType_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_rowOffsetType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_13rowOffsetType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_colIdxType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_10colIdxType_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_colIdxType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_10colIdxType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_idxBase(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_7idxBase_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_idxBase(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_7idxBase_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_valueType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_9valueType_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_valueType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_9valueType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_4cupy_4cuda_8cusparse_CsrAttributes[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_3__reduce_cython__, METH_NOARGS, __pyx_doc_4cupy_4cuda_8cusparse_13CsrAttributes_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_5__setstate_cython__, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_13CsrAttributes_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4cupy_4cuda_8cusparse_CsrAttributes[] = {
  {(char *)"rows", __pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_rows, __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_rows, (char *)"rows: 'int64_t'", 0},
  {(char *)"cols", __pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_cols, __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_cols, (char *)"cols: 'int64_t'", 0},
  {(char *)"nnz", __pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_nnz, __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_nnz, (char *)"nnz: 'int64_t'", 0},
  {(char *)"rowOffsets", __pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_rowOffsets, __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_rowOffsets, (char *)"rowOffsets: 'intptr_t'", 0},
  {(char *)"colIdx", __pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_colIdx, __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_colIdx, (char *)"colIdx: 'intptr_t'", 0},
  {(char *)"values", __pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_values, __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_values, (char *)"values: 'intptr_t'", 0},
  {(char *)"rowOffsetType", __pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_rowOffsetType, __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_rowOffsetType, (char *)"rowOffsetType: 'IndexType'", 0},
  {(char *)"colIdxType", __pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_colIdxType, __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_colIdxType, (char *)"colIdxType: 'IndexType'", 0},
  {(char *)"idxBase", __pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_idxBase, __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_idxBase, (char *)"idxBase: 'IndexBase'", 0},
  {(char *)"valueType", __pyx_getprop_4cupy_4cuda_8cusparse_13CsrAttributes_valueType, __pyx_setprop_4cupy_4cuda_8cusparse_13CsrAttributes_valueType, (char *)"valueType: 'DataType'", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4cupy_4cuda_8cusparse_CsrAttributes = {
  PyVarObject_HEAD_INIT(0, 0)
  "cupy.cuda.cusparse.CsrAttributes", /*tp_name*/
  sizeof(struct __pyx_obj_4cupy_4cuda_8cusparse_CsrAttributes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4cupy_4cuda_8cusparse_CsrAttributes, /*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*/
  "CsrAttributes(int64_t rows, int64_t cols, int64_t nnz, intptr_t rowOffsets, intptr_t colIdx, intptr_t values, IndexType rowOffsetType, IndexType colIdxType, IndexBase idxBase, DataType valueType)", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4cupy_4cuda_8cusparse_CsrAttributes, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4cupy_4cuda_8cusparse_CsrAttributes, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4cupy_4cuda_8cusparse_13CsrAttributes_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4cupy_4cuda_8cusparse_CsrAttributes, /*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
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_4cupy_4cuda_8cusparse_DnVecAttributes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  return o;
}

static void __pyx_tp_dealloc_4cupy_4cuda_8cusparse_DnVecAttributes(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
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_15DnVecAttributes_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_4size_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_15DnVecAttributes_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_4size_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_15DnVecAttributes_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_6values_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_15DnVecAttributes_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_6values_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_15DnVecAttributes_valueType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_9valueType_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_15DnVecAttributes_valueType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_9valueType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_4cupy_4cuda_8cusparse_DnVecAttributes[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_3__reduce_cython__, METH_NOARGS, __pyx_doc_4cupy_4cuda_8cusparse_15DnVecAttributes_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_5__setstate_cython__, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_15DnVecAttributes_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4cupy_4cuda_8cusparse_DnVecAttributes[] = {
  {(char *)"size", __pyx_getprop_4cupy_4cuda_8cusparse_15DnVecAttributes_size, __pyx_setprop_4cupy_4cuda_8cusparse_15DnVecAttributes_size, (char *)"size: 'int64_t'", 0},
  {(char *)"values", __pyx_getprop_4cupy_4cuda_8cusparse_15DnVecAttributes_values, __pyx_setprop_4cupy_4cuda_8cusparse_15DnVecAttributes_values, (char *)"values: 'intptr_t'", 0},
  {(char *)"valueType", __pyx_getprop_4cupy_4cuda_8cusparse_15DnVecAttributes_valueType, __pyx_setprop_4cupy_4cuda_8cusparse_15DnVecAttributes_valueType, (char *)"valueType: 'DataType'", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4cupy_4cuda_8cusparse_DnVecAttributes = {
  PyVarObject_HEAD_INIT(0, 0)
  "cupy.cuda.cusparse.DnVecAttributes", /*tp_name*/
  sizeof(struct __pyx_obj_4cupy_4cuda_8cusparse_DnVecAttributes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4cupy_4cuda_8cusparse_DnVecAttributes, /*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*/
  "DnVecAttributes(int64_t size, intptr_t values, DataType valueType)", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4cupy_4cuda_8cusparse_DnVecAttributes, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4cupy_4cuda_8cusparse_DnVecAttributes, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4cupy_4cuda_8cusparse_15DnVecAttributes_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4cupy_4cuda_8cusparse_DnVecAttributes, /*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
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_4cupy_4cuda_8cusparse_DnMatAttributes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  return o;
}

static void __pyx_tp_dealloc_4cupy_4cuda_8cusparse_DnMatAttributes(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
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_15DnMatAttributes_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_4rows_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_15DnMatAttributes_rows(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_4rows_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_15DnMatAttributes_cols(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_4cols_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_15DnMatAttributes_cols(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_4cols_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_15DnMatAttributes_ld(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_2ld_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_15DnMatAttributes_ld(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_2ld_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_15DnMatAttributes_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_6values_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_15DnMatAttributes_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_6values_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_15DnMatAttributes_valueType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_9valueType_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_15DnMatAttributes_valueType(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_9valueType_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_15DnMatAttributes_order(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_5order_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_15DnMatAttributes_order(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_5order_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_4cupy_4cuda_8cusparse_DnMatAttributes[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_3__reduce_cython__, METH_NOARGS, __pyx_doc_4cupy_4cuda_8cusparse_15DnMatAttributes_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_5__setstate_cython__, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_15DnMatAttributes_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4cupy_4cuda_8cusparse_DnMatAttributes[] = {
  {(char *)"rows", __pyx_getprop_4cupy_4cuda_8cusparse_15DnMatAttributes_rows, __pyx_setprop_4cupy_4cuda_8cusparse_15DnMatAttributes_rows, (char *)"rows: 'int64_t'", 0},
  {(char *)"cols", __pyx_getprop_4cupy_4cuda_8cusparse_15DnMatAttributes_cols, __pyx_setprop_4cupy_4cuda_8cusparse_15DnMatAttributes_cols, (char *)"cols: 'int64_t'", 0},
  {(char *)"ld", __pyx_getprop_4cupy_4cuda_8cusparse_15DnMatAttributes_ld, __pyx_setprop_4cupy_4cuda_8cusparse_15DnMatAttributes_ld, (char *)"ld: 'int64_t'", 0},
  {(char *)"values", __pyx_getprop_4cupy_4cuda_8cusparse_15DnMatAttributes_values, __pyx_setprop_4cupy_4cuda_8cusparse_15DnMatAttributes_values, (char *)"values: 'intptr_t'", 0},
  {(char *)"valueType", __pyx_getprop_4cupy_4cuda_8cusparse_15DnMatAttributes_valueType, __pyx_setprop_4cupy_4cuda_8cusparse_15DnMatAttributes_valueType, (char *)"valueType: 'DataType'", 0},
  {(char *)"order", __pyx_getprop_4cupy_4cuda_8cusparse_15DnMatAttributes_order, __pyx_setprop_4cupy_4cuda_8cusparse_15DnMatAttributes_order, (char *)"order: 'Order'", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4cupy_4cuda_8cusparse_DnMatAttributes = {
  PyVarObject_HEAD_INIT(0, 0)
  "cupy.cuda.cusparse.DnMatAttributes", /*tp_name*/
  sizeof(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatAttributes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4cupy_4cuda_8cusparse_DnMatAttributes, /*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*/
  "DnMatAttributes(int64_t rows, int64_t cols, int64_t ld, intptr_t values, DataType valueType, Order order)", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4cupy_4cuda_8cusparse_DnMatAttributes, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4cupy_4cuda_8cusparse_DnMatAttributes, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4cupy_4cuda_8cusparse_15DnMatAttributes_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4cupy_4cuda_8cusparse_DnMatAttributes, /*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
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_4cupy_4cuda_8cusparse_DnMatBatchAttributes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  return o;
}

static void __pyx_tp_dealloc_4cupy_4cuda_8cusparse_DnMatBatchAttributes(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
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_count(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_5count_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_count(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_5count_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_stride(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_6stride_1__get__(o);
}

static int __pyx_setprop_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_stride(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_6stride_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_4cupy_4cuda_8cusparse_DnMatBatchAttributes[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_3__reduce_cython__, METH_NOARGS, __pyx_doc_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_5__setstate_cython__, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4cupy_4cuda_8cusparse_DnMatBatchAttributes[] = {
  {(char *)"count", __pyx_getprop_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_count, __pyx_setprop_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_count, (char *)"count: 'int'", 0},
  {(char *)"stride", __pyx_getprop_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_stride, __pyx_setprop_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_stride, (char *)"stride: 'int64_t'", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4cupy_4cuda_8cusparse_DnMatBatchAttributes = {
  PyVarObject_HEAD_INIT(0, 0)
  "cupy.cuda.cusparse.DnMatBatchAttributes", /*tp_name*/
  sizeof(struct __pyx_obj_4cupy_4cuda_8cusparse_DnMatBatchAttributes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4cupy_4cuda_8cusparse_DnMatBatchAttributes, /*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*/
  "DnMatBatchAttributes(int count, int64_t stride)", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4cupy_4cuda_8cusparse_DnMatBatchAttributes, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4cupy_4cuda_8cusparse_DnMatBatchAttributes, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4cupy_4cuda_8cusparse_20DnMatBatchAttributes_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4cupy_4cuda_8cusparse_DnMatBatchAttributes, /*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
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {"check_status", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_1check_status, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_check_status},
  {"getVersion", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_3getVersion, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_2getVersion},
  {"create", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_7create, METH_NOARGS, __pyx_doc_4cupy_4cuda_8cusparse_6create},
  {"createMatDescr", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_9createMatDescr, METH_NOARGS, __pyx_doc_4cupy_4cuda_8cusparse_8createMatDescr},
  {"destroy", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_11destroy, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_10destroy},
  {"destroyMatDescr", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_13destroyMatDescr, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_12destroyMatDescr},
  {"setMatIndexBase", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_15setMatIndexBase, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_14setMatIndexBase},
  {"setMatType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_17setMatType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_16setMatType},
  {"setPointerMode", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_19setPointerMode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_18setPointerMode},
  {"setStream", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_21setStream, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_20setStream},
  {"getStream", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_23getStream, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_22getStream},
  {"sgthr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_25sgthr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_24sgthr},
  {"dgthr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_27dgthr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_26dgthr},
  {"cgthr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_29cgthr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_28cgthr},
  {"zgthr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_31zgthr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_30zgthr},
  {"scsrmv", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_33scsrmv, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_32scsrmv},
  {"dcsrmv", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_35dcsrmv, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_34dcsrmv},
  {"ccsrmv", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_37ccsrmv, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_36ccsrmv},
  {"zcsrmv", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_39zcsrmv, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_38zcsrmv},
  {"csrmvEx_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_41csrmvEx_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_40csrmvEx_bufferSize},
  {"csrmvEx", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_43csrmvEx, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_42csrmvEx},
  {"scsrmm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_45scsrmm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_44scsrmm},
  {"dcsrmm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_47dcsrmm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_46dcsrmm},
  {"ccsrmm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_49ccsrmm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_48ccsrmm},
  {"zcsrmm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_51zcsrmm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_50zcsrmm},
  {"scsrmm2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_53scsrmm2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_52scsrmm2},
  {"dcsrmm2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_55dcsrmm2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_54dcsrmm2},
  {"ccsrmm2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_57ccsrmm2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_56ccsrmm2},
  {"zcsrmm2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_59zcsrmm2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_58zcsrmm2},
  {"xcsrgeamNnz", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_61xcsrgeamNnz, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_60xcsrgeamNnz},
  {"scsrgeam", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_63scsrgeam, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_62scsrgeam},
  {"dcsrgeam", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_65dcsrgeam, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_64dcsrgeam},
  {"ccsrgeam", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_67ccsrgeam, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_66ccsrgeam},
  {"zcsrgeam", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_69zcsrgeam, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_68zcsrgeam},
  {"scsrgeam2_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_71scsrgeam2_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_70scsrgeam2_bufferSizeExt},
  {"dcsrgeam2_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_73dcsrgeam2_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_72dcsrgeam2_bufferSizeExt},
  {"ccsrgeam2_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_75ccsrgeam2_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_74ccsrgeam2_bufferSizeExt},
  {"zcsrgeam2_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_77zcsrgeam2_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_76zcsrgeam2_bufferSizeExt},
  {"xcsrgeam2Nnz", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_79xcsrgeam2Nnz, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_78xcsrgeam2Nnz},
  {"scsrgeam2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_81scsrgeam2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_80scsrgeam2},
  {"dcsrgeam2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_83dcsrgeam2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_82dcsrgeam2},
  {"ccsrgeam2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_85ccsrgeam2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_84ccsrgeam2},
  {"zcsrgeam2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_87zcsrgeam2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_86zcsrgeam2},
  {"xcsrgemmNnz", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_89xcsrgemmNnz, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_88xcsrgemmNnz},
  {"scsrgemm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_91scsrgemm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_90scsrgemm},
  {"dcsrgemm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_93dcsrgemm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_92dcsrgemm},
  {"ccsrgemm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_95ccsrgemm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_94ccsrgemm},
  {"zcsrgemm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_97zcsrgemm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_96zcsrgemm},
  {"createCsrgemm2Info", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_99createCsrgemm2Info, METH_NOARGS, __pyx_doc_4cupy_4cuda_8cusparse_98createCsrgemm2Info},
  {"destroyCsrgemm2Info", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_101destroyCsrgemm2Info, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_100destroyCsrgemm2Info},
  {"scsrgemm2_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_103scsrgemm2_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_102scsrgemm2_bufferSizeExt},
  {"dcsrgemm2_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_105dcsrgemm2_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_104dcsrgemm2_bufferSizeExt},
  {"ccsrgemm2_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_107ccsrgemm2_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_106ccsrgemm2_bufferSizeExt},
  {"zcsrgemm2_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_109zcsrgemm2_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_108zcsrgemm2_bufferSizeExt},
  {"xcsrgemm2Nnz", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_111xcsrgemm2Nnz, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_110xcsrgemm2Nnz},
  {"scsrgemm2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_113scsrgemm2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_112scsrgemm2},
  {"dcsrgemm2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_115dcsrgemm2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_114dcsrgemm2},
  {"ccsrgemm2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_117ccsrgemm2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_116ccsrgemm2},
  {"zcsrgemm2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_119zcsrgemm2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_118zcsrgemm2},
  {"xcoo2csr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_121xcoo2csr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_120xcoo2csr},
  {"scsc2dense", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_123scsc2dense, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_122scsc2dense},
  {"dcsc2dense", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_125dcsc2dense, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_124dcsc2dense},
  {"ccsc2dense", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_127ccsc2dense, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_126ccsc2dense},
  {"zcsc2dense", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_129zcsc2dense, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_128zcsc2dense},
  {"xcsr2coo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_131xcsr2coo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_130xcsr2coo},
  {"scsr2csc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_133scsr2csc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_132scsr2csc},
  {"dcsr2csc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_135dcsr2csc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_134dcsr2csc},
  {"ccsr2csc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_137ccsr2csc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_136ccsr2csc},
  {"zcsr2csc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_139zcsr2csc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_138zcsr2csc},
  {"scsr2dense", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_141scsr2dense, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_140scsr2dense},
  {"dcsr2dense", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_143dcsr2dense, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_142dcsr2dense},
  {"ccsr2dense", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_145ccsr2dense, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_144ccsr2dense},
  {"zcsr2dense", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_147zcsr2dense, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_146zcsr2dense},
  {"snnz_compress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_149snnz_compress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_148snnz_compress},
  {"dnnz_compress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_151dnnz_compress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_150dnnz_compress},
  {"cnnz_compress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_153cnnz_compress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_152cnnz_compress},
  {"znnz_compress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_155znnz_compress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_154znnz_compress},
  {"scsr2csr_compress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_157scsr2csr_compress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_156scsr2csr_compress},
  {"dcsr2csr_compress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_159dcsr2csr_compress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_158dcsr2csr_compress},
  {"ccsr2csr_compress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_161ccsr2csr_compress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_160ccsr2csr_compress},
  {"zcsr2csr_compress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_163zcsr2csr_compress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_162zcsr2csr_compress},
  {"sdense2csc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_165sdense2csc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_164sdense2csc},
  {"ddense2csc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_167ddense2csc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_166ddense2csc},
  {"cdense2csc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_169cdense2csc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_168cdense2csc},
  {"zdense2csc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_171zdense2csc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_170zdense2csc},
  {"sdense2csr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_173sdense2csr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_172sdense2csr},
  {"ddense2csr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_175ddense2csr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_174ddense2csr},
  {"cdense2csr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_177cdense2csr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_176cdense2csr},
  {"zdense2csr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_179zdense2csr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_178zdense2csr},
  {"snnz", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_181snnz, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_180snnz},
  {"dnnz", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_183dnnz, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_182dnnz},
  {"cnnz", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_185cnnz, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_184cnnz},
  {"znnz", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_187znnz, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_186znnz},
  {"createIdentityPermutation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_189createIdentityPermutation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_188createIdentityPermutation},
  {"xcoosort_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_191xcoosort_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_190xcoosort_bufferSizeExt},
  {"xcoosortByRow", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_193xcoosortByRow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_192xcoosortByRow},
  {"xcsrsort_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_195xcsrsort_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_194xcsrsort_bufferSizeExt},
  {"xcsrsort", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_197xcsrsort, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_196xcsrsort},
  {"xcscsort_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_199xcscsort_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_198xcscsort_bufferSizeExt},
  {"xcscsort", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_201xcscsort, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_200xcscsort},
  {"createCsrilu02Info", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_203createCsrilu02Info, METH_NOARGS, __pyx_doc_4cupy_4cuda_8cusparse_202createCsrilu02Info},
  {"destroyCsrilu02Info", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_205destroyCsrilu02Info, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_204destroyCsrilu02Info},
  {"createBsrilu02Info", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_207createBsrilu02Info, METH_NOARGS, __pyx_doc_4cupy_4cuda_8cusparse_206createBsrilu02Info},
  {"destroyBsrilu02Info", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_209destroyBsrilu02Info, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_208destroyBsrilu02Info},
  {"createCsric02Info", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_211createCsric02Info, METH_NOARGS, __pyx_doc_4cupy_4cuda_8cusparse_210createCsric02Info},
  {"destroyCsric02Info", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_213destroyCsric02Info, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_212destroyCsric02Info},
  {"createBsric02Info", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_215createBsric02Info, METH_NOARGS, __pyx_doc_4cupy_4cuda_8cusparse_214createBsric02Info},
  {"destroyBsric02Info", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_217destroyBsric02Info, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_216destroyBsric02Info},
  {"scsrilu02_numericBoost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_219scsrilu02_numericBoost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_218scsrilu02_numericBoost},
  {"dcsrilu02_numericBoost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_221dcsrilu02_numericBoost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_220dcsrilu02_numericBoost},
  {"ccsrilu02_numericBoost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_223ccsrilu02_numericBoost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_222ccsrilu02_numericBoost},
  {"zcsrilu02_numericBoost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_225zcsrilu02_numericBoost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_224zcsrilu02_numericBoost},
  {"xcsrilu02_zeroPivot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_227xcsrilu02_zeroPivot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_226xcsrilu02_zeroPivot},
  {"scsrilu02_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_229scsrilu02_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_228scsrilu02_bufferSize},
  {"dcsrilu02_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_231dcsrilu02_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_230dcsrilu02_bufferSize},
  {"ccsrilu02_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_233ccsrilu02_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_232ccsrilu02_bufferSize},
  {"zcsrilu02_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_235zcsrilu02_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_234zcsrilu02_bufferSize},
  {"scsrilu02_analysis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_237scsrilu02_analysis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_236scsrilu02_analysis},
  {"dcsrilu02_analysis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_239dcsrilu02_analysis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_238dcsrilu02_analysis},
  {"ccsrilu02_analysis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_241ccsrilu02_analysis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_240ccsrilu02_analysis},
  {"zcsrilu02_analysis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_243zcsrilu02_analysis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_242zcsrilu02_analysis},
  {"scsrilu02", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_245scsrilu02, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_244scsrilu02},
  {"dcsrilu02", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_247dcsrilu02, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_246dcsrilu02},
  {"ccsrilu02", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_249ccsrilu02, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_248ccsrilu02},
  {"zcsrilu02", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_251zcsrilu02, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_250zcsrilu02},
  {"sbsrilu02_numericBoost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_253sbsrilu02_numericBoost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_252sbsrilu02_numericBoost},
  {"dbsrilu02_numericBoost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_255dbsrilu02_numericBoost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_254dbsrilu02_numericBoost},
  {"cbsrilu02_numericBoost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_257cbsrilu02_numericBoost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_256cbsrilu02_numericBoost},
  {"zbsrilu02_numericBoost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_259zbsrilu02_numericBoost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_258zbsrilu02_numericBoost},
  {"xbsrilu02_zeroPivot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_261xbsrilu02_zeroPivot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_260xbsrilu02_zeroPivot},
  {"sbsrilu02_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_263sbsrilu02_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_262sbsrilu02_bufferSize},
  {"dbsrilu02_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_265dbsrilu02_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_264dbsrilu02_bufferSize},
  {"cbsrilu02_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_267cbsrilu02_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_266cbsrilu02_bufferSize},
  {"zbsrilu02_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_269zbsrilu02_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_268zbsrilu02_bufferSize},
  {"sbsrilu02_analysis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_271sbsrilu02_analysis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_270sbsrilu02_analysis},
  {"dbsrilu02_analysis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_273dbsrilu02_analysis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_272dbsrilu02_analysis},
  {"cbsrilu02_analysis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_275cbsrilu02_analysis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_274cbsrilu02_analysis},
  {"zbsrilu02_analysis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_277zbsrilu02_analysis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_276zbsrilu02_analysis},
  {"sbsrilu02", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_279sbsrilu02, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_278sbsrilu02},
  {"dbsrilu02", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_281dbsrilu02, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_280dbsrilu02},
  {"cbsrilu02", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_283cbsrilu02, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_282cbsrilu02},
  {"zbsrilu02", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_285zbsrilu02, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_284zbsrilu02},
  {"xcsric02_zeroPivot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_287xcsric02_zeroPivot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_286xcsric02_zeroPivot},
  {"scsric02_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_289scsric02_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_288scsric02_bufferSize},
  {"dcsric02_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_291dcsric02_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_290dcsric02_bufferSize},
  {"ccsric02_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_293ccsric02_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_292ccsric02_bufferSize},
  {"zcsric02_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_295zcsric02_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_294zcsric02_bufferSize},
  {"scsric02_analysis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_297scsric02_analysis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_296scsric02_analysis},
  {"dcsric02_analysis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_299dcsric02_analysis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_298dcsric02_analysis},
  {"ccsric02_analysis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_301ccsric02_analysis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_300ccsric02_analysis},
  {"zcsric02_analysis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_303zcsric02_analysis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_302zcsric02_analysis},
  {"scsric02", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_305scsric02, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_304scsric02},
  {"dcsric02", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_307dcsric02, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_306dcsric02},
  {"ccsric02", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_309ccsric02, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_308ccsric02},
  {"zcsric02", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_311zcsric02, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_310zcsric02},
  {"xbsric02_zeroPivot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_313xbsric02_zeroPivot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_312xbsric02_zeroPivot},
  {"sbsric02_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_315sbsric02_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_314sbsric02_bufferSize},
  {"dbsric02_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_317dbsric02_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_316dbsric02_bufferSize},
  {"cbsric02_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_319cbsric02_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_318cbsric02_bufferSize},
  {"zbsric02_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_321zbsric02_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_320zbsric02_bufferSize},
  {"sbsric02_analysis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_323sbsric02_analysis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_322sbsric02_analysis},
  {"dbsric02_analysis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_325dbsric02_analysis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_324dbsric02_analysis},
  {"cbsric02_analysis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_327cbsric02_analysis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_326cbsric02_analysis},
  {"zbsric02_analysis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_329zbsric02_analysis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_328zbsric02_analysis},
  {"sbsric02", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_331sbsric02, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_330sbsric02},
  {"dbsric02", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_333dbsric02, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_332dbsric02},
  {"cbsric02", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_335cbsric02, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_334cbsric02},
  {"zbsric02", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_337zbsric02, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_336zbsric02},
  {"sgtsv2_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_339sgtsv2_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_338sgtsv2_bufferSizeExt},
  {"dgtsv2_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_341dgtsv2_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_340dgtsv2_bufferSizeExt},
  {"cgtsv2_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_343cgtsv2_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_342cgtsv2_bufferSizeExt},
  {"zgtsv2_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_345zgtsv2_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_344zgtsv2_bufferSizeExt},
  {"sgtsv2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_347sgtsv2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_346sgtsv2},
  {"dgtsv2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_349dgtsv2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_348dgtsv2},
  {"cgtsv2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_351cgtsv2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_350cgtsv2},
  {"zgtsv2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_353zgtsv2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_352zgtsv2},
  {"sgtsv2_nopivot_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_355sgtsv2_nopivot_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_354sgtsv2_nopivot_bufferSizeExt},
  {"dgtsv2_nopivot_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_357dgtsv2_nopivot_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_356dgtsv2_nopivot_bufferSizeExt},
  {"cgtsv2_nopivot_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_359cgtsv2_nopivot_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_358cgtsv2_nopivot_bufferSizeExt},
  {"zgtsv2_nopivot_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_361zgtsv2_nopivot_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_360zgtsv2_nopivot_bufferSizeExt},
  {"sgtsv2_nopivot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_363sgtsv2_nopivot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_362sgtsv2_nopivot},
  {"dgtsv2_nopivot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_365dgtsv2_nopivot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_364dgtsv2_nopivot},
  {"cgtsv2_nopivot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_367cgtsv2_nopivot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_366cgtsv2_nopivot},
  {"zgtsv2_nopivot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_369zgtsv2_nopivot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_368zgtsv2_nopivot},
  {"sgtsv2StridedBatch_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_371sgtsv2StridedBatch_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_370sgtsv2StridedBatch_bufferSizeExt},
  {"dgtsv2StridedBatch_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_373dgtsv2StridedBatch_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_372dgtsv2StridedBatch_bufferSizeExt},
  {"cgtsv2StridedBatch_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_375cgtsv2StridedBatch_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_374cgtsv2StridedBatch_bufferSizeExt},
  {"zgtsv2StridedBatch_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_377zgtsv2StridedBatch_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_376zgtsv2StridedBatch_bufferSizeExt},
  {"sgtsv2StridedBatch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_379sgtsv2StridedBatch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_378sgtsv2StridedBatch},
  {"dgtsv2StridedBatch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_381dgtsv2StridedBatch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_380dgtsv2StridedBatch},
  {"cgtsv2StridedBatch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_383cgtsv2StridedBatch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_382cgtsv2StridedBatch},
  {"zgtsv2StridedBatch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_385zgtsv2StridedBatch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_384zgtsv2StridedBatch},
  {"sgtsvInterleavedBatch_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_387sgtsvInterleavedBatch_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_386sgtsvInterleavedBatch_bufferSizeExt},
  {"dgtsvInterleavedBatch_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_389dgtsvInterleavedBatch_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_388dgtsvInterleavedBatch_bufferSizeExt},
  {"cgtsvInterleavedBatch_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_391cgtsvInterleavedBatch_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_390cgtsvInterleavedBatch_bufferSizeExt},
  {"zgtsvInterleavedBatch_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_393zgtsvInterleavedBatch_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_392zgtsvInterleavedBatch_bufferSizeExt},
  {"sgtsvInterleavedBatch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_395sgtsvInterleavedBatch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_394sgtsvInterleavedBatch},
  {"dgtsvInterleavedBatch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_397dgtsvInterleavedBatch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_396dgtsvInterleavedBatch},
  {"cgtsvInterleavedBatch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_399cgtsvInterleavedBatch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_398cgtsvInterleavedBatch},
  {"zgtsvInterleavedBatch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_401zgtsvInterleavedBatch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_400zgtsvInterleavedBatch},
  {"sgpsvInterleavedBatch_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_403sgpsvInterleavedBatch_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_402sgpsvInterleavedBatch_bufferSizeExt},
  {"dgpsvInterleavedBatch_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_405dgpsvInterleavedBatch_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_404dgpsvInterleavedBatch_bufferSizeExt},
  {"cgpsvInterleavedBatch_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_407cgpsvInterleavedBatch_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_406cgpsvInterleavedBatch_bufferSizeExt},
  {"zgpsvInterleavedBatch_bufferSizeExt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_409zgpsvInterleavedBatch_bufferSizeExt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_408zgpsvInterleavedBatch_bufferSizeExt},
  {"sgpsvInterleavedBatch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_411sgpsvInterleavedBatch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_410sgpsvInterleavedBatch},
  {"dgpsvInterleavedBatch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_413dgpsvInterleavedBatch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_412dgpsvInterleavedBatch},
  {"cgpsvInterleavedBatch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_415cgpsvInterleavedBatch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_414cgpsvInterleavedBatch},
  {"zgpsvInterleavedBatch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_417zgpsvInterleavedBatch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_416zgpsvInterleavedBatch},
  {"createSpVec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_419createSpVec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_418createSpVec},
  {"destroySpVec", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_421destroySpVec, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_420destroySpVec},
  {"spVecGet", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_423spVecGet, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_422spVecGet},
  {"spVecGetIndexBase", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_425spVecGetIndexBase, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_424spVecGetIndexBase},
  {"spVecGetValues", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_427spVecGetValues, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_426spVecGetValues},
  {"spVecSetValues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_429spVecSetValues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_428spVecSetValues},
  {"createCoo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_431createCoo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_430createCoo},
  {"createCooAoS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_433createCooAoS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_432createCooAoS},
  {"createCsr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_435createCsr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_434createCsr},
  {"destroySpMat", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_437destroySpMat, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_436destroySpMat},
  {"cooGet", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_439cooGet, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_438cooGet},
  {"cooAoSGet", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_441cooAoSGet, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_440cooAoSGet},
  {"csrGet", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_443csrGet, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_442csrGet},
  {"spMatGetFormat", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_445spMatGetFormat, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_444spMatGetFormat},
  {"spMatGetIndexBase", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_447spMatGetIndexBase, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_446spMatGetIndexBase},
  {"spMatGetValues", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_449spMatGetValues, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_448spMatGetValues},
  {"spMatSetValues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_451spMatSetValues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_450spMatSetValues},
  {"spMatGetStridedBatch", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_453spMatGetStridedBatch, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_452spMatGetStridedBatch},
  {"spMatSetStridedBatch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_455spMatSetStridedBatch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_454spMatSetStridedBatch},
  {"createDnVec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_457createDnVec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_456createDnVec},
  {"destroyDnVec", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_459destroyDnVec, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_458destroyDnVec},
  {"dnVecGet", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_461dnVecGet, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_460dnVecGet},
  {"dnVecGetValues", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_463dnVecGetValues, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_462dnVecGetValues},
  {"dnVecSetValues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_465dnVecSetValues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_464dnVecSetValues},
  {"createDnMat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_467createDnMat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_466createDnMat},
  {"destroyDnMat", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_469destroyDnMat, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_468destroyDnMat},
  {"dnMatGet", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_471dnMatGet, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_470dnMatGet},
  {"dnMatGetValues", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_473dnMatGetValues, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_472dnMatGetValues},
  {"dnMatSetValues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_475dnMatSetValues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_474dnMatSetValues},
  {"dnMatGetStridedBatch", (PyCFunction)__pyx_pw_4cupy_4cuda_8cusparse_477dnMatGetStridedBatch, METH_O, __pyx_doc_4cupy_4cuda_8cusparse_476dnMatGetStridedBatch},
  {"dnMatSetStridedBatch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_479dnMatSetStridedBatch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_478dnMatSetStridedBatch},
  {"spVV_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_481spVV_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_480spVV_bufferSize},
  {"spVV", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_483spVV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_482spVV},
  {"spMV_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_485spMV_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_484spMV_bufferSize},
  {"spMV", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_487spMV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_486spMV},
  {"spMM_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_489spMM_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_488spMM_bufferSize},
  {"spMM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_491spMM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_490spMM},
  {"constrainedGeMM_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_493constrainedGeMM_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_492constrainedGeMM_bufferSize},
  {"constrainedGeMM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_495constrainedGeMM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_494constrainedGeMM},
  {"csr2cscEx2_bufferSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_497csr2cscEx2_bufferSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_496csr2cscEx2_bufferSize},
  {"csr2cscEx2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4cupy_4cuda_8cusparse_499csr2cscEx2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4cupy_4cuda_8cusparse_498csr2cscEx2},
  {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_cusparse(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_cusparse},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "cusparse",
    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_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
  {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1},
  {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
  {&__pyx_n_u_CUSPARSE_STATUS_ALLOC_FAILED, __pyx_k_CUSPARSE_STATUS_ALLOC_FAILED, sizeof(__pyx_k_CUSPARSE_STATUS_ALLOC_FAILED), 0, 1, 0, 1},
  {&__pyx_n_u_CUSPARSE_STATUS_ARCH_MISMATCH, __pyx_k_CUSPARSE_STATUS_ARCH_MISMATCH, sizeof(__pyx_k_CUSPARSE_STATUS_ARCH_MISMATCH), 0, 1, 0, 1},
  {&__pyx_n_u_CUSPARSE_STATUS_EXECUTION_FAILED, __pyx_k_CUSPARSE_STATUS_EXECUTION_FAILED, sizeof(__pyx_k_CUSPARSE_STATUS_EXECUTION_FAILED), 0, 1, 0, 1},
  {&__pyx_n_u_CUSPARSE_STATUS_INTERNAL_ERROR, __pyx_k_CUSPARSE_STATUS_INTERNAL_ERROR, sizeof(__pyx_k_CUSPARSE_STATUS_INTERNAL_ERROR), 0, 1, 0, 1},
  {&__pyx_n_u_CUSPARSE_STATUS_INVALID_VALUE, __pyx_k_CUSPARSE_STATUS_INVALID_VALUE, sizeof(__pyx_k_CUSPARSE_STATUS_INVALID_VALUE), 0, 1, 0, 1},
  {&__pyx_n_u_CUSPARSE_STATUS_MAPPING_ERROR, __pyx_k_CUSPARSE_STATUS_MAPPING_ERROR, sizeof(__pyx_k_CUSPARSE_STATUS_MAPPING_ERROR), 0, 1, 0, 1},
  {&__pyx_n_u_CUSPARSE_STATUS_MATRIX_TYPE_NOT, __pyx_k_CUSPARSE_STATUS_MATRIX_TYPE_NOT, sizeof(__pyx_k_CUSPARSE_STATUS_MATRIX_TYPE_NOT), 0, 1, 0, 1},
  {&__pyx_n_u_CUSPARSE_STATUS_NOT_INITIALIZED, __pyx_k_CUSPARSE_STATUS_NOT_INITIALIZED, sizeof(__pyx_k_CUSPARSE_STATUS_NOT_INITIALIZED), 0, 1, 0, 1},
  {&__pyx_n_u_CUSPARSE_STATUS_NOT_SUPPORTED, __pyx_k_CUSPARSE_STATUS_NOT_SUPPORTED, sizeof(__pyx_k_CUSPARSE_STATUS_NOT_SUPPORTED), 0, 1, 0, 1},
  {&__pyx_n_u_CUSPARSE_STATUS_SUCCESS, __pyx_k_CUSPARSE_STATUS_SUCCESS, sizeof(__pyx_k_CUSPARSE_STATUS_SUCCESS), 0, 1, 0, 1},
  {&__pyx_n_u_CUSPARSE_STATUS_ZERO_PIVOT, __pyx_k_CUSPARSE_STATUS_ZERO_PIVOT, sizeof(__pyx_k_CUSPARSE_STATUS_ZERO_PIVOT), 0, 1, 0, 1},
  {&__pyx_n_s_CooAoSAttributes, __pyx_k_CooAoSAttributes, sizeof(__pyx_k_CooAoSAttributes), 0, 0, 1, 1},
  {&__pyx_n_s_CooAttributes, __pyx_k_CooAttributes, sizeof(__pyx_k_CooAttributes), 0, 0, 1, 1},
  {&__pyx_n_s_CsrAttributes, __pyx_k_CsrAttributes, sizeof(__pyx_k_CsrAttributes), 0, 0, 1, 1},
  {&__pyx_n_s_CuSparseError, __pyx_k_CuSparseError, sizeof(__pyx_k_CuSparseError), 0, 0, 1, 1},
  {&__pyx_n_s_CuSparseError___init, __pyx_k_CuSparseError___init, sizeof(__pyx_k_CuSparseError___init), 0, 0, 1, 1},
  {&__pyx_n_s_CuSparseError___reduce, __pyx_k_CuSparseError___reduce, sizeof(__pyx_k_CuSparseError___reduce), 0, 0, 1, 1},
  {&__pyx_n_s_DnMatAttributes, __pyx_k_DnMatAttributes, sizeof(__pyx_k_DnMatAttributes), 0, 0, 1, 1},
  {&__pyx_n_s_DnMatBatchAttributes, __pyx_k_DnMatBatchAttributes, sizeof(__pyx_k_DnMatBatchAttributes), 0, 0, 1, 1},
  {&__pyx_n_s_DnVecAttributes, __pyx_k_DnVecAttributes, sizeof(__pyx_k_DnVecAttributes), 0, 0, 1, 1},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x09, __pyx_k_Incompatible_checksums_s_vs_0x09, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x09), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x41, __pyx_k_Incompatible_checksums_s_vs_0x41, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x41), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x7f, __pyx_k_Incompatible_checksums_s_vs_0x7f, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x7f), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x9d, __pyx_k_Incompatible_checksums_s_vs_0x9d, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x9d), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb6, __pyx_k_Incompatible_checksums_s_vs_0xb6, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb6), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xcb, __pyx_k_Incompatible_checksums_s_vs_0xcb, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xcb), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xd3, __pyx_k_Incompatible_checksums_s_vs_0xd3, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xd3), 0, 0, 1, 0},
  {&__pyx_n_s_P, __pyx_k_P, sizeof(__pyx_k_P), 0, 0, 1, 1},
  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_SpVecAttributes, __pyx_k_SpVecAttributes, sizeof(__pyx_k_SpVecAttributes), 0, 0, 1, 1},
  {&__pyx_n_s_alg, __pyx_k_alg, sizeof(__pyx_k_alg), 0, 0, 1, 1},
  {&__pyx_n_s_algo, __pyx_k_algo, sizeof(__pyx_k_algo), 0, 0, 1, 1},
  {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1},
  {&__pyx_n_s_alphatype, __pyx_k_alphatype, sizeof(__pyx_k_alphatype), 0, 0, 1, 1},
  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
  {&__pyx_n_s_batchCount, __pyx_k_batchCount, sizeof(__pyx_k_batchCount), 0, 0, 1, 1},
  {&__pyx_n_s_batchStride, __pyx_k_batchStride, sizeof(__pyx_k_batchStride), 0, 0, 1, 1},
  {&__pyx_n_s_beta, __pyx_k_beta, sizeof(__pyx_k_beta), 0, 0, 1, 1},
  {&__pyx_n_s_betatype, __pyx_k_betatype, sizeof(__pyx_k_betatype), 0, 0, 1, 1},
  {&__pyx_n_s_blockDim, __pyx_k_blockDim, sizeof(__pyx_k_blockDim), 0, 0, 1, 1},
  {&__pyx_n_s_boost_val, __pyx_k_boost_val, sizeof(__pyx_k_boost_val), 0, 0, 1, 1},
  {&__pyx_n_s_bsrSortedColInd, __pyx_k_bsrSortedColInd, sizeof(__pyx_k_bsrSortedColInd), 0, 0, 1, 1},
  {&__pyx_n_s_bsrSortedRowPtr, __pyx_k_bsrSortedRowPtr, sizeof(__pyx_k_bsrSortedRowPtr), 0, 0, 1, 1},
  {&__pyx_n_s_bsrSortedVal, __pyx_k_bsrSortedVal, sizeof(__pyx_k_bsrSortedVal), 0, 0, 1, 1},
  {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_bufferSizeInBytes, __pyx_k_bufferSizeInBytes, sizeof(__pyx_k_bufferSizeInBytes), 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_colIdx, __pyx_k_colIdx, sizeof(__pyx_k_colIdx), 0, 0, 1, 1},
  {&__pyx_n_s_colIdxType, __pyx_k_colIdxType, sizeof(__pyx_k_colIdxType), 0, 0, 1, 1},
  {&__pyx_n_s_cols, __pyx_k_cols, sizeof(__pyx_k_cols), 0, 0, 1, 1},
  {&__pyx_n_s_computeType, __pyx_k_computeType, sizeof(__pyx_k_computeType), 0, 0, 1, 1},
  {&__pyx_n_s_cooColInd, __pyx_k_cooColInd, sizeof(__pyx_k_cooColInd), 0, 0, 1, 1},
  {&__pyx_n_s_cooCols, __pyx_k_cooCols, sizeof(__pyx_k_cooCols), 0, 0, 1, 1},
  {&__pyx_n_s_cooIdxType, __pyx_k_cooIdxType, sizeof(__pyx_k_cooIdxType), 0, 0, 1, 1},
  {&__pyx_n_s_cooInd, __pyx_k_cooInd, sizeof(__pyx_k_cooInd), 0, 0, 1, 1},
  {&__pyx_n_s_cooRowInd, __pyx_k_cooRowInd, sizeof(__pyx_k_cooRowInd), 0, 0, 1, 1},
  {&__pyx_n_s_cooRows, __pyx_k_cooRows, sizeof(__pyx_k_cooRows), 0, 0, 1, 1},
  {&__pyx_n_s_cooValues, __pyx_k_cooValues, sizeof(__pyx_k_cooValues), 0, 0, 1, 1},
  {&__pyx_n_s_copyValues, __pyx_k_copyValues, sizeof(__pyx_k_copyValues), 0, 0, 1, 1},
  {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
  {&__pyx_n_s_cscColPtr, __pyx_k_cscColPtr, sizeof(__pyx_k_cscColPtr), 0, 0, 1, 1},
  {&__pyx_n_s_cscColPtrA, __pyx_k_cscColPtrA, sizeof(__pyx_k_cscColPtrA), 0, 0, 1, 1},
  {&__pyx_n_s_cscRowInd, __pyx_k_cscRowInd, sizeof(__pyx_k_cscRowInd), 0, 0, 1, 1},
  {&__pyx_n_s_cscRowIndA, __pyx_k_cscRowIndA, sizeof(__pyx_k_cscRowIndA), 0, 0, 1, 1},
  {&__pyx_n_s_cscSortedColPtrA, __pyx_k_cscSortedColPtrA, sizeof(__pyx_k_cscSortedColPtrA), 0, 0, 1, 1},
  {&__pyx_n_s_cscSortedRowIndA, __pyx_k_cscSortedRowIndA, sizeof(__pyx_k_cscSortedRowIndA), 0, 0, 1, 1},
  {&__pyx_n_s_cscSortedValA, __pyx_k_cscSortedValA, sizeof(__pyx_k_cscSortedValA), 0, 0, 1, 1},
  {&__pyx_n_s_cscVal, __pyx_k_cscVal, sizeof(__pyx_k_cscVal), 0, 0, 1, 1},
  {&__pyx_n_s_cscValA, __pyx_k_cscValA, sizeof(__pyx_k_cscValA), 0, 0, 1, 1},
  {&__pyx_n_s_csrColInd, __pyx_k_csrColInd, sizeof(__pyx_k_csrColInd), 0, 0, 1, 1},
  {&__pyx_n_s_csrColIndA, __pyx_k_csrColIndA, sizeof(__pyx_k_csrColIndA), 0, 0, 1, 1},
  {&__pyx_n_s_csrColIndB, __pyx_k_csrColIndB, sizeof(__pyx_k_csrColIndB), 0, 0, 1, 1},
  {&__pyx_n_s_csrColIndC, __pyx_k_csrColIndC, sizeof(__pyx_k_csrColIndC), 0, 0, 1, 1},
  {&__pyx_n_s_csrColIndD, __pyx_k_csrColIndD, sizeof(__pyx_k_csrColIndD), 0, 0, 1, 1},
  {&__pyx_n_s_csrColIndType, __pyx_k_csrColIndType, sizeof(__pyx_k_csrColIndType), 0, 0, 1, 1},
  {&__pyx_n_s_csrColind, __pyx_k_csrColind, sizeof(__pyx_k_csrColind), 0, 0, 1, 1},
  {&__pyx_n_s_csrRowOffsets, __pyx_k_csrRowOffsets, sizeof(__pyx_k_csrRowOffsets), 0, 0, 1, 1},
  {&__pyx_n_s_csrRowOffsetsType, __pyx_k_csrRowOffsetsType, sizeof(__pyx_k_csrRowOffsetsType), 0, 0, 1, 1},
  {&__pyx_n_s_csrRowPtr, __pyx_k_csrRowPtr, sizeof(__pyx_k_csrRowPtr), 0, 0, 1, 1},
  {&__pyx_n_s_csrRowPtrA, __pyx_k_csrRowPtrA, sizeof(__pyx_k_csrRowPtrA), 0, 0, 1, 1},
  {&__pyx_n_s_csrRowPtrB, __pyx_k_csrRowPtrB, sizeof(__pyx_k_csrRowPtrB), 0, 0, 1, 1},
  {&__pyx_n_s_csrRowPtrC, __pyx_k_csrRowPtrC, sizeof(__pyx_k_csrRowPtrC), 0, 0, 1, 1},
  {&__pyx_n_s_csrRowPtrD, __pyx_k_csrRowPtrD, sizeof(__pyx_k_csrRowPtrD), 0, 0, 1, 1},
  {&__pyx_n_s_csrSortedColIndA, __pyx_k_csrSortedColIndA, sizeof(__pyx_k_csrSortedColIndA), 0, 0, 1, 1},
  {&__pyx_n_s_csrSortedRowPtrA, __pyx_k_csrSortedRowPtrA, sizeof(__pyx_k_csrSortedRowPtrA), 0, 0, 1, 1},
  {&__pyx_n_s_csrSortedValA, __pyx_k_csrSortedValA, sizeof(__pyx_k_csrSortedValA), 0, 0, 1, 1},
  {&__pyx_n_s_csrSortedValA_valM, __pyx_k_csrSortedValA_valM, sizeof(__pyx_k_csrSortedValA_valM), 0, 0, 1, 1},
  {&__pyx_n_s_csrVal, __pyx_k_csrVal, sizeof(__pyx_k_csrVal), 0, 0, 1, 1},
  {&__pyx_n_s_csrValA, __pyx_k_csrValA, sizeof(__pyx_k_csrValA), 0, 0, 1, 1},
  {&__pyx_n_s_csrValAtype, __pyx_k_csrValAtype, sizeof(__pyx_k_csrValAtype), 0, 0, 1, 1},
  {&__pyx_n_s_csrValB, __pyx_k_csrValB, sizeof(__pyx_k_csrValB), 0, 0, 1, 1},
  {&__pyx_n_s_csrValC, __pyx_k_csrValC, sizeof(__pyx_k_csrValC), 0, 0, 1, 1},
  {&__pyx_n_s_csrValD, __pyx_k_csrValD, sizeof(__pyx_k_csrValD), 0, 0, 1, 1},
  {&__pyx_n_s_csrValues, __pyx_k_csrValues, sizeof(__pyx_k_csrValues), 0, 0, 1, 1},
  {&__pyx_n_s_cupy_cuda_cusparse, __pyx_k_cupy_cuda_cusparse, sizeof(__pyx_k_cupy_cuda_cusparse), 0, 0, 1, 1},
  {&__pyx_kp_s_cupy_cuda_cusparse_pyx, __pyx_k_cupy_cuda_cusparse_pyx, sizeof(__pyx_k_cupy_cuda_cusparse_pyx), 0, 0, 1, 0},
  {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
  {&__pyx_n_s_desc, __pyx_k_desc, sizeof(__pyx_k_desc), 0, 0, 1, 1},
  {&__pyx_n_s_descr, __pyx_k_descr, sizeof(__pyx_k_descr), 0, 0, 1, 1},
  {&__pyx_n_s_descrA, __pyx_k_descrA, sizeof(__pyx_k_descrA), 0, 0, 1, 1},
  {&__pyx_n_s_descrB, __pyx_k_descrB, sizeof(__pyx_k_descrB), 0, 0, 1, 1},
  {&__pyx_n_s_descrC, __pyx_k_descrC, sizeof(__pyx_k_descrC), 0, 0, 1, 1},
  {&__pyx_n_s_descrD, __pyx_k_descrD, sizeof(__pyx_k_descrD), 0, 0, 1, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_s_dirA, __pyx_k_dirA, sizeof(__pyx_k_dirA), 0, 0, 1, 1},
  {&__pyx_n_s_dl, __pyx_k_dl, sizeof(__pyx_k_dl), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_ds, __pyx_k_ds, sizeof(__pyx_k_ds), 0, 0, 1, 1},
  {&__pyx_n_s_du, __pyx_k_du, sizeof(__pyx_k_du), 0, 0, 1, 1},
  {&__pyx_n_s_dw, __pyx_k_dw, sizeof(__pyx_k_dw), 0, 0, 1, 1},
  {&__pyx_n_s_enable_boost, __pyx_k_enable_boost, sizeof(__pyx_k_enable_boost), 0, 0, 1, 1},
  {&__pyx_n_s_executiontype, __pyx_k_executiontype, sizeof(__pyx_k_executiontype), 0, 0, 1, 1},
  {&__pyx_n_s_externalBuffer, __pyx_k_externalBuffer, sizeof(__pyx_k_externalBuffer), 0, 0, 1, 1},
  {&__pyx_n_s_get_build_version, __pyx_k_get_build_version, sizeof(__pyx_k_get_build_version), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_s_handle, __pyx_k_handle, sizeof(__pyx_k_handle), 0, 0, 1, 1},
  {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1},
  {&__pyx_n_s_idxBase, __pyx_k_idxBase, sizeof(__pyx_k_idxBase), 0, 0, 1, 1},
  {&__pyx_n_s_idxType, __pyx_k_idxType, sizeof(__pyx_k_idxType), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_inColInd, __pyx_k_inColInd, sizeof(__pyx_k_inColInd), 0, 0, 1, 1},
  {&__pyx_n_s_inNnz, __pyx_k_inNnz, sizeof(__pyx_k_inNnz), 0, 0, 1, 1},
  {&__pyx_n_s_inRowPtr, __pyx_k_inRowPtr, sizeof(__pyx_k_inRowPtr), 0, 0, 1, 1},
  {&__pyx_n_s_inVal, __pyx_k_inVal, sizeof(__pyx_k_inVal), 0, 0, 1, 1},
  {&__pyx_n_s_ind, __pyx_k_ind, sizeof(__pyx_k_ind), 0, 0, 1, 1},
  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
  {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
  {&__pyx_n_s_ld, __pyx_k_ld, sizeof(__pyx_k_ld), 0, 0, 1, 1},
  {&__pyx_n_s_lda, __pyx_k_lda, sizeof(__pyx_k_lda), 0, 0, 1, 1},
  {&__pyx_n_s_ldb, __pyx_k_ldb, sizeof(__pyx_k_ldb), 0, 0, 1, 1},
  {&__pyx_n_s_ldc, __pyx_k_ldc, sizeof(__pyx_k_ldc), 0, 0, 1, 1},
  {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_matA, __pyx_k_matA, sizeof(__pyx_k_matA), 0, 0, 1, 1},
  {&__pyx_n_s_matB, __pyx_k_matB, sizeof(__pyx_k_matB), 0, 0, 1, 1},
  {&__pyx_n_s_matC, __pyx_k_matC, sizeof(__pyx_k_matC), 0, 0, 1, 1},
  {&__pyx_n_s_mb, __pyx_k_mb, sizeof(__pyx_k_mb), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_n_s_nnz, __pyx_k_nnz, sizeof(__pyx_k_nnz), 0, 0, 1, 1},
  {&__pyx_n_s_nnzA, __pyx_k_nnzA, sizeof(__pyx_k_nnzA), 0, 0, 1, 1},
  {&__pyx_n_s_nnzB, __pyx_k_nnzB, sizeof(__pyx_k_nnzB), 0, 0, 1, 1},
  {&__pyx_n_s_nnzD, __pyx_k_nnzD, sizeof(__pyx_k_nnzD), 0, 0, 1, 1},
  {&__pyx_n_s_nnzPerCol, __pyx_k_nnzPerCol, sizeof(__pyx_k_nnzPerCol), 0, 0, 1, 1},
  {&__pyx_n_s_nnzPerRow, __pyx_k_nnzPerRow, sizeof(__pyx_k_nnzPerRow), 0, 0, 1, 1},
  {&__pyx_n_s_nnzPerRowColumn, __pyx_k_nnzPerRowColumn, sizeof(__pyx_k_nnzPerRowColumn), 0, 0, 1, 1},
  {&__pyx_n_s_nnzTotalDevHostPtr, __pyx_k_nnzTotalDevHostPtr, sizeof(__pyx_k_nnzTotalDevHostPtr), 0, 0, 1, 1},
  {&__pyx_n_s_nnzb, __pyx_k_nnzb, sizeof(__pyx_k_nnzb), 0, 0, 1, 1},
  {&__pyx_n_s_opA, __pyx_k_opA, sizeof(__pyx_k_opA), 0, 0, 1, 1},
  {&__pyx_n_s_opB, __pyx_k_opB, sizeof(__pyx_k_opB), 0, 0, 1, 1},
  {&__pyx_n_s_opX, __pyx_k_opX, sizeof(__pyx_k_opX), 0, 0, 1, 1},
  {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1},
  {&__pyx_n_s_outColInd, __pyx_k_outColInd, sizeof(__pyx_k_outColInd), 0, 0, 1, 1},
  {&__pyx_n_s_outRowPtr, __pyx_k_outRowPtr, sizeof(__pyx_k_outRowPtr), 0, 0, 1, 1},
  {&__pyx_n_s_outVal, __pyx_k_outVal, sizeof(__pyx_k_outVal), 0, 0, 1, 1},
  {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
  {&__pyx_n_s_pBuffer, __pyx_k_pBuffer, sizeof(__pyx_k_pBuffer), 0, 0, 1, 1},
  {&__pyx_n_s_pInputBuffer, __pyx_k_pInputBuffer, sizeof(__pyx_k_pInputBuffer), 0, 0, 1, 1},
  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {&__pyx_n_s_policy, __pyx_k_policy, sizeof(__pyx_k_policy), 0, 0, 1, 1},
  {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_CooAoSAttributes, __pyx_k_pyx_unpickle_CooAoSAttributes, sizeof(__pyx_k_pyx_unpickle_CooAoSAttributes), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_CooAttributes, __pyx_k_pyx_unpickle_CooAttributes, sizeof(__pyx_k_pyx_unpickle_CooAttributes), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_CsrAttributes, __pyx_k_pyx_unpickle_CsrAttributes, sizeof(__pyx_k_pyx_unpickle_CsrAttributes), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_DnMatAttributes, __pyx_k_pyx_unpickle_DnMatAttributes, sizeof(__pyx_k_pyx_unpickle_DnMatAttributes), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_DnMatBatchAttribu, __pyx_k_pyx_unpickle_DnMatBatchAttribu, sizeof(__pyx_k_pyx_unpickle_DnMatBatchAttribu), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_DnVecAttributes, __pyx_k_pyx_unpickle_DnVecAttributes, sizeof(__pyx_k_pyx_unpickle_DnVecAttributes), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_SpVecAttributes, __pyx_k_pyx_unpickle_SpVecAttributes, sizeof(__pyx_k_pyx_unpickle_SpVecAttributes), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 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_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_rowIdx, __pyx_k_rowIdx, sizeof(__pyx_k_rowIdx), 0, 0, 1, 1},
  {&__pyx_n_s_rowOffsetType, __pyx_k_rowOffsetType, sizeof(__pyx_k_rowOffsetType), 0, 0, 1, 1},
  {&__pyx_n_s_rowOffsets, __pyx_k_rowOffsets, sizeof(__pyx_k_rowOffsets), 0, 0, 1, 1},
  {&__pyx_n_s_rowPtr, __pyx_k_rowPtr, sizeof(__pyx_k_rowPtr), 0, 0, 1, 1},
  {&__pyx_n_s_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 0, 0, 1, 1},
  {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
  {&__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_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_n_s_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 0, 1, 1},
  {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1},
  {&__pyx_n_s_stride, __pyx_k_stride, sizeof(__pyx_k_stride), 0, 0, 1, 1},
  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_tol, __pyx_k_tol, sizeof(__pyx_k_tol), 0, 0, 1, 1},
  {&__pyx_n_s_transA, __pyx_k_transA, sizeof(__pyx_k_transA), 0, 0, 1, 1},
  {&__pyx_n_s_transB, __pyx_k_transB, sizeof(__pyx_k_transB), 0, 0, 1, 1},
  {&__pyx_n_s_typ, __pyx_k_typ, sizeof(__pyx_k_typ), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_valType, __pyx_k_valType, sizeof(__pyx_k_valType), 0, 0, 1, 1},
  {&__pyx_n_s_valueType, __pyx_k_valueType, sizeof(__pyx_k_valueType), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_vecX, __pyx_k_vecX, sizeof(__pyx_k_vecX), 0, 0, 1, 1},
  {&__pyx_n_s_vecY, __pyx_k_vecY, sizeof(__pyx_k_vecY), 0, 0, 1, 1},
  {&__pyx_n_s_workspace, __pyx_k_workspace, sizeof(__pyx_k_workspace), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_xInd, __pyx_k_xInd, sizeof(__pyx_k_xInd), 0, 0, 1, 1},
  {&__pyx_n_s_xVal, __pyx_k_xVal, sizeof(__pyx_k_xVal), 0, 0, 1, 1},
  {&__pyx_n_s_xtype, __pyx_k_xtype, sizeof(__pyx_k_xtype), 0, 0, 1, 1},
  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  {&__pyx_n_s_ytype, __pyx_k_ytype, sizeof(__pyx_k_ytype), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 1273, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 1277, __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);

  /* "cupy/cuda/cusparse.pyx":1273
 * 
 * 
 * class CuSparseError(RuntimeError):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, int status):
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_builtin_RuntimeError); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "cupy/cuda/cusparse.pyx":1275
 * class CuSparseError(RuntimeError):
 * 
 *     def __init__(self, int status):             # <<<<<<<<<<<<<<
 *         self.status = status
 *         super(CuSparseError, self).__init__('%s' % (STATUS[status]))
 */
  __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_status); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 1275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);
  __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__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cupy_cuda_cusparse_pyx, __pyx_n_s_init, 1275, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 1275, __pyx_L1_error)

  /* "cupy/cuda/cusparse.pyx":1279
 *         super(CuSparseError, self).__init__('%s' % (STATUS[status]))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return (type(self), (self.status,))
 * 
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 1279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);
  __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cupy_cuda_cusparse_pyx, __pyx_n_s_reduce, 1279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 1279, __pyx_L1_error)

  /* "cupy/cuda/cusparse.pyx":1312
 * 
 * 
 * def get_build_version():             # <<<<<<<<<<<<<<
 *     return CUSPARSE_VERSION
 * 
 */
  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cupy_cuda_cusparse_pyx, __pyx_n_s_get_build_version, 1312, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 1312, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __pyx_unpickle_SpVecAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__7 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);
  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_SpVecAttributes, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_tuple__9 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);
  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_CooAttributes, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_tuple__11 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);
  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_CooAoSAttributes, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_tuple__13 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);
  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_CsrAttributes, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_tuple__15 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);
  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_DnVecAttributes, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_tuple__17 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);
  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_DnMatAttributes, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_tuple__19 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);
  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_DnMatBatchAttribu, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(2, 1, __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);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_10210616 = PyInt_FromLong(10210616L); if (unlikely(!__pyx_int_10210616)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_69187622 = PyInt_FromLong(69187622L); if (unlikely(!__pyx_int_69187622)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_133770810 = PyInt_FromLong(133770810L); if (unlikely(!__pyx_int_133770810)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_164824378 = PyInt_FromLong(164824378L); if (unlikely(!__pyx_int_164824378)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_191290712 = PyInt_FromLong(191290712L); if (unlikely(!__pyx_int_191290712)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_213641179 = PyInt_FromLong(213641179L); if (unlikely(!__pyx_int_213641179)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_221647839 = PyInt_FromLong(221647839L); if (unlikely(!__pyx_int_221647839)) __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_4cupy_4cuda_8cusparse_STATUS = ((PyObject*)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("create", (void (*)(void))__pyx_f_4cupy_4cuda_8cusparse_create, "size_t (int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("destroy", (void (*)(void))__pyx_f_4cupy_4cuda_8cusparse_destroy, "PyObject *(size_t, int __pyx_skip_dispatch)") < 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 ---*/
  if (PyType_Ready(&__pyx_type_4cupy_4cuda_8cusparse_SpVecAttributes) < 0) __PYX_ERR(0, 1183, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4cupy_4cuda_8cusparse_SpVecAttributes.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4cupy_4cuda_8cusparse_SpVecAttributes.tp_dictoffset && __pyx_type_4cupy_4cuda_8cusparse_SpVecAttributes.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4cupy_4cuda_8cusparse_SpVecAttributes.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SpVecAttributes, (PyObject *)&__pyx_type_4cupy_4cuda_8cusparse_SpVecAttributes) < 0) __PYX_ERR(0, 1183, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4cupy_4cuda_8cusparse_SpVecAttributes) < 0) __PYX_ERR(0, 1183, __pyx_L1_error)
  __pyx_ptype_4cupy_4cuda_8cusparse_SpVecAttributes = &__pyx_type_4cupy_4cuda_8cusparse_SpVecAttributes;
  if (PyType_Ready(&__pyx_type_4cupy_4cuda_8cusparse_CooAttributes) < 0) __PYX_ERR(0, 1197, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4cupy_4cuda_8cusparse_CooAttributes.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4cupy_4cuda_8cusparse_CooAttributes.tp_dictoffset && __pyx_type_4cupy_4cuda_8cusparse_CooAttributes.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4cupy_4cuda_8cusparse_CooAttributes.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CooAttributes, (PyObject *)&__pyx_type_4cupy_4cuda_8cusparse_CooAttributes) < 0) __PYX_ERR(0, 1197, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4cupy_4cuda_8cusparse_CooAttributes) < 0) __PYX_ERR(0, 1197, __pyx_L1_error)
  __pyx_ptype_4cupy_4cuda_8cusparse_CooAttributes = &__pyx_type_4cupy_4cuda_8cusparse_CooAttributes;
  if (PyType_Ready(&__pyx_type_4cupy_4cuda_8cusparse_CooAoSAttributes) < 0) __PYX_ERR(0, 1213, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4cupy_4cuda_8cusparse_CooAoSAttributes.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4cupy_4cuda_8cusparse_CooAoSAttributes.tp_dictoffset && __pyx_type_4cupy_4cuda_8cusparse_CooAoSAttributes.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4cupy_4cuda_8cusparse_CooAoSAttributes.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CooAoSAttributes, (PyObject *)&__pyx_type_4cupy_4cuda_8cusparse_CooAoSAttributes) < 0) __PYX_ERR(0, 1213, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4cupy_4cuda_8cusparse_CooAoSAttributes) < 0) __PYX_ERR(0, 1213, __pyx_L1_error)
  __pyx_ptype_4cupy_4cuda_8cusparse_CooAoSAttributes = &__pyx_type_4cupy_4cuda_8cusparse_CooAoSAttributes;
  if (PyType_Ready(&__pyx_type_4cupy_4cuda_8cusparse_CsrAttributes) < 0) __PYX_ERR(0, 1228, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4cupy_4cuda_8cusparse_CsrAttributes.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4cupy_4cuda_8cusparse_CsrAttributes.tp_dictoffset && __pyx_type_4cupy_4cuda_8cusparse_CsrAttributes.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4cupy_4cuda_8cusparse_CsrAttributes.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CsrAttributes, (PyObject *)&__pyx_type_4cupy_4cuda_8cusparse_CsrAttributes) < 0) __PYX_ERR(0, 1228, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4cupy_4cuda_8cusparse_CsrAttributes) < 0) __PYX_ERR(0, 1228, __pyx_L1_error)
  __pyx_ptype_4cupy_4cuda_8cusparse_CsrAttributes = &__pyx_type_4cupy_4cuda_8cusparse_CsrAttributes;
  if (PyType_Ready(&__pyx_type_4cupy_4cuda_8cusparse_DnVecAttributes) < 0) __PYX_ERR(0, 1246, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4cupy_4cuda_8cusparse_DnVecAttributes.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4cupy_4cuda_8cusparse_DnVecAttributes.tp_dictoffset && __pyx_type_4cupy_4cuda_8cusparse_DnVecAttributes.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4cupy_4cuda_8cusparse_DnVecAttributes.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DnVecAttributes, (PyObject *)&__pyx_type_4cupy_4cuda_8cusparse_DnVecAttributes) < 0) __PYX_ERR(0, 1246, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4cupy_4cuda_8cusparse_DnVecAttributes) < 0) __PYX_ERR(0, 1246, __pyx_L1_error)
  __pyx_ptype_4cupy_4cuda_8cusparse_DnVecAttributes = &__pyx_type_4cupy_4cuda_8cusparse_DnVecAttributes;
  if (PyType_Ready(&__pyx_type_4cupy_4cuda_8cusparse_DnMatAttributes) < 0) __PYX_ERR(0, 1254, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4cupy_4cuda_8cusparse_DnMatAttributes.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4cupy_4cuda_8cusparse_DnMatAttributes.tp_dictoffset && __pyx_type_4cupy_4cuda_8cusparse_DnMatAttributes.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4cupy_4cuda_8cusparse_DnMatAttributes.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DnMatAttributes, (PyObject *)&__pyx_type_4cupy_4cuda_8cusparse_DnMatAttributes) < 0) __PYX_ERR(0, 1254, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4cupy_4cuda_8cusparse_DnMatAttributes) < 0) __PYX_ERR(0, 1254, __pyx_L1_error)
  __pyx_ptype_4cupy_4cuda_8cusparse_DnMatAttributes = &__pyx_type_4cupy_4cuda_8cusparse_DnMatAttributes;
  if (PyType_Ready(&__pyx_type_4cupy_4cuda_8cusparse_DnMatBatchAttributes) < 0) __PYX_ERR(0, 1266, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4cupy_4cuda_8cusparse_DnMatBatchAttributes.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4cupy_4cuda_8cusparse_DnMatBatchAttributes.tp_dictoffset && __pyx_type_4cupy_4cuda_8cusparse_DnMatBatchAttributes.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4cupy_4cuda_8cusparse_DnMatBatchAttributes.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DnMatBatchAttributes, (PyObject *)&__pyx_type_4cupy_4cuda_8cusparse_DnMatBatchAttributes) < 0) __PYX_ERR(0, 1266, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4cupy_4cuda_8cusparse_DnMatBatchAttributes) < 0) __PYX_ERR(0, 1266, __pyx_L1_error)
  __pyx_ptype_4cupy_4cuda_8cusparse_DnMatBatchAttributes = &__pyx_type_4cupy_4cuda_8cusparse_DnMatBatchAttributes;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule("cupy.cuda.runtime"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_4cupy_4cuda_7runtime_PointerAttributes = __Pyx_ImportType(__pyx_t_1, "cupy.cuda.runtime", "PointerAttributes", sizeof(struct __pyx_obj_4cupy_4cuda_7runtime_PointerAttributes), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_4cupy_4cuda_7runtime_PointerAttributes) __PYX_ERR(3, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __pyx_t_1 = PyImport_ImportModule("cupy.cuda.runtime"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportVoidPtr(__pyx_t_1, "_is_hip_environment", (void **)&__pyx_vp_4cupy_4cuda_7runtime__is_hip_environment, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr(__pyx_t_1, "deviceAttributeComputeCapabilityMajor", (void **)&__pyx_vp_4cupy_4cuda_7runtime_deviceAttributeComputeCapabilityMajor, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr(__pyx_t_1, "deviceAttributeComputeCapabilityMinor", (void **)&__pyx_vp_4cupy_4cuda_7runtime_deviceAttributeComputeCapabilityMinor, "int") < 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;
}

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("cupy.cuda.stream"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportFunction(__pyx_t_1, "get_current_stream_ptr", (void (**)(void))&__pyx_f_4cupy_4cuda_6stream_get_current_stream_ptr, "intptr_t (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}


#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 initcusparse(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initcusparse(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_cusparse(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_cusparse(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_cusparse(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = 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 'cusparse' 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_cusparse(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(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #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("cusparse", __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_cupy__cuda__cusparse) {
    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, "cupy.cuda.cusparse")) {
      if (unlikely(PyDict_SetItemString(modules, "cupy.cuda.cusparse", __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)
  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely(__Pyx_modinit_variable_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  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

  /* "cupy/cuda/cusparse.pyx":1169
 * 
 * cdef dict STATUS = {
 *     0: 'CUSPARSE_STATUS_SUCCESS',             # <<<<<<<<<<<<<<
 *     1: 'CUSPARSE_STATUS_NOT_INITIALIZED',
 *     2: 'CUSPARSE_STATUS_ALLOC_FAILED',
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_0, __pyx_n_u_CUSPARSE_STATUS_SUCCESS) < 0) __PYX_ERR(0, 1169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_1, __pyx_n_u_CUSPARSE_STATUS_NOT_INITIALIZED) < 0) __PYX_ERR(0, 1169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_2, __pyx_n_u_CUSPARSE_STATUS_ALLOC_FAILED) < 0) __PYX_ERR(0, 1169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_3, __pyx_n_u_CUSPARSE_STATUS_INVALID_VALUE) < 0) __PYX_ERR(0, 1169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_4, __pyx_n_u_CUSPARSE_STATUS_ARCH_MISMATCH) < 0) __PYX_ERR(0, 1169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_5, __pyx_n_u_CUSPARSE_STATUS_MAPPING_ERROR) < 0) __PYX_ERR(0, 1169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_6, __pyx_n_u_CUSPARSE_STATUS_EXECUTION_FAILED) < 0) __PYX_ERR(0, 1169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_7, __pyx_n_u_CUSPARSE_STATUS_INTERNAL_ERROR) < 0) __PYX_ERR(0, 1169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_8, __pyx_n_u_CUSPARSE_STATUS_MATRIX_TYPE_NOT) < 0) __PYX_ERR(0, 1169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_9, __pyx_n_u_CUSPARSE_STATUS_ZERO_PIVOT) < 0) __PYX_ERR(0, 1169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_10, __pyx_n_u_CUSPARSE_STATUS_NOT_SUPPORTED) < 0) __PYX_ERR(0, 1169, __pyx_L1_error)
  __Pyx_XGOTREF(__pyx_v_4cupy_4cuda_8cusparse_STATUS);
  __Pyx_DECREF_SET(__pyx_v_4cupy_4cuda_8cusparse_STATUS, ((PyObject*)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1273
 * 
 * 
 * class CuSparseError(RuntimeError):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, int status):
 */
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple_, __pyx_n_s_CuSparseError, __pyx_n_s_CuSparseError, (PyObject *) NULL, __pyx_n_s_cupy_cuda_cusparse, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cupy/cuda/cusparse.pyx":1275
 * class CuSparseError(RuntimeError):
 * 
 *     def __init__(self, int status):             # <<<<<<<<<<<<<<
 *         self.status = status
 *         super(CuSparseError, self).__init__('%s' % (STATUS[status]))
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4cupy_4cuda_8cusparse_13CuSparseError_1__init__, 0, __pyx_n_s_CuSparseError___init, NULL, __pyx_n_s_cupy_cuda_cusparse, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 1275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cupy/cuda/cusparse.pyx":1279
 *         super(CuSparseError, self).__init__('%s' % (STATUS[status]))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return (type(self), (self.status,))
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4cupy_4cuda_8cusparse_13CuSparseError_3__reduce__, 0, __pyx_n_s_CuSparseError___reduce, NULL, __pyx_n_s_cupy_cuda_cusparse, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_reduce, __pyx_t_3) < 0) __PYX_ERR(0, 1279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cupy/cuda/cusparse.pyx":1273
 * 
 * 
 * class CuSparseError(RuntimeError):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, int status):
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_CuSparseError, __pyx_tuple_, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CuSparseError, __pyx_t_3) < 0) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1312
 * 
 * 
 * def get_build_version():             # <<<<<<<<<<<<<<
 *     return CUSPARSE_VERSION
 * 
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cupy_4cuda_8cusparse_5get_build_version, NULL, __pyx_n_s_cupy_cuda_cusparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_build_version, __pyx_t_1) < 0) __PYX_ERR(0, 1312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_SpVecAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cupy_4cuda_8cusparse_501__pyx_unpickle_SpVecAttributes, NULL, __pyx_n_s_cupy_cuda_cusparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_SpVecAttributes, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle_SpVecAttributes__set_state(<SpVecAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SpVecAttributes__set_state(SpVecAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.idx = __pyx_state[0]; __pyx_result.idxBase = __pyx_state[1]; __pyx_result.idxType = __pyx_state[2]; __pyx_result.nnz = __pyx_state[3]; __pyx_result.size = __pyx_state[4]; __pyx_result.valueType = __pyx_state[5]; __pyx_result.values = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cupy_4cuda_8cusparse_503__pyx_unpickle_CooAttributes, NULL, __pyx_n_s_cupy_cuda_cusparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CooAttributes, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_CooAoSAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cupy_4cuda_8cusparse_505__pyx_unpickle_CooAoSAttributes, NULL, __pyx_n_s_cupy_cuda_cusparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CooAoSAttributes, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle_CooAoSAttributes__set_state(<CooAoSAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_CooAoSAttributes__set_state(CooAoSAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.cols = __pyx_state[0]; __pyx_result.idxBase = __pyx_state[1]; __pyx_result.idxType = __pyx_state[2]; __pyx_result.ind = __pyx_state[3]; __pyx_result.nnz = __pyx_state[4]; __pyx_result.rows = __pyx_state[5]; __pyx_result.valueType = __pyx_state[6]; __pyx_result.values = __pyx_state[7]
 *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cupy_4cuda_8cusparse_507__pyx_unpickle_CsrAttributes, NULL, __pyx_n_s_cupy_cuda_cusparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CsrAttributes, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_DnVecAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cupy_4cuda_8cusparse_509__pyx_unpickle_DnVecAttributes, NULL, __pyx_n_s_cupy_cuda_cusparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_DnVecAttributes, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle_DnVecAttributes__set_state(<DnVecAttributes> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_DnVecAttributes__set_state(DnVecAttributes __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.size = __pyx_state[0]; __pyx_result.valueType = __pyx_state[1]; __pyx_result.values = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cupy_4cuda_8cusparse_511__pyx_unpickle_DnMatAttributes, NULL, __pyx_n_s_cupy_cuda_cusparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_DnMatAttributes, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_DnMatBatchAttributes(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4cupy_4cuda_8cusparse_513__pyx_unpickle_DnMatBatchAttributes, NULL, __pyx_n_s_cupy_cuda_cusparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_DnMatBatchAttribu, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cupy/cuda/cusparse.pyx":1
 * cimport cython  # NOQA             # <<<<<<<<<<<<<<
 * 
 * from cupy.cuda cimport driver
 */
  __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;

  /*--- Wrapped vars code ---*/
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_ACTION_NUMERIC);
    if (unlikely(!wrapped)) __PYX_ERR(1, 60, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_ACTION_NUMERIC", wrapped) < 0) __PYX_ERR(1, 60, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_ACTION_SYMBOLIC);
    if (unlikely(!wrapped)) __PYX_ERR(1, 59, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_ACTION_SYMBOLIC", wrapped) < 0) __PYX_ERR(1, 59, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_ALG_MERGE_PATH);
    if (unlikely(!wrapped)) __PYX_ERR(1, 81, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_ALG_MERGE_PATH", wrapped) < 0) __PYX_ERR(1, 81, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_ALG_NAIVE);
    if (unlikely(!wrapped)) __PYX_ERR(1, 80, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_ALG_NAIVE", wrapped) < 0) __PYX_ERR(1, 80, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_COOMM_ALG1);
    if (unlikely(!wrapped)) __PYX_ERR(1, 98, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_COOMM_ALG1", wrapped) < 0) __PYX_ERR(1, 98, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_COOMM_ALG2);
    if (unlikely(!wrapped)) __PYX_ERR(1, 99, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_COOMM_ALG2", wrapped) < 0) __PYX_ERR(1, 99, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_COOMM_ALG3);
    if (unlikely(!wrapped)) __PYX_ERR(1, 100, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_COOMM_ALG3", wrapped) < 0) __PYX_ERR(1, 100, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_COOMV_ALG);
    if (unlikely(!wrapped)) __PYX_ERR(1, 93, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_COOMV_ALG", wrapped) < 0) __PYX_ERR(1, 93, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_CSR2CSC_ALG1);
    if (unlikely(!wrapped)) __PYX_ERR(1, 108, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_CSR2CSC_ALG1", wrapped) < 0) __PYX_ERR(1, 108, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_CSR2CSC_ALG2);
    if (unlikely(!wrapped)) __PYX_ERR(1, 109, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_CSR2CSC_ALG2", wrapped) < 0) __PYX_ERR(1, 109, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_CSRMM_ALG1);
    if (unlikely(!wrapped)) __PYX_ERR(1, 101, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_CSRMM_ALG1", wrapped) < 0) __PYX_ERR(1, 101, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_CSRMV_ALG1);
    if (unlikely(!wrapped)) __PYX_ERR(1, 94, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_CSRMV_ALG1", wrapped) < 0) __PYX_ERR(1, 94, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_CSRMV_ALG2);
    if (unlikely(!wrapped)) __PYX_ERR(1, 95, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_CSRMV_ALG2", wrapped) < 0) __PYX_ERR(1, 95, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_DIRECTION_COLUMN);
    if (unlikely(!wrapped)) __PYX_ERR(1, 75, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_DIRECTION_COLUMN", wrapped) < 0) __PYX_ERR(1, 75, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_DIRECTION_ROW);
    if (unlikely(!wrapped)) __PYX_ERR(1, 74, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_DIRECTION_ROW", wrapped) < 0) __PYX_ERR(1, 74, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_FORMAT_COO);
    if (unlikely(!wrapped)) __PYX_ERR(1, 86, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_FORMAT_COO", wrapped) < 0) __PYX_ERR(1, 86, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_FORMAT_COO_AOS);
    if (unlikely(!wrapped)) __PYX_ERR(1, 87, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_FORMAT_COO_AOS", wrapped) < 0) __PYX_ERR(1, 87, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_FORMAT_CSC);
    if (unlikely(!wrapped)) __PYX_ERR(1, 85, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_FORMAT_CSC", wrapped) < 0) __PYX_ERR(1, 85, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_FORMAT_CSR);
    if (unlikely(!wrapped)) __PYX_ERR(1, 84, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_FORMAT_CSR", wrapped) < 0) __PYX_ERR(1, 84, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_INDEX_16U);
    if (unlikely(!wrapped)) __PYX_ERR(1, 103, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_INDEX_16U", wrapped) < 0) __PYX_ERR(1, 103, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_INDEX_32I);
    if (unlikely(!wrapped)) __PYX_ERR(1, 104, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_INDEX_32I", wrapped) < 0) __PYX_ERR(1, 104, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_INDEX_64I);
    if (unlikely(!wrapped)) __PYX_ERR(1, 105, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_INDEX_64I", wrapped) < 0) __PYX_ERR(1, 105, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_INDEX_BASE_ONE);
    if (unlikely(!wrapped)) __PYX_ERR(1, 63, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_INDEX_BASE_ONE", wrapped) < 0) __PYX_ERR(1, 63, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_INDEX_BASE_ZERO);
    if (unlikely(!wrapped)) __PYX_ERR(1, 62, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_INDEX_BASE_ZERO", wrapped) < 0) __PYX_ERR(1, 62, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_MATRIX_TYPE_GENERAL);
    if (unlikely(!wrapped)) __PYX_ERR(1, 65, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_MATRIX_TYPE_GENERAL", wrapped) < 0) __PYX_ERR(1, 65, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_MATRIX_TYPE_HERMITIAN);
    if (unlikely(!wrapped)) __PYX_ERR(1, 67, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_MATRIX_TYPE_HERMITIAN", wrapped) < 0) __PYX_ERR(1, 67, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_MATRIX_TYPE_SYMMETRIC);
    if (unlikely(!wrapped)) __PYX_ERR(1, 66, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_MATRIX_TYPE_SYMMETRIC", wrapped) < 0) __PYX_ERR(1, 66, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_MATRIX_TYPE_TRIANGULAR);
    if (unlikely(!wrapped)) __PYX_ERR(1, 68, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_MATRIX_TYPE_TRIANGULAR", wrapped) < 0) __PYX_ERR(1, 68, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_MM_ALG_DEFAULT);
    if (unlikely(!wrapped)) __PYX_ERR(1, 97, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_MM_ALG_DEFAULT", wrapped) < 0) __PYX_ERR(1, 97, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_MV_ALG_DEFAULT);
    if (unlikely(!wrapped)) __PYX_ERR(1, 92, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_MV_ALG_DEFAULT", wrapped) < 0) __PYX_ERR(1, 92, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE);
    if (unlikely(!wrapped)) __PYX_ERR(1, 72, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE", wrapped) < 0) __PYX_ERR(1, 72, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_OPERATION_NON_TRANSPOSE);
    if (unlikely(!wrapped)) __PYX_ERR(1, 70, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_OPERATION_NON_TRANSPOSE", wrapped) < 0) __PYX_ERR(1, 70, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_OPERATION_TRANSPOSE);
    if (unlikely(!wrapped)) __PYX_ERR(1, 71, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_OPERATION_TRANSPOSE", wrapped) < 0) __PYX_ERR(1, 71, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_ORDER_COL);
    if (unlikely(!wrapped)) __PYX_ERR(1, 89, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_ORDER_COL", wrapped) < 0) __PYX_ERR(1, 89, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_ORDER_ROW);
    if (unlikely(!wrapped)) __PYX_ERR(1, 90, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_ORDER_ROW", wrapped) < 0) __PYX_ERR(1, 90, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_POINTER_MODE_DEVICE);
    if (unlikely(!wrapped)) __PYX_ERR(1, 57, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_POINTER_MODE_DEVICE", wrapped) < 0) __PYX_ERR(1, 57, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_POINTER_MODE_HOST);
    if (unlikely(!wrapped)) __PYX_ERR(1, 56, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_POINTER_MODE_HOST", wrapped) < 0) __PYX_ERR(1, 56, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_SOLVE_POLICY_NO_LEVEL);
    if (unlikely(!wrapped)) __PYX_ERR(1, 77, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_SOLVE_POLICY_NO_LEVEL", wrapped) < 0) __PYX_ERR(1, 77, __pyx_L1_error);
  }
  {
    PyObject* wrapped = __Pyx_PyInt_From_int(__pyx_e_4cupy_4cuda_8cusparse_CUSPARSE_SOLVE_POLICY_USE_LEVEL);
    if (unlikely(!wrapped)) __PYX_ERR(1, 78, __pyx_L1_error)
    if (PyObject_SetAttrString(__pyx_m, "CUSPARSE_SOLVE_POLICY_USE_LEVEL", wrapped) < 0) __PYX_ERR(1, 78, __pyx_L1_error);
  }

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init cupy.cuda.cusparse", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init cupy.cuda.cusparse");
  }
  __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);
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    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
bad:
    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

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

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* GetAttr3 */
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}

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

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->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

/* DictGetItem */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            if (unlikely(PyTuple_Check(key))) {
                PyObject* args = PyTuple_Pack(1, key);
                if (likely(args)) {
                    PyErr_SetObject(PyExc_KeyError, args);
                    Py_DECREF(args);
                }
            } else {
                PyErr_SetObject(PyExc_KeyError, key);
            }
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

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

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

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

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    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

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

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

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

/* 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_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
#else
    if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
#endif
#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);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
    size_t size, enum __Pyx_ImportType_CheckSize check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if ((size_t)basicsize < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* 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
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#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);
            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
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && 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;
}

/* Py3ClassCreate */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* 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;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    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);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* Declarations */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabs(b.real) >= fabs(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                double r = b.imag / b.real;
                double s = (double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            double r = b.real / b.imag;
            double s = (double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_double(a, a);
                    case 3:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, a);
                    case 4:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if (b.imag == 0) {
                    z.real = pow(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_double(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_cusparseIndexBase_t(cusparseIndexBase_t value) {
    const cusparseIndexBase_t neg_one = (cusparseIndexBase_t) ((cusparseIndexBase_t) 0 - (cusparseIndexBase_t) 1), const_zero = (cusparseIndexBase_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(cusparseIndexBase_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(cusparseIndexBase_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(cusparseIndexBase_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(cusparseIndexBase_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(cusparseIndexBase_t) <= 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(cusparseIndexBase_t),
                                     little, !is_unsigned);
    }
}

/* 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_cusparseIndexType_t(cusparseIndexType_t value) {
    const cusparseIndexType_t neg_one = (cusparseIndexType_t) ((cusparseIndexType_t) 0 - (cusparseIndexType_t) 1), const_zero = (cusparseIndexType_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(cusparseIndexType_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(cusparseIndexType_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(cusparseIndexType_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(cusparseIndexType_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(cusparseIndexType_t) <= 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(cusparseIndexType_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) {
    const int64_t neg_one = (int64_t) ((int64_t) 0 - (int64_t) 1), const_zero = (int64_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int64_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int64_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int64_t) <= 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(int64_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_cudaDataType(cudaDataType value) {
    const cudaDataType neg_one = (cudaDataType) ((cudaDataType) 0 - (cudaDataType) 1), const_zero = (cudaDataType) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(cudaDataType) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(cudaDataType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(cudaDataType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(cudaDataType) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(cudaDataType) <= 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(cudaDataType),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_cusparseOrder_t(cusparseOrder_t value) {
    const cusparseOrder_t neg_one = (cusparseOrder_t) ((cusparseOrder_t) 0 - (cusparseOrder_t) 1), const_zero = (cusparseOrder_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(cusparseOrder_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(cusparseOrder_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(cusparseOrder_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(cusparseOrder_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(cusparseOrder_t) <= 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(cusparseOrder_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    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);
    }
}

/* FromPy */
static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject* o) {
    Py_complex cval;
#if !CYTHON_COMPILING_IN_PYPY
    if (PyComplex_CheckExact(o))
        cval = ((PyComplexObject *)o)->cval;
    else
#endif
        cval = PyComplex_AsCComplex(o);
    return __pyx_t_double_complex_from_parts(
               (double)cval.real,
               (double)cval.imag);
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    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 cusparseIndexBase_t __Pyx_PyInt_As_cusparseIndexBase_t(PyObject *x) {
    const cusparseIndexBase_t neg_one = (cusparseIndexBase_t) ((cusparseIndexBase_t) 0 - (cusparseIndexBase_t) 1), const_zero = (cusparseIndexBase_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(cusparseIndexBase_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(cusparseIndexBase_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (cusparseIndexBase_t) 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 (cusparseIndexBase_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(cusparseIndexBase_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(cusparseIndexBase_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexBase_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseIndexBase_t) >= 2 * PyLong_SHIFT) {
                            return (cusparseIndexBase_t) (((((cusparseIndexBase_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseIndexBase_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexBase_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseIndexBase_t) >= 3 * PyLong_SHIFT) {
                            return (cusparseIndexBase_t) (((((((cusparseIndexBase_t)digits[2]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseIndexBase_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexBase_t, 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(cusparseIndexBase_t) >= 4 * PyLong_SHIFT) {
                            return (cusparseIndexBase_t) (((((((((cusparseIndexBase_t)digits[3]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[2]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexBase_t)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 (cusparseIndexBase_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(cusparseIndexBase_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseIndexBase_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseIndexBase_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseIndexBase_t, 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 (cusparseIndexBase_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(cusparseIndexBase_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(cusparseIndexBase_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(cusparseIndexBase_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexBase_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseIndexBase_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseIndexBase_t) (((cusparseIndexBase_t)-1)*(((((cusparseIndexBase_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(cusparseIndexBase_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexBase_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseIndexBase_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseIndexBase_t) ((((((cusparseIndexBase_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(cusparseIndexBase_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexBase_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseIndexBase_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseIndexBase_t) (((cusparseIndexBase_t)-1)*(((((((cusparseIndexBase_t)digits[2]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseIndexBase_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexBase_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseIndexBase_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseIndexBase_t) ((((((((cusparseIndexBase_t)digits[2]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(cusparseIndexBase_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexBase_t, 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(cusparseIndexBase_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseIndexBase_t) (((cusparseIndexBase_t)-1)*(((((((((cusparseIndexBase_t)digits[3]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[2]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseIndexBase_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexBase_t, 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(cusparseIndexBase_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseIndexBase_t) ((((((((((cusparseIndexBase_t)digits[3]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[2]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexBase_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(cusparseIndexBase_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseIndexBase_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseIndexBase_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseIndexBase_t, 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
            cusparseIndexBase_t 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 (cusparseIndexBase_t) -1;
        }
    } else {
        cusparseIndexBase_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (cusparseIndexBase_t) -1;
        val = __Pyx_PyInt_As_cusparseIndexBase_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to cusparseIndexBase_t");
    return (cusparseIndexBase_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to cusparseIndexBase_t");
    return (cusparseIndexBase_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE cusparseIndexType_t __Pyx_PyInt_As_cusparseIndexType_t(PyObject *x) {
    const cusparseIndexType_t neg_one = (cusparseIndexType_t) ((cusparseIndexType_t) 0 - (cusparseIndexType_t) 1), const_zero = (cusparseIndexType_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(cusparseIndexType_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(cusparseIndexType_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (cusparseIndexType_t) 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 (cusparseIndexType_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(cusparseIndexType_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(cusparseIndexType_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexType_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseIndexType_t) >= 2 * PyLong_SHIFT) {
                            return (cusparseIndexType_t) (((((cusparseIndexType_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseIndexType_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexType_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseIndexType_t) >= 3 * PyLong_SHIFT) {
                            return (cusparseIndexType_t) (((((((cusparseIndexType_t)digits[2]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseIndexType_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexType_t, 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(cusparseIndexType_t) >= 4 * PyLong_SHIFT) {
                            return (cusparseIndexType_t) (((((((((cusparseIndexType_t)digits[3]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[2]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexType_t)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 (cusparseIndexType_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(cusparseIndexType_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseIndexType_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseIndexType_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseIndexType_t, 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 (cusparseIndexType_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(cusparseIndexType_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(cusparseIndexType_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(cusparseIndexType_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexType_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseIndexType_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseIndexType_t) (((cusparseIndexType_t)-1)*(((((cusparseIndexType_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(cusparseIndexType_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexType_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseIndexType_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseIndexType_t) ((((((cusparseIndexType_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(cusparseIndexType_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexType_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseIndexType_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseIndexType_t) (((cusparseIndexType_t)-1)*(((((((cusparseIndexType_t)digits[2]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseIndexType_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexType_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseIndexType_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseIndexType_t) ((((((((cusparseIndexType_t)digits[2]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(cusparseIndexType_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexType_t, 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(cusparseIndexType_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseIndexType_t) (((cusparseIndexType_t)-1)*(((((((((cusparseIndexType_t)digits[3]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[2]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseIndexType_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseIndexType_t, 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(cusparseIndexType_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseIndexType_t) ((((((((((cusparseIndexType_t)digits[3]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[2]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[1]) << PyLong_SHIFT) | (cusparseIndexType_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(cusparseIndexType_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseIndexType_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseIndexType_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseIndexType_t, 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
            cusparseIndexType_t 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 (cusparseIndexType_t) -1;
        }
    } else {
        cusparseIndexType_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (cusparseIndexType_t) -1;
        val = __Pyx_PyInt_As_cusparseIndexType_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to cusparseIndexType_t");
    return (cusparseIndexType_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to cusparseIndexType_t");
    return (cusparseIndexType_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) {
    const int64_t neg_one = (int64_t) ((int64_t) 0 - (int64_t) 1), const_zero = (int64_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int64_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int64_t) 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 (int64_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int64_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) >= 2 * PyLong_SHIFT) {
                            return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) >= 3 * PyLong_SHIFT) {
                            return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, 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(int64_t) >= 4 * PyLong_SHIFT) {
                            return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)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 (int64_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int64_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, 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 (int64_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int64_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int64_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, 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(int64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, 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(int64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int64_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, 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
            int64_t 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 (int64_t) -1;
        }
    } else {
        int64_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int64_t) -1;
        val = __Pyx_PyInt_As_int64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int64_t");
    return (int64_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int64_t");
    return (int64_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE cudaDataType __Pyx_PyInt_As_cudaDataType(PyObject *x) {
    const cudaDataType neg_one = (cudaDataType) ((cudaDataType) 0 - (cudaDataType) 1), const_zero = (cudaDataType) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(cudaDataType) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(cudaDataType, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (cudaDataType) 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 (cudaDataType) 0;
                case  1: __PYX_VERIFY_RETURN_INT(cudaDataType, digit, digits[0])
                case 2:
                    if (8 * sizeof(cudaDataType) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cudaDataType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cudaDataType) >= 2 * PyLong_SHIFT) {
                            return (cudaDataType) (((((cudaDataType)digits[1]) << PyLong_SHIFT) | (cudaDataType)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cudaDataType) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cudaDataType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cudaDataType) >= 3 * PyLong_SHIFT) {
                            return (cudaDataType) (((((((cudaDataType)digits[2]) << PyLong_SHIFT) | (cudaDataType)digits[1]) << PyLong_SHIFT) | (cudaDataType)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cudaDataType) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cudaDataType, 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(cudaDataType) >= 4 * PyLong_SHIFT) {
                            return (cudaDataType) (((((((((cudaDataType)digits[3]) << PyLong_SHIFT) | (cudaDataType)digits[2]) << PyLong_SHIFT) | (cudaDataType)digits[1]) << PyLong_SHIFT) | (cudaDataType)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 (cudaDataType) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(cudaDataType) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cudaDataType, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cudaDataType) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cudaDataType, 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 (cudaDataType) 0;
                case -1: __PYX_VERIFY_RETURN_INT(cudaDataType, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(cudaDataType,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(cudaDataType) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cudaDataType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cudaDataType) - 1 > 2 * PyLong_SHIFT) {
                            return (cudaDataType) (((cudaDataType)-1)*(((((cudaDataType)digits[1]) << PyLong_SHIFT) | (cudaDataType)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(cudaDataType) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cudaDataType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cudaDataType) - 1 > 2 * PyLong_SHIFT) {
                            return (cudaDataType) ((((((cudaDataType)digits[1]) << PyLong_SHIFT) | (cudaDataType)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(cudaDataType) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cudaDataType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cudaDataType) - 1 > 3 * PyLong_SHIFT) {
                            return (cudaDataType) (((cudaDataType)-1)*(((((((cudaDataType)digits[2]) << PyLong_SHIFT) | (cudaDataType)digits[1]) << PyLong_SHIFT) | (cudaDataType)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cudaDataType) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cudaDataType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cudaDataType) - 1 > 3 * PyLong_SHIFT) {
                            return (cudaDataType) ((((((((cudaDataType)digits[2]) << PyLong_SHIFT) | (cudaDataType)digits[1]) << PyLong_SHIFT) | (cudaDataType)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(cudaDataType) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cudaDataType, 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(cudaDataType) - 1 > 4 * PyLong_SHIFT) {
                            return (cudaDataType) (((cudaDataType)-1)*(((((((((cudaDataType)digits[3]) << PyLong_SHIFT) | (cudaDataType)digits[2]) << PyLong_SHIFT) | (cudaDataType)digits[1]) << PyLong_SHIFT) | (cudaDataType)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cudaDataType) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cudaDataType, 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(cudaDataType) - 1 > 4 * PyLong_SHIFT) {
                            return (cudaDataType) ((((((((((cudaDataType)digits[3]) << PyLong_SHIFT) | (cudaDataType)digits[2]) << PyLong_SHIFT) | (cudaDataType)digits[1]) << PyLong_SHIFT) | (cudaDataType)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(cudaDataType) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cudaDataType, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cudaDataType) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cudaDataType, 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
            cudaDataType 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 (cudaDataType) -1;
        }
    } else {
        cudaDataType val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (cudaDataType) -1;
        val = __Pyx_PyInt_As_cudaDataType(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to cudaDataType");
    return (cudaDataType) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to cudaDataType");
    return (cudaDataType) -1;
}

/* CIntFromPy */
static CYTHON_INLINE cusparseOrder_t __Pyx_PyInt_As_cusparseOrder_t(PyObject *x) {
    const cusparseOrder_t neg_one = (cusparseOrder_t) ((cusparseOrder_t) 0 - (cusparseOrder_t) 1), const_zero = (cusparseOrder_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(cusparseOrder_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(cusparseOrder_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (cusparseOrder_t) 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 (cusparseOrder_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(cusparseOrder_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(cusparseOrder_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOrder_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseOrder_t) >= 2 * PyLong_SHIFT) {
                            return (cusparseOrder_t) (((((cusparseOrder_t)digits[1]) << PyLong_SHIFT) | (cusparseOrder_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseOrder_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOrder_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseOrder_t) >= 3 * PyLong_SHIFT) {
                            return (cusparseOrder_t) (((((((cusparseOrder_t)digits[2]) << PyLong_SHIFT) | (cusparseOrder_t)digits[1]) << PyLong_SHIFT) | (cusparseOrder_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseOrder_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOrder_t, 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(cusparseOrder_t) >= 4 * PyLong_SHIFT) {
                            return (cusparseOrder_t) (((((((((cusparseOrder_t)digits[3]) << PyLong_SHIFT) | (cusparseOrder_t)digits[2]) << PyLong_SHIFT) | (cusparseOrder_t)digits[1]) << PyLong_SHIFT) | (cusparseOrder_t)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 (cusparseOrder_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(cusparseOrder_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseOrder_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseOrder_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseOrder_t, 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 (cusparseOrder_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(cusparseOrder_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(cusparseOrder_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(cusparseOrder_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOrder_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseOrder_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseOrder_t) (((cusparseOrder_t)-1)*(((((cusparseOrder_t)digits[1]) << PyLong_SHIFT) | (cusparseOrder_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(cusparseOrder_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOrder_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseOrder_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseOrder_t) ((((((cusparseOrder_t)digits[1]) << PyLong_SHIFT) | (cusparseOrder_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(cusparseOrder_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOrder_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseOrder_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseOrder_t) (((cusparseOrder_t)-1)*(((((((cusparseOrder_t)digits[2]) << PyLong_SHIFT) | (cusparseOrder_t)digits[1]) << PyLong_SHIFT) | (cusparseOrder_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseOrder_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOrder_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseOrder_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseOrder_t) ((((((((cusparseOrder_t)digits[2]) << PyLong_SHIFT) | (cusparseOrder_t)digits[1]) << PyLong_SHIFT) | (cusparseOrder_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(cusparseOrder_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOrder_t, 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(cusparseOrder_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseOrder_t) (((cusparseOrder_t)-1)*(((((((((cusparseOrder_t)digits[3]) << PyLong_SHIFT) | (cusparseOrder_t)digits[2]) << PyLong_SHIFT) | (cusparseOrder_t)digits[1]) << PyLong_SHIFT) | (cusparseOrder_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseOrder_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOrder_t, 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(cusparseOrder_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseOrder_t) ((((((((((cusparseOrder_t)digits[3]) << PyLong_SHIFT) | (cusparseOrder_t)digits[2]) << PyLong_SHIFT) | (cusparseOrder_t)digits[1]) << PyLong_SHIFT) | (cusparseOrder_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(cusparseOrder_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseOrder_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseOrder_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseOrder_t, 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
            cusparseOrder_t 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 (cusparseOrder_t) -1;
        }
    } else {
        cusparseOrder_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (cusparseOrder_t) -1;
        val = __Pyx_PyInt_As_cusparseOrder_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to cusparseOrder_t");
    return (cusparseOrder_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to cusparseOrder_t");
    return (cusparseOrder_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    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;
}

/* CIntFromPy */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) ((size_t) 0 - (size_t) 1), const_zero = (size_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) 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 (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, 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(size_t) >= 4 * PyLong_SHIFT) {
                            return (size_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
#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 (size_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, 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 (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, 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(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((((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(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, 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(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_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
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, 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
            size_t 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 (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE cusparseOperation_t __Pyx_PyInt_As_cusparseOperation_t(PyObject *x) {
    const cusparseOperation_t neg_one = (cusparseOperation_t) ((cusparseOperation_t) 0 - (cusparseOperation_t) 1), const_zero = (cusparseOperation_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(cusparseOperation_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(cusparseOperation_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (cusparseOperation_t) 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 (cusparseOperation_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(cusparseOperation_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(cusparseOperation_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOperation_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseOperation_t) >= 2 * PyLong_SHIFT) {
                            return (cusparseOperation_t) (((((cusparseOperation_t)digits[1]) << PyLong_SHIFT) | (cusparseOperation_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseOperation_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOperation_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseOperation_t) >= 3 * PyLong_SHIFT) {
                            return (cusparseOperation_t) (((((((cusparseOperation_t)digits[2]) << PyLong_SHIFT) | (cusparseOperation_t)digits[1]) << PyLong_SHIFT) | (cusparseOperation_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseOperation_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOperation_t, 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(cusparseOperation_t) >= 4 * PyLong_SHIFT) {
                            return (cusparseOperation_t) (((((((((cusparseOperation_t)digits[3]) << PyLong_SHIFT) | (cusparseOperation_t)digits[2]) << PyLong_SHIFT) | (cusparseOperation_t)digits[1]) << PyLong_SHIFT) | (cusparseOperation_t)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 (cusparseOperation_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(cusparseOperation_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseOperation_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseOperation_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseOperation_t, 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 (cusparseOperation_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(cusparseOperation_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(cusparseOperation_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(cusparseOperation_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOperation_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseOperation_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseOperation_t) (((cusparseOperation_t)-1)*(((((cusparseOperation_t)digits[1]) << PyLong_SHIFT) | (cusparseOperation_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(cusparseOperation_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOperation_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseOperation_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseOperation_t) ((((((cusparseOperation_t)digits[1]) << PyLong_SHIFT) | (cusparseOperation_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(cusparseOperation_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOperation_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseOperation_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseOperation_t) (((cusparseOperation_t)-1)*(((((((cusparseOperation_t)digits[2]) << PyLong_SHIFT) | (cusparseOperation_t)digits[1]) << PyLong_SHIFT) | (cusparseOperation_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseOperation_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOperation_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseOperation_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseOperation_t) ((((((((cusparseOperation_t)digits[2]) << PyLong_SHIFT) | (cusparseOperation_t)digits[1]) << PyLong_SHIFT) | (cusparseOperation_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(cusparseOperation_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOperation_t, 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(cusparseOperation_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseOperation_t) (((cusparseOperation_t)-1)*(((((((((cusparseOperation_t)digits[3]) << PyLong_SHIFT) | (cusparseOperation_t)digits[2]) << PyLong_SHIFT) | (cusparseOperation_t)digits[1]) << PyLong_SHIFT) | (cusparseOperation_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseOperation_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseOperation_t, 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(cusparseOperation_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseOperation_t) ((((((((((cusparseOperation_t)digits[3]) << PyLong_SHIFT) | (cusparseOperation_t)digits[2]) << PyLong_SHIFT) | (cusparseOperation_t)digits[1]) << PyLong_SHIFT) | (cusparseOperation_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(cusparseOperation_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseOperation_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseOperation_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseOperation_t, 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
            cusparseOperation_t 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 (cusparseOperation_t) -1;
        }
    } else {
        cusparseOperation_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (cusparseOperation_t) -1;
        val = __Pyx_PyInt_As_cusparseOperation_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to cusparseOperation_t");
    return (cusparseOperation_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to cusparseOperation_t");
    return (cusparseOperation_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE cusparseSpMVAlg_t __Pyx_PyInt_As_cusparseSpMVAlg_t(PyObject *x) {
    const cusparseSpMVAlg_t neg_one = (cusparseSpMVAlg_t) ((cusparseSpMVAlg_t) 0 - (cusparseSpMVAlg_t) 1), const_zero = (cusparseSpMVAlg_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(cusparseSpMVAlg_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(cusparseSpMVAlg_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (cusparseSpMVAlg_t) 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 (cusparseSpMVAlg_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(cusparseSpMVAlg_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(cusparseSpMVAlg_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMVAlg_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseSpMVAlg_t) >= 2 * PyLong_SHIFT) {
                            return (cusparseSpMVAlg_t) (((((cusparseSpMVAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseSpMVAlg_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMVAlg_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseSpMVAlg_t) >= 3 * PyLong_SHIFT) {
                            return (cusparseSpMVAlg_t) (((((((cusparseSpMVAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseSpMVAlg_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMVAlg_t, 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(cusparseSpMVAlg_t) >= 4 * PyLong_SHIFT) {
                            return (cusparseSpMVAlg_t) (((((((((cusparseSpMVAlg_t)digits[3]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)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 (cusparseSpMVAlg_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(cusparseSpMVAlg_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseSpMVAlg_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseSpMVAlg_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseSpMVAlg_t, 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 (cusparseSpMVAlg_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(cusparseSpMVAlg_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(cusparseSpMVAlg_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(cusparseSpMVAlg_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMVAlg_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseSpMVAlg_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseSpMVAlg_t) (((cusparseSpMVAlg_t)-1)*(((((cusparseSpMVAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(cusparseSpMVAlg_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMVAlg_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseSpMVAlg_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseSpMVAlg_t) ((((((cusparseSpMVAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(cusparseSpMVAlg_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMVAlg_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseSpMVAlg_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseSpMVAlg_t) (((cusparseSpMVAlg_t)-1)*(((((((cusparseSpMVAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseSpMVAlg_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMVAlg_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseSpMVAlg_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseSpMVAlg_t) ((((((((cusparseSpMVAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(cusparseSpMVAlg_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMVAlg_t, 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(cusparseSpMVAlg_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseSpMVAlg_t) (((cusparseSpMVAlg_t)-1)*(((((((((cusparseSpMVAlg_t)digits[3]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseSpMVAlg_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMVAlg_t, 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(cusparseSpMVAlg_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseSpMVAlg_t) ((((((((((cusparseSpMVAlg_t)digits[3]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMVAlg_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(cusparseSpMVAlg_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseSpMVAlg_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseSpMVAlg_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseSpMVAlg_t, 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
            cusparseSpMVAlg_t 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 (cusparseSpMVAlg_t) -1;
        }
    } else {
        cusparseSpMVAlg_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (cusparseSpMVAlg_t) -1;
        val = __Pyx_PyInt_As_cusparseSpMVAlg_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to cusparseSpMVAlg_t");
    return (cusparseSpMVAlg_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to cusparseSpMVAlg_t");
    return (cusparseSpMVAlg_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE cusparseSpMMAlg_t __Pyx_PyInt_As_cusparseSpMMAlg_t(PyObject *x) {
    const cusparseSpMMAlg_t neg_one = (cusparseSpMMAlg_t) ((cusparseSpMMAlg_t) 0 - (cusparseSpMMAlg_t) 1), const_zero = (cusparseSpMMAlg_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(cusparseSpMMAlg_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(cusparseSpMMAlg_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (cusparseSpMMAlg_t) 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 (cusparseSpMMAlg_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(cusparseSpMMAlg_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(cusparseSpMMAlg_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMMAlg_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseSpMMAlg_t) >= 2 * PyLong_SHIFT) {
                            return (cusparseSpMMAlg_t) (((((cusparseSpMMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseSpMMAlg_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMMAlg_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseSpMMAlg_t) >= 3 * PyLong_SHIFT) {
                            return (cusparseSpMMAlg_t) (((((((cusparseSpMMAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseSpMMAlg_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMMAlg_t, 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(cusparseSpMMAlg_t) >= 4 * PyLong_SHIFT) {
                            return (cusparseSpMMAlg_t) (((((((((cusparseSpMMAlg_t)digits[3]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)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 (cusparseSpMMAlg_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(cusparseSpMMAlg_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseSpMMAlg_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseSpMMAlg_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseSpMMAlg_t, 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 (cusparseSpMMAlg_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(cusparseSpMMAlg_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(cusparseSpMMAlg_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(cusparseSpMMAlg_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMMAlg_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseSpMMAlg_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseSpMMAlg_t) (((cusparseSpMMAlg_t)-1)*(((((cusparseSpMMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(cusparseSpMMAlg_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMMAlg_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseSpMMAlg_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseSpMMAlg_t) ((((((cusparseSpMMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(cusparseSpMMAlg_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMMAlg_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseSpMMAlg_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseSpMMAlg_t) (((cusparseSpMMAlg_t)-1)*(((((((cusparseSpMMAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseSpMMAlg_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMMAlg_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseSpMMAlg_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseSpMMAlg_t) ((((((((cusparseSpMMAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(cusparseSpMMAlg_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMMAlg_t, 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(cusparseSpMMAlg_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseSpMMAlg_t) (((cusparseSpMMAlg_t)-1)*(((((((((cusparseSpMMAlg_t)digits[3]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseSpMMAlg_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseSpMMAlg_t, 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(cusparseSpMMAlg_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseSpMMAlg_t) ((((((((((cusparseSpMMAlg_t)digits[3]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseSpMMAlg_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(cusparseSpMMAlg_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseSpMMAlg_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseSpMMAlg_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseSpMMAlg_t, 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
            cusparseSpMMAlg_t 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 (cusparseSpMMAlg_t) -1;
        }
    } else {
        cusparseSpMMAlg_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (cusparseSpMMAlg_t) -1;
        val = __Pyx_PyInt_As_cusparseSpMMAlg_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to cusparseSpMMAlg_t");
    return (cusparseSpMMAlg_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to cusparseSpMMAlg_t");
    return (cusparseSpMMAlg_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE cusparseAction_t __Pyx_PyInt_As_cusparseAction_t(PyObject *x) {
    const cusparseAction_t neg_one = (cusparseAction_t) ((cusparseAction_t) 0 - (cusparseAction_t) 1), const_zero = (cusparseAction_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(cusparseAction_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(cusparseAction_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (cusparseAction_t) 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 (cusparseAction_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(cusparseAction_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(cusparseAction_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseAction_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseAction_t) >= 2 * PyLong_SHIFT) {
                            return (cusparseAction_t) (((((cusparseAction_t)digits[1]) << PyLong_SHIFT) | (cusparseAction_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseAction_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseAction_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseAction_t) >= 3 * PyLong_SHIFT) {
                            return (cusparseAction_t) (((((((cusparseAction_t)digits[2]) << PyLong_SHIFT) | (cusparseAction_t)digits[1]) << PyLong_SHIFT) | (cusparseAction_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseAction_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseAction_t, 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(cusparseAction_t) >= 4 * PyLong_SHIFT) {
                            return (cusparseAction_t) (((((((((cusparseAction_t)digits[3]) << PyLong_SHIFT) | (cusparseAction_t)digits[2]) << PyLong_SHIFT) | (cusparseAction_t)digits[1]) << PyLong_SHIFT) | (cusparseAction_t)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 (cusparseAction_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(cusparseAction_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseAction_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseAction_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseAction_t, 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 (cusparseAction_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(cusparseAction_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(cusparseAction_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(cusparseAction_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseAction_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseAction_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseAction_t) (((cusparseAction_t)-1)*(((((cusparseAction_t)digits[1]) << PyLong_SHIFT) | (cusparseAction_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(cusparseAction_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseAction_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseAction_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseAction_t) ((((((cusparseAction_t)digits[1]) << PyLong_SHIFT) | (cusparseAction_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(cusparseAction_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseAction_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseAction_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseAction_t) (((cusparseAction_t)-1)*(((((((cusparseAction_t)digits[2]) << PyLong_SHIFT) | (cusparseAction_t)digits[1]) << PyLong_SHIFT) | (cusparseAction_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseAction_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseAction_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseAction_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseAction_t) ((((((((cusparseAction_t)digits[2]) << PyLong_SHIFT) | (cusparseAction_t)digits[1]) << PyLong_SHIFT) | (cusparseAction_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(cusparseAction_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseAction_t, 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(cusparseAction_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseAction_t) (((cusparseAction_t)-1)*(((((((((cusparseAction_t)digits[3]) << PyLong_SHIFT) | (cusparseAction_t)digits[2]) << PyLong_SHIFT) | (cusparseAction_t)digits[1]) << PyLong_SHIFT) | (cusparseAction_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseAction_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseAction_t, 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(cusparseAction_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseAction_t) ((((((((((cusparseAction_t)digits[3]) << PyLong_SHIFT) | (cusparseAction_t)digits[2]) << PyLong_SHIFT) | (cusparseAction_t)digits[1]) << PyLong_SHIFT) | (cusparseAction_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(cusparseAction_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseAction_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseAction_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseAction_t, 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
            cusparseAction_t 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 (cusparseAction_t) -1;
        }
    } else {
        cusparseAction_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (cusparseAction_t) -1;
        val = __Pyx_PyInt_As_cusparseAction_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to cusparseAction_t");
    return (cusparseAction_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to cusparseAction_t");
    return (cusparseAction_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE cusparseCsr2CscAlg_t __Pyx_PyInt_As_cusparseCsr2CscAlg_t(PyObject *x) {
    const cusparseCsr2CscAlg_t neg_one = (cusparseCsr2CscAlg_t) ((cusparseCsr2CscAlg_t) 0 - (cusparseCsr2CscAlg_t) 1), const_zero = (cusparseCsr2CscAlg_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(cusparseCsr2CscAlg_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(cusparseCsr2CscAlg_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (cusparseCsr2CscAlg_t) 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 (cusparseCsr2CscAlg_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(cusparseCsr2CscAlg_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(cusparseCsr2CscAlg_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseCsr2CscAlg_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseCsr2CscAlg_t) >= 2 * PyLong_SHIFT) {
                            return (cusparseCsr2CscAlg_t) (((((cusparseCsr2CscAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseCsr2CscAlg_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseCsr2CscAlg_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseCsr2CscAlg_t) >= 3 * PyLong_SHIFT) {
                            return (cusparseCsr2CscAlg_t) (((((((cusparseCsr2CscAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseCsr2CscAlg_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseCsr2CscAlg_t, 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(cusparseCsr2CscAlg_t) >= 4 * PyLong_SHIFT) {
                            return (cusparseCsr2CscAlg_t) (((((((((cusparseCsr2CscAlg_t)digits[3]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)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 (cusparseCsr2CscAlg_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(cusparseCsr2CscAlg_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseCsr2CscAlg_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseCsr2CscAlg_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseCsr2CscAlg_t, 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 (cusparseCsr2CscAlg_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(cusparseCsr2CscAlg_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(cusparseCsr2CscAlg_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(cusparseCsr2CscAlg_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseCsr2CscAlg_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseCsr2CscAlg_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseCsr2CscAlg_t) (((cusparseCsr2CscAlg_t)-1)*(((((cusparseCsr2CscAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(cusparseCsr2CscAlg_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseCsr2CscAlg_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseCsr2CscAlg_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseCsr2CscAlg_t) ((((((cusparseCsr2CscAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(cusparseCsr2CscAlg_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseCsr2CscAlg_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseCsr2CscAlg_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseCsr2CscAlg_t) (((cusparseCsr2CscAlg_t)-1)*(((((((cusparseCsr2CscAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseCsr2CscAlg_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseCsr2CscAlg_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseCsr2CscAlg_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseCsr2CscAlg_t) ((((((((cusparseCsr2CscAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(cusparseCsr2CscAlg_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseCsr2CscAlg_t, 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(cusparseCsr2CscAlg_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseCsr2CscAlg_t) (((cusparseCsr2CscAlg_t)-1)*(((((((((cusparseCsr2CscAlg_t)digits[3]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseCsr2CscAlg_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseCsr2CscAlg_t, 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(cusparseCsr2CscAlg_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseCsr2CscAlg_t) ((((((((((cusparseCsr2CscAlg_t)digits[3]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[2]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[1]) << PyLong_SHIFT) | (cusparseCsr2CscAlg_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(cusparseCsr2CscAlg_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseCsr2CscAlg_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseCsr2CscAlg_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseCsr2CscAlg_t, 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
            cusparseCsr2CscAlg_t 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 (cusparseCsr2CscAlg_t) -1;
        }
    } else {
        cusparseCsr2CscAlg_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (cusparseCsr2CscAlg_t) -1;
        val = __Pyx_PyInt_As_cusparseCsr2CscAlg_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to cusparseCsr2CscAlg_t");
    return (cusparseCsr2CscAlg_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to cusparseCsr2CscAlg_t");
    return (cusparseCsr2CscAlg_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    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;
}

/* CIntFromPy */
static CYTHON_INLINE cusparseMatrixType_t __Pyx_PyInt_As_cusparseMatrixType_t(PyObject *x) {
    const cusparseMatrixType_t neg_one = (cusparseMatrixType_t) ((cusparseMatrixType_t) 0 - (cusparseMatrixType_t) 1), const_zero = (cusparseMatrixType_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(cusparseMatrixType_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(cusparseMatrixType_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (cusparseMatrixType_t) 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 (cusparseMatrixType_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(cusparseMatrixType_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(cusparseMatrixType_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseMatrixType_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseMatrixType_t) >= 2 * PyLong_SHIFT) {
                            return (cusparseMatrixType_t) (((((cusparseMatrixType_t)digits[1]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseMatrixType_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseMatrixType_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseMatrixType_t) >= 3 * PyLong_SHIFT) {
                            return (cusparseMatrixType_t) (((((((cusparseMatrixType_t)digits[2]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[1]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseMatrixType_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseMatrixType_t, 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(cusparseMatrixType_t) >= 4 * PyLong_SHIFT) {
                            return (cusparseMatrixType_t) (((((((((cusparseMatrixType_t)digits[3]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[2]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[1]) << PyLong_SHIFT) | (cusparseMatrixType_t)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 (cusparseMatrixType_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(cusparseMatrixType_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseMatrixType_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseMatrixType_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseMatrixType_t, 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 (cusparseMatrixType_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(cusparseMatrixType_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(cusparseMatrixType_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(cusparseMatrixType_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseMatrixType_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseMatrixType_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseMatrixType_t) (((cusparseMatrixType_t)-1)*(((((cusparseMatrixType_t)digits[1]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(cusparseMatrixType_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseMatrixType_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseMatrixType_t) - 1 > 2 * PyLong_SHIFT) {
                            return (cusparseMatrixType_t) ((((((cusparseMatrixType_t)digits[1]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(cusparseMatrixType_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseMatrixType_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseMatrixType_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseMatrixType_t) (((cusparseMatrixType_t)-1)*(((((((cusparseMatrixType_t)digits[2]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[1]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(cusparseMatrixType_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseMatrixType_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(cusparseMatrixType_t) - 1 > 3 * PyLong_SHIFT) {
                            return (cusparseMatrixType_t) ((((((((cusparseMatrixType_t)digits[2]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[1]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(cusparseMatrixType_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseMatrixType_t, 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(cusparseMatrixType_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseMatrixType_t) (((cusparseMatrixType_t)-1)*(((((((((cusparseMatrixType_t)digits[3]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[2]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[1]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(cusparseMatrixType_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(cusparseMatrixType_t, 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(cusparseMatrixType_t) - 1 > 4 * PyLong_SHIFT) {
                            return (cusparseMatrixType_t) ((((((((((cusparseMatrixType_t)digits[3]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[2]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[1]) << PyLong_SHIFT) | (cusparseMatrixType_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(cusparseMatrixType_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseMatrixType_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(cusparseMatrixType_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(cusparseMatrixType_t, 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
            cusparseMatrixType_t 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 (cusparseMatrixType_t) -1;
        }
    } else {
        cusparseMatrixType_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (cusparseMatrixType_t) -1;
        val = __Pyx_PyInt_As_cusparseMatrixType_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to cusparseMatrixType_t");
    return (cusparseMatrixType_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to cusparseMatrixType_t");
    return (cusparseMatrixType_t) -1;
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* FunctionExport */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000
    cobj = PyCapsule_New(tmp.p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

/* VoidPtrImport */
#ifndef __PYX_HAVE_RT_ImportVoidPtr
#define __PYX_HAVE_RT_ImportVoidPtr
static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, name);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C variable %.200s",
                PyModule_GetName(module), name);
        goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    *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 variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), name, sig, desc);
        goto bad;
    }
    *p = PyCObject_AsVoidPtr(cobj);}
#endif
    if (!(*p))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

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